<root>
<document scada='0' schema='103' license='1,94543468,6RB001' title='' description='' fcversion='655364' target='RPI.RPI.RPI4B' >
	<config data='' clkspd='76800000' simspd='0' usewdt='0' constif='0' SSH_IP='01652BBCDF86326B494402A4E3630162' SSH_User='04290E1CA5A9C98166F1AE45B9818BE5' SSH_Pass='2A80C63124BB10F7DD6171BB7AD97877' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug />
	<traces />
	<ghost >
		<FK2 >
			<data name='FK2D0' port='4294967295' pin='4294967295' />
			<data name='FK2D1' port='4294967295' pin='4294967295' />
			<data name='FK2D2' port='4294967295' pin='4294967295' />
			<data name='FK2D3' port='4294967295' pin='4294967295' />
			<data name='FK2D4' port='4294967295' pin='4294967295' />
			<data name='FK2D5' port='4294967295' pin='4294967295' />
			<data name='FK2D6' port='4294967295' pin='4294967295' />
			<data name='FK2D7' port='4294967295' pin='4294967295' />
			<data name='FK2D8' port='4294967295' pin='4294967295' />
			<data name='FK2D9' port='4294967295' pin='4294967295' />
			<data name='FK2D10' port='4294967295' pin='4294967295' />
			<data name='FK2D11' port='4294967295' pin='4294967295' />
			<data name='FK2D12' port='4294967295' pin='4294967295' />
			<data name='FK2D13' port='4294967295' pin='4294967295' />
			<data name='FK2D14' port='4294967295' pin='4294967295' />
			<data name='FK2D15' port='4294967295' pin='4294967295' />
			<data name='FK2A0' port='4294967295' pin='4294967295' />
			<data name='FK2A1' port='4294967295' pin='4294967295' />
			<data name='FK2A2' port='4294967295' pin='4294967295' />
			<data name='FK2A3' port='4294967295' pin='4294967295' />
			<data name='FK2A4' port='4294967295' pin='4294967295' />
			<data name='FK2A5' port='4294967295' pin='4294967295' />
		</FK2>
		<ICD >
			<data name='AnalogPrescaleValue' value='19' />
			<data name='DigitalSampleRate' value='100000' />
			<data name='BreakpointCount' value='8' />
			<data name='CallStackDepthCount' value='8' />
			<data name='ClockPort' value='6' />
			<data name='ClockPin' value='26' />
			<data name='DataPort' value='6' />
			<data name='DataPin' value='16' />
			<data name='UseDefaultPins' value='1' />
			<data name='WrapEnabled' value='1' />
			<data name='CommsDelayOverridden' value='0' />
			<data name='CommsDelay' value='14' />
			<data name='CalculatedCommsDelay' value='14' />
			<data name='AnalogEB2PrescaleValue' value='2' />
			<data name='DigitalEB2SampleRate' value='100000' />
		</ICD>
		<pins >
			<digital A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
			<analog A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
		</pins>
	</ghost>
	<components >
		<settings autoimg='0' center='1' unitscale='0' fixedscale='0' fixedx='25' fixedy='25' fixedz='25' headcode='0' />
		<definition guid='9362da78-22b5-4968-a1a9-577577767bf2' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='' category2='' category3='' bIs2dOnly='0' bIs3dOnly='0' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='1' scadaCompatible='0' embeddedCompatible='1' showmacros='1' iconpath='' />
		<component class_type='root' codename='ComponentRoot' panelId='-1' x='0' y='0' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' comp2dType='0' >
			<resources />
			<properties >
				<property name='Font' target='GLCD_RPI1::Base_GLCD::gLCD_Font1::Font' typeid='16' hidden='0' locked='0' info='Font picker to decide which font to use on your display.' filter='000Default 8 (Legacy)
001Arial 14
002Arial Bold 14
019Arial 24
049Arial Bold 24
022Arial 24 (Number Only)
020Arial 32
050Arial Bold 32
023Arial 32 (Number Only)
024Arial 39 (Number Only)
021Arial 40
051Arial Bold 40
029Arial Bold 47
025Arial 47 (Number Only)
028Arial 48
045Arial 59
052Arial Bold 60
046Arial 70
053Arial Bold 70
047Arial 80
054Arial Bold 80
048Arial 89
031Arial Bold 90
055Arial 100
056Arial Bold 100
057Arial 119
058Arial Bold 120
059Arial 130
060Arial Bold 130
061Arial 140
083Arial Bold 140
084Arial 150
085Arial Bold 150
086Arial Bold 159
033Arial Bold 159 (Number Only)
087Arial 160
006Calibri 10
005Calibri 11
007Calibri 14
016Calibri Lite 25
015Calibri Black 36 (Number Only)
088Calibri 37
003Corsiva 11
081Courier 9
082Courier Bold 11
035Courier 20
036Courier Bold 20
037Courier 29
038Courier Bold 30
039Courier 40
040Courier Bold  40
041Courier 50
042Courier Bold 50
044Courier Bold 58
043Courier 59
062Courier 69
063Courier Bold 70
064Courier 78
065Courier Bold 79
066Courier Bold 90
032Courier 90
067Courier 100
068Courier Bold 100
069Courier Bold 110
070Courier 113
071Courier Bold 120
072Courier 121
073Courier 128
074Courier Bold 130
075Courier 140
076Courier Bold 140
077Courier 150
078Courier Bold 150
079Courier 160
080Courier Bold 160
089Courier New 16
090Courier New 24
012Fixed 15 (Number Only)
013Fixed 16 (Number Only)
011Fixed 31 (Number Only)
030Fourteen Segment 48
026Seven Segment 24
027Seven Segment 32
034Seven Segment 89
004System 7
008Times New Roman 13
009Times New Roman 16
017Tiny6
010Verdana 12
014Verdana 24 (Number Only)
018Custom
' />
			</properties>
			<values >
				<value target='GLCD_RPI1::Base_GLCD::gLCD_Font1::Font' data='002' />
			</values>
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='STEP9_ENABLE' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='2' setinit='2' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP2_I2C_ADDR' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='117' setinit='0x75' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP_D3' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='18' setinit='18' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LCD_BL_ENABLE' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='23' setinit='23' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='WTHR_I2C_ADDR' type='u8' description='I2C address of weather peripheral' isconst='1' isHidden='0' isinit='1' usrinit='66' setinit='0x42' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ServoLimitRange' type='u32' description='Distance, in motor counts, between CW and CCW limits' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP_D2' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='17' setinit='17' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTC_AL_SECS_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='14' setinit='0x0E' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Button4_Text' type='T8' description='' isconst='0' isHidden='0' isinit='1' usrinit='&quot;&quot;' setinit='&quot;&quot;' >
						<array size='8' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP_D1' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='16' setinit='16' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SW5_IN' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='40' setinit='40' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ButtonSaved' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MessageLinesHorizontal' type='u16' description='' isconst='1' isHidden='0' isinit='1' usrinit='70' setinit='70' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Count' type='u16' description='Genral use UInt variable' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ServoCwSpeed' type='u16' description='NOT USED Servo CW Speed in Rev/Sec x 100, Max 10000 (100.00 RPS) Min 1 (0.01RPS)' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='STEP4_ENABLE' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='10' setinit='10' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTC_CAL_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='8' setinit='0x08' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='IconTextVertical' type='u16' description='' isconst='1' isHidden='0' isinit='1' usrinit='246' setinit='246' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP_P1_CONFIG_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='7' setinit='0x07' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FLUOROx5_CH' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='7' setinit='7' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Button2_Text' type='T8' description='' isconst='0' isHidden='0' isinit='1' usrinit='&quot;&quot;' setinit='&quot;&quot;' >
						<array size='8' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ServoCcwEndPosition' type='u32' description='Servo End Position in steps from CCW Limit' isconst='0' isHidden='0' isinit='1' usrinit='5000' setinit='5000' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='STEP_DIRECTION' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='9' setinit='9' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ButtonTextVertical' type='s16' description='text vertical postition' isconst='1' isHidden='0' isinit='1' usrinit='376' setinit='376' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='STEP3_ENABLE' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='11' setinit='11' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='GraphHorizontalWidth' type='s16' description='Graph horizontal width in pixels' isconst='1' isHidden='0' isinit='1' usrinit='720' setinit='720' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='TestNvsData' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='&quot; 0 &quot;' setinit='{0}' >
						<array size='8' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ServoDriveResponse' type='T8' description='Reply message received from Servo Drive' isconst='0' isHidden='0' isinit='1' usrinit='&quot;&quot;' setinit='&apos;0&apos;' >
						<array size='100' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='AirOnDelay' type='u16' description='Delay between Air On and motor forwards, in mS, max 65535' isconst='0' isHidden='0' isinit='1' usrinit='100' setinit='100' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ServoCwEndPosition' type='u32' description='Servo Home Position in steps from CCW Limit' isconst='0' isHidden='0' isinit='1' usrinit='60000' setinit='60000' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SW8_IN' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='37' setinit='37' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FLUOROLED_ENABLE' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='46' setinit='46' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTC_DAY_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='4' setinit='0x04' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTC_WDT_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='9' setinit='0x09' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Status' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='BUTTON_NONE' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='TxMsgByteCount' type='u8' description='Count of bytes in Tx message' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MessageHorizontalOrigin' type='u16' description='' isconst='1' isHidden='0' isinit='1' usrinit='60' setinit='60' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ServoLimitRangeMax' type='s32' description='Maximum value for CW to CCW travel in motor counts' isconst='1' isHidden='0' isinit='1' usrinit='99999999' setinit='99999999' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MidString' type='T8' description='String manipulation variable' isconst='0' isHidden='0' isinit='1' usrinit='&quot;&quot;' setinit='&quot;&quot;' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='TemporarySpeed' type='u16' description='UInt variable to use as needed' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='STEP8_ENABLE' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='3' setinit='3' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTC_MINS_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='2' setinit='0x02' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='false' type='b1' description='' isconst='1' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Icon1_Colour' type='u8' description='Colour of Icon by resistor colour code' isconst='0' isHidden='0' isinit='1' usrinit='8' setinit='8' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ButtonUpdate' type='b1' description='True to cause button redraw with new texts' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='false' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='AirOffDelay' type='u16' description='Delay between AIr Off and motor return in mS, max 65535' isconst='0' isHidden='0' isinit='1' usrinit='100' setinit='100' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='STEP7_ENABLE' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='4' setinit='4' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SW3_IN' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='42' setinit='42' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='OPTO3_CH' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='2' setinit='2' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MessageTextHorPos' type='u16' description='' isconst='1' isHidden='0' isinit='1' usrinit='20' setinit='20' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Arial_14_Bold' type='u8' description='Set  Font as Arial 14 Bold, defined in screen properties' isconst='1' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTC_HRS_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='3' setinit='0x03' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTC_DATE_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='5' setinit='0x05' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP_P1_IN_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='1' setinit='0x01' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='STEP2_ENABLE' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='12' setinit='12' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='OPTO3_ENABLE' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='34' setinit='34' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ServoStatus' type='u8' description='Returned servo status, 0 is OK' isconst='0' isHidden='0' isinit='1' usrinit='255' setinit='255' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SW6_IN' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='39' setinit='39' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DAYLIGHT_CH' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='5' setinit='5' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXPA1_CH' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ButtonPressed' type='u8' description='Key Pressed' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Icon2_Text' type='T8' description='Air icon text' isconst='0' isHidden='0' isinit='1' usrinit='&quot;AIR&quot;' setinit='&quot;AIR&quot;' >
						<array size='10' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='IconHorizontalSize' type='u16' description='' isconst='1' isHidden='0' isinit='1' usrinit='189' setinit='189' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RightString' type='T8' description='String manipulation variable' isconst='0' isHidden='0' isinit='1' usrinit='&quot;&quot;' setinit='&quot;&quot;' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP_P1_OUT_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='3' setinit='0x03' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MessageTopTextVertPos' type='u16' description='' isconst='1' isHidden='0' isinit='1' usrinit='20' setinit='20' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MessageLine1Vertical' type='u16' description='' isconst='1' isHidden='0' isinit='1' usrinit='74' setinit='74' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ButtonJumpCount' type='u16' description='Counter to say when to change ButtonJump' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTC_AL_MINS_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='13' setinit='0x0D' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LeftString' type='T8' description='String manipulation store' isconst='0' isHidden='0' isinit='1' usrinit='&quot;&quot;' setinit='&quot;&quot;' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='STEP6_ENABLE' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='5' setinit='5' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP_D11' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='15' setinit='15' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP_P1_POL_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='5' setinit='0x05' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP_D10' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='14' setinit='14' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SW1_IN' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='44' setinit='44' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='OPTO1_CH' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='4' setinit='4' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ButtonHorizontalSize' type='u16' description='' isconst='1' isHidden='0' isinit='1' usrinit='128' setinit='128' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTC_YEAR_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='7' setinit='0x07' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Button3_Text' type='T8' description='' isconst='0' isHidden='0' isinit='1' usrinit='&quot;&quot;' setinit='&quot;&quot;' >
						<array size='8' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP3_I2C_ADDR' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='118' setinit='0x76' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='OPTO2_ENABLE' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='35' setinit='35' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='CAMLED_ENABLE' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='45' setinit='45' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='FLUOROx1_CH' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='6' setinit='6' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='IconVerticalOrigin' type='u16' description='' isconst='1' isHidden='0' isinit='1' usrinit='218' setinit='218' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Message_Line1Text' type='T8' description='' isconst='0' isHidden='0' isinit='1' usrinit='&quot;Line 1&quot;' setinit='&quot;Line 1&quot;' >
						<array size='40' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ButtonDelay' type='u16' description='Button repeat delay mS' isconst='0' isHidden='0' isinit='1' usrinit='500' setinit='500' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ButtonHorizontalOrigins' type='u16' description='' isconst='1' isHidden='0' isinit='1' usrinit='0' setinit='{0,60,244,428,612}' >
						<array size='5' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='TouchPosY' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ExpOutputData' type='u8' description='Saved Exp output data (0 = E1P0...5 = E3P1)' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='6' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='CYCLONE_FAN' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='30' setinit='30' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='TouchPosX' type='u16' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTC_MNTH_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='6' setinit='0x06' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Button1_Text' type='T8' description='' isconst='0' isHidden='0' isinit='1' usrinit='&quot;&quot;' setinit='&quot;&quot;' >
						<array size='8' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RxMsgByteCount' type='u8' description='Number of bytes received from Servo Drive' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SW4_IN' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='41' setinit='41' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='HEATERTEMP_CH' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTC_AL_HRS_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='12' setinit='0x0C' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Icon3_Colour' type='u8' description='Resistor colour code' isconst='0' isHidden='0' isinit='1' usrinit='8' setinit='8' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='AnyString' type='T8' description='String to use for any purpose' isconst='0' isHidden='0' isinit='1' usrinit='&quot;&quot;' setinit='&quot;&quot;' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ButtonJump' type='u16' description='Decides how much variable changes on Plus or Minus button change' isconst='0' isHidden='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='STEPB_RESET' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='7' setinit='7' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP_P0_CONFIG_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='6' setinit='0x6' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP_P0_OUT_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='2' setinit='0x02' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP_P0_IN_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='0' setinit='0x00' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='GetTouchCoordinates' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='255' setinit='255' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTC_AL_MNTH_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='10' setinit='0x0A' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTC_AL_DATE_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='11' setinit='0x0B' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='BUTTON_4' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='4' setinit='4' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Message_Line2Text' type='T8' description='' isconst='0' isHidden='0' isinit='1' usrinit='&quot;Version not set&quot;' setinit='&quot;Version not set&quot;' >
						<array size='40' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='I2Cdata' type='u8' description='Store I2C data Write or Read' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='STEP1_ENABLE' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='13' setinit='13' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ButtonVerticalSize' type='u16' description='' isconst='1' isHidden='0' isinit='1' usrinit='84' setinit='84' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTC_FLAGS_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='15' setinit='0x0F' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='BUTTON_3' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='3' setinit='3' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SOLENOID6' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='33' setinit='33' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTC_IRQ_IN' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='28' setinit='28' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTC_SECS_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='1' setinit='0x01' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='BUTTON_2' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='2' setinit='2' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MessageBoxVerticalSize' type='u32' description='' isconst='1' isHidden='0' isinit='1' usrinit='126' setinit='126' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ServoCcwSpeed' type='u16' description='CCW speed in Revs/Sec x 100, max 10000 (100.00 RPS) min 1 (0.01RPS)' isconst='0' isHidden='0' isinit='1' usrinit='2700' setinit='2700' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP_P0_POL_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='4' setinit='0x04' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP1_I2C_ADDR' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='116' setinit='0x74' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SOLENOID5' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='32' setinit='32' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='BUTTON_1' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ServoDriveCommand' type='T8' description='Array for build of Tx command message to servo drive' isconst='0' isHidden='0' isinit='1' usrinit='&quot;123&quot;' setinit='&apos;\r&apos;' >
						<array size='100' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='STEPA_RESET' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='8' setinit='8' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SOLENOID4' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='27' setinit='27' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='HEATER_ON' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='31' setinit='31' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SW7_IN' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='38' setinit='38' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='UNILUX_PWR' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='47' setinit='47' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MessageBoxVerticalOrigin' type='u32' description='' isconst='1' isHidden='0' isinit='1' usrinit='46' setinit='46' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP_D9' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SOLENOID3' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='26' setinit='26' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='STEP5_ENABLE' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='6' setinit='6' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP_D8' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SOLENOID2' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='25' setinit='25' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MessageBoxHorizontalSize' type='u16' description='' isconst='1' isHidden='0' isinit='1' usrinit='680' setinit='680' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='MessageLine2Vertical' type='u16' description='' isconst='1' isHidden='0' isinit='1' usrinit='120' setinit='120' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP_D7' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='22' setinit='22' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SOLENOID1' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='24' setinit='24' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='AxisY' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='GraphVerticalOrigin' type='u16' description='Graph vertical origin in pixels' isconst='1' isHidden='0' isinit='1' usrinit='262' setinit='262' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTC_mSEC_REG' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='0' setinit='0x00' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Icon3_Text' type='T8' description='Movement icon text' isconst='0' isHidden='0' isinit='1' usrinit='&quot;MOTOR&quot;' setinit='&quot;MOTOR&quot;' >
						<array size='10' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Icon2_Colour' type='u8' description='Colour by resistor colour code' isconst='0' isHidden='0' isinit='1' usrinit='8' setinit='8' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ATOD_I2C_ADDR' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='40' setinit='0x28' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP_D6' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='21' setinit='21' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SW2_IN' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='43' setinit='43' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='OPTO2_CH' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='3' setinit='3' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ButtonVerticalOrigin' type='u16' description='' isconst='1' isHidden='0' isinit='1' usrinit='348' setinit='348' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RTC_I2C_ADDR' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='104' setinit='0x68' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='AxisX' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='IconVerticalSize' type='u16' description='' isconst='1' isHidden='0' isinit='1' usrinit='84' setinit='84' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP_D5' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='20' setinit='20' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='OPTO1_ENABLE' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='36' setinit='36' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='IconHorizontalOrigins' type='u16' description='Horizontal origins of icons in pixels' isconst='1' isHidden='0' isinit='1' usrinit='0' setinit='{0,60,305,551}' >
						<array size='4' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isHidden='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='EXP_D4' type='u8' description='' isconst='1' isHidden='0' isinit='1' usrinit='19' setinit='19' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='GraphHorizontalOrigin' type='u16' description='Graph vertical rigin in pixels' isconst='1' isHidden='0' isinit='1' usrinit='60' setinit='60' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='GraphVerticalHeight' type='s16' description='Graph vertical height in pixels' isconst='1' isHidden='0' isinit='1' usrinit='256' setinit='256' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Icon1_Text' type='T8' description='Speed icon text' isconst='0' isHidden='0' isinit='1' usrinit='&quot;SPEED&quot;' setinit='&quot;SPEED&quot;' >
						<array size='10' />
					</def>
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='NVS_Write' description='Write non-volatile settings to NvsSettings.dat file' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='Status' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='FileSize' type='u32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='SettingsFileIsValid' type='b1' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='NvsSettings' type='u8' description='NVS settings copied from file' isconst='0' isHidden='0' isinit='1' usrinit='&quot; 0 &quot;' setinit='{0}' >
							<array size='1024' />
						</local>
						<local name='ValidFile' type='u8' description='Valid File values' isconst='1' isHidden='0' isinit='1' usrinit='&quot; 0b00001111, 0b00110101 &quot;' setinit='{0b00001111, 0b00110101}' >
							<array size='2' />
						</local>
						<local name='Count' type='u16' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='calculation' title='Move variables to NVS settings' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='// Add all default values here' />
							<exp exp='.NvsSettings[0] = .ValidFile[0] // Valid File number' />
							<exp exp='.NvsSettings[1] = .ValidFile[1] // Valid File number' />
							<exp exp='' />
							<exp exp='.NvsSettings[2] = TestNvsData[0] // Variable Name' />
							<exp exp='.NvsSettings[3] = TestNvsData[1] // Variable Name' />
							<exp exp='.NvsSettings[4] = TestNvsData[2] // Variable Name' />
							<exp exp='.NvsSettings[5] = TestNvsData[3] // Variable Name' />
							<exp exp='.NvsSettings[6] = TestNvsData[4] // Variable Name' />
							<exp exp='.NvsSettings[7] = TestNvsData[5] // Variable Name' />
							<exp exp='.NvsSettings[8] = TestNvsData[6] // Variable Name' />
							<exp exp='.NvsSettings[9] = TestNvsData[7] // Variable Name' />
						</command>
						<command class_type='call' title='Delete the existing file' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='File_RPI1' macro='DeleteFile' >
							<argument exp='&quot;NvsSettings.dat&quot;' />
						</command>
						<command class_type='call' title='Open new NvsSettings.dat' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='File_RPI1' macro='OpenFile' >
							<return exp='Status' />
							<argument exp='&quot;NvsSettings.dat&quot;' />
						</command>
						<command class_type='calculation' title='Initialise file pointer' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='.Count = 0' />
						</command>
						<command class_type='loop' title='Write 1024 bytes' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='2' exp='1024' >
							<flowline >
								<command class_type='call' title='Append byte to file' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='File_RPI1' macro='AppendByteToFile' >
									<argument exp='.NvsSettings[.Count]' />
								</command>
								<command class_type='calculation' title='Adjust file pointer' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='.Count = .Count + 1' />
								</command>
							</flowline>
						</command>
						<command class_type='call' title='Close NvsSettings.bin' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='File_RPI1' macro='CloseFile' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Send_Servo_Msg' description='Send a message to servo drive
TxMsgByteCount is size of data
ServoDriveCommand is array of data' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='TxEnableTime' type='s16' description='TxEnable active time in mS' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='delay' title='Delay' cmdcolor='14697803' cmdcolor_sec='16755119' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='1' type='1' />
						<command class_type='calculation' title='Add addr, &lt;CR&gt; and calc send time' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='ServoDriveCommand[0] = &apos;@&apos; //Address' />
							<exp exp='ServoDriveCommand[TxMsgByteCount + 1] = 13 //Add &lt;CR&gt;' />
							<exp exp='ServoDriveCommand[TxMsgByteCount + 2] = 0 //Add Null Character' />
							<exp exp='.TxEnableTime = TxMsgByteCount + 3' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='UART1' macro='SendString' >
							<argument exp='ServoDriveCommand' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ULong_To_ServoMsg' description='Convert Unsigned Long target servo position to ASCII characters in ServoDriveCommand buffer.
For use with DI command prior to FP command' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='ServoPosition' type='u32' description='Target servo Set Position in ASCII is loaded to buffer' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Count' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='IsNegative' type='b1' description='Sign of SP' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='false' />
						<local name='Divisor' type='s32' description='Divisor for converting Long to ASCII digits' isconst='0' isHidden='0' isinit='1' usrinit='1000000000' setinit='1000000000' />
						<local name='IsLeadingZero' type='b1' description='True indicates no non-zero digit has been written yet' isconst='0' isHidden='0' isinit='1' usrinit='1' setinit='true' />
						<command class_type='calculation' title='Set Index and sign' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='.Count = 3' />
							<exp exp='.IsNegative = false' />
							<exp exp='.IsLeadingZero = true' />
						</command>
						<command class_type='loop' title='Loop adding digits to message' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='1' exp='.Divisor == 0' start='0' >
							<flowline >
								<command class_type='calculation' title='Calculate next digit' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='ServoDriveCommand[.Count] = (.ServoPosition / .Divisor) + 0x30' />
									<exp exp='' />
								</command>
								<command class_type='decision' title='Check if leading zero' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='(.IsLeadingZero == true) &amp;&amp; (ServoDriveCommand[.Count] == 0x30)' swap='0' >
									<flowline />
									<flowline >
										<command class_type='calculation' title='Keep digit' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='.IsLeadingZero = false //Show not leading zero' />
											<exp exp='.ServoPosition = .ServoPosition - ((ServoDriveCommand[.Count] - 0x30) * .Divisor) //Adjust Servo Position' />
											<exp exp='.Count = .Count + 1 //Adjust to next digit' />
											<exp exp='' />
										</command>
									</flowline>
								</command>
								<command class_type='calculation' title='Adjust Divisor' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='.Divisor = .Divisor / 10' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Set message size for &apos;Send_Servo_Msg&apos;' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='TxMsgByteCount = (.Count - 1)' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Icons_Create' description='Draws Message and Status icons outlines with labels
' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='IconCount' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Foreground black' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='SetTrueForegroundColour' >
							<argument exp='0' />
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Background light grey' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='SetTrueBackgroundColour' >
							<argument exp='225' />
							<argument exp='225' />
							<argument exp='225' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='SetFontScaler' >
							<argument exp='2' />
							<argument exp='2' />
						</command>
						<command class_type='comment' title='' comment='Create Message Box' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
						<command class_type='call' title='Draw Msg Box Shadow' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='DrawRectangle' >
							<argument exp='MessageHorizontalOrigin - 3' />
							<argument exp='MessageBoxVerticalOrigin - 3' />
							<argument exp='MessageHorizontalOrigin + MessageBoxHorizontalSize + 3' />
							<argument exp='MessageBoxVerticalOrigin + MessageBoxVerticalSize + 3' />
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Draw Msg Box' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='DrawRectangle' >
							<argument exp='MessageHorizontalOrigin + 1' />
							<argument exp='MessageBoxVerticalOrigin + 1' />
							<argument exp='MessageHorizontalOrigin + MessageBoxHorizontalSize - 1' />
							<argument exp='MessageBoxVerticalOrigin + MessageBoxVerticalSize - 1' />
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Message Line 1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='Print' >
							<argument exp='Message_Line1Text' />
							<argument exp='MessageLinesHorizontal' />
							<argument exp='MessageLine1Vertical' />
							<argument exp='Arial_14_Bold' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Message Line 2' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='Print' >
							<argument exp='Message_Line2Text' />
							<argument exp='MessageLinesHorizontal' />
							<argument exp='MessageLine2Vertical' />
							<argument exp='Arial_14_Bold' />
							<argument exp='1' />
						</command>
						<command class_type='calculation' title='Initialise icon count' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='.IconCount = 1' />
						</command>
						<command class_type='loop' title='Loop' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='1' exp='.IconCount = 4' start='0' >
							<flowline >
								<command class_type='call' title='Draw Icon Shadow' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='DrawRectangle' >
									<argument exp='IconHorizontalOrigins[.IconCount] - 3' />
									<argument exp='IconVerticalOrigin - 3' />
									<argument exp='IconHorizontalOrigins[.IconCount] + IconHorizontalSize + 3' />
									<argument exp='IconVerticalOrigin + IconVerticalSize + 3' />
									<argument exp='0' />
									<argument exp='0' />
								</command>
								<command class_type='call' title='Draw Icon Box' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='DrawRectangle' >
									<argument exp='IconHorizontalOrigins[.IconCount] + 1' />
									<argument exp='IconVerticalOrigin + 1' />
									<argument exp='IconHorizontalOrigins[.IconCount] + IconHorizontalSize - 1' />
									<argument exp='IconVerticalOrigin + IconVerticalSize - 1' />
									<argument exp='0' />
									<argument exp='0' />
								</command>
								<command class_type='switch' title='which icon text ' textarea='36,25,36,25' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='.IconCount' >
									<case >
										<flowline />
									</case>
									<case exp='1' >
										<flowline >
											<command class_type='call' title='Label Icon 1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='Print' >
												<argument exp='Icon1_Text' />
												<argument exp='IconHorizontalOrigins[.IconCount] + 10' />
												<argument exp='IconTextVertical' />
												<argument exp='Arial_14_Bold' />
												<argument exp='1' />
											</command>
										</flowline>
									</case>
									<case exp='2' >
										<flowline >
											<command class_type='call' title='Label Icon 2' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='Print' >
												<argument exp='Icon2_Text' />
												<argument exp='IconHorizontalOrigins[.IconCount] + 10' />
												<argument exp='IconTextVertical' />
												<argument exp='Arial_14_Bold' />
												<argument exp='false' />
											</command>
										</flowline>
									</case>
									<case exp='3' >
										<flowline >
											<command class_type='call' title='Label Icon 3' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='Print' >
												<argument exp='Icon3_Text' />
												<argument exp='IconHorizontalOrigins[.IconCount] + 10' />
												<argument exp='IconTextVertical' />
												<argument exp='Arial_14_Bold' />
												<argument exp='false' />
											</command>
										</flowline>
									</case>
								</command>
								<command class_type='calculation' title='adjust button count' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='.IconCount = .IconCount + 1' />
								</command>
							</flowline>
						</command>
						<command class_type='call' title='Background light cyan' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='SetTrueBackgroundColour' >
							<argument exp='233' />
							<argument exp='255' />
							<argument exp='255' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='SP_To_ULong' description='Convert SP (Set Position) in ServoDriveResponse buffer to Unsigned Long
SP is in ASCII, most significant first' statediag='0' >
						<return name='Return' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Count' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='calculation' title='Set Index and sign' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='.Count = 4' />
							<exp exp='.Return = 0' />
						</command>
						<command class_type='loop' title='Loop adding digits from message' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='1' exp='ServoDriveResponse[.Count] = 0x0D' start='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='.Return = .Return * 10 //Adjust for next digit' />
									<exp exp='.Return = .Return + (ServoDriveResponse[.Count] - 0x30) //Add next digit' />
									<exp exp='.Count = .Count + 1 //Adjust to next digit' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Button_Scan' description='Returns with button in &apos;ButtonPressed&apos; variable.
BUTTON_NONE, BUTTON_1, BUTTON_2, BUTTON_3, BUTTON_4

' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Fetch GetTouchCoordinates' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='GetTouchCoordinates' >
							<return exp='GetTouchCoordinates' />
						</command>
						<command class_type='decision' title='Has touch changed' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='GetTouchCoordinates != 0' swap='0' >
							<flowline >
								<command class_type='decision' title='Check if touch start/change' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='GetTouchCoordinates &gt; 8' swap='0' >
									<flowline >
										<command class_type='call' title='Read Touch Pos X' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='ReadTouchCoordinates' >
											<return exp='TouchPosX' />
											<argument exp='AxisX' />
										</command>
										<command class_type='call' title='Read Touch Pos Y' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='ReadTouchCoordinates' >
											<return exp='TouchPosY' />
											<argument exp='AxisY' />
										</command>
										<command class_type='calculation' title='Offset Touch Positions so always +ve' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='TouchPosX = TouchPosX + 100' />
										</command>
										<command class_type='calculation' title='Assume No button press' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='ButtonPressed = BUTTON_NONE' />
										</command>
										<command class_type='decision' title='Check Y Touch Pos valid' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='TouchPosY &gt; 430 &amp;&amp; TouchPosY &lt; 550' swap='0' >
											<flowline >
												<command class_type='decision' title='Check X Touch Pos is Button 1' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='TouchPosX &gt; 93 &amp;&amp; TouchPosX &lt; 234' swap='0' >
													<flowline >
														<command class_type='calculation' title='show Button 1' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
															<exp exp='ButtonPressed = BUTTON_1' />
														</command>
													</flowline>
													<flowline />
												</command>
												<command class_type='decision' title='Check X Touch Pos is Button 2' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='TouchPosX &gt; 322 &amp;&amp; TouchPosX &lt; 467' swap='0' >
													<flowline >
														<command class_type='calculation' title='show Button 2  pressed' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
															<exp exp='ButtonPressed = BUTTON_2' />
														</command>
													</flowline>
													<flowline />
												</command>
												<command class_type='decision' title='Check X Touch Pos is Button 3' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='TouchPosX &gt; 551 &amp;&amp; TouchPosX &lt; 698' swap='0' >
													<flowline >
														<command class_type='calculation' title='show Button 3 pressed' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
															<exp exp='ButtonPressed = BUTTON_3' />
														</command>
													</flowline>
													<flowline />
												</command>
												<command class_type='decision' title='Check X Touch Pos is Button 4' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='TouchPosX &gt; 780 &amp;&amp; TouchPosX &lt; 933' swap='0' >
													<flowline >
														<command class_type='calculation' title='show Button 4 pressed' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
															<exp exp='ButtonPressed = BUTTON_4' />
														</command>
													</flowline>
													<flowline />
												</command>
											</flowline>
											<flowline />
										</command>
									</flowline>
									<flowline >
										<command class_type='comment' title='' comment='Touch Stop' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
										<command class_type='calculation' title='No button press' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='ButtonPressed = BUTTON_NONE' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='comment' title='' comment='Either no touch
Or constant touch' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='SetTrueBackgroundColour' description='Specifies the colour of the background by creating a mixture of red, green and blue.
' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Red' type='u8' description='0 - 255 where 0 = no red and 255 = maximum red' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Green' type='u8' description='0 - 255 where 0 = no green and 255 = maximum green' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Blue' type='u8' description='0 - 255 where 0 = no blue and 255 = maximum blue' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='SetTrueBackgroundColour' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='.Red = .Red &gt;&gt; (8 - 5)' />
							<exp exp='.Green = .Green &gt;&gt; (8 - 6)' />
							<exp exp='.Blue = .Blue &gt;&gt; (8 - 5)' />
							<exp exp='GLCD_RPI1::SetBackgroundColour(.Red,.Green,.Blue)' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='NVS_Read' description='Read non-volatile settings from NvsSettings.dat file
If file is missing or bad then default settings are initialised.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='Status' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='FileSize' type='u32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='SettingsFileIsValid' type='b1' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='NvsSettings' type='u8' description='NVS settings copied from file' isconst='0' isHidden='0' isinit='1' usrinit='&quot; 0 &quot;' setinit='{0}' >
							<array size='1024' />
						</local>
						<local name='ValidFile' type='u8' description='Valid File values' isconst='1' isHidden='0' isinit='1' usrinit='&quot; 0b00001111, 0b00110101 &quot;' setinit='{0b00001111, 0b00110101}' >
							<array size='2' />
						</local>
						<local name='Count' type='u16' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='call' title='Open NvsSettings.dat' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='File_RPI1' macro='OpenFile' >
							<return exp='Status' />
							<argument exp='&quot;NvsSettings.dat&quot;' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='File_RPI1' macro='ReadFileSize' >
							<return exp='.FileSize' />
						</command>
						<command class_type='decision' title='Is file size valid' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='.FileSize = 1024' swap='0' >
							<flowline >
								<command class_type='calculation' title='Initialise file pointer' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='.Count = 0' />
								</command>
								<command class_type='loop' title='Read bytes from file' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='2' exp='1024' >
									<flowline >
										<command class_type='call' title='Read byte from file to NVS variable' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='File_RPI1' macro='ReadByteFromFile' >
											<return exp='.NvsSettings[.Count]' />
										</command>
										<command class_type='calculation' title='Adjust file pointer' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='.Count = .Count + 1' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Show file is bad' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='.NvsSettings[0] = 0' />
									<exp exp='.NvsSettings[1] = 0' />
								</command>
							</flowline>
						</command>
						<command class_type='decision' title='Is file data valid' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='.NvsSettings[0] = .ValidFile[0] AND .NvsSettings[1] = .ValidFile[1]' swap='0' >
							<flowline />
							<flowline >
								<command class_type='call' title='Close NvsSettings.dat' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='File_RPI1' macro='CloseFile' />
								<command class_type='call' title='Delete the bad file' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='File_RPI1' macro='DeleteFile' >
									<argument exp='&quot;NvsSettings.dat&quot;' />
								</command>
								<command class_type='call' title='Open new NvsSettings.dat' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='File_RPI1' macro='OpenFile' >
									<return exp='Status' />
									<argument exp='&quot;NvsSettings.dat&quot;' />
								</command>
								<command class_type='calculation' title='Initialise NVS settings' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='// Add all default values here' />
									<exp exp='.NvsSettings[0] = .ValidFile[0] // Valid File number' />
									<exp exp='.NvsSettings[1] = .ValidFile[1] // Valid File number' />
									<exp exp='' />
									<exp exp='.NvsSettings[2] = 10 // Variable Name' />
									<exp exp='.NvsSettings[3] = 20 // Variable Name' />
									<exp exp='.NvsSettings[4] = 30 // Variable Name' />
									<exp exp='.NvsSettings[5] = 40 // Variable Name' />
									<exp exp='.NvsSettings[6] = 50 // Variable Name' />
									<exp exp='.NvsSettings[7] = 60 // Variable Name' />
									<exp exp='.NvsSettings[8] = 70 // Variable Name' />
									<exp exp='.NvsSettings[9] = 80 // Variable Name' />
									<exp exp='' />
									<exp exp='.NvsSettings[10] = 0 // Variable Name' />
									<exp exp='.NvsSettings[11] = 0 // Variable Name' />
									<exp exp='.NvsSettings[12] = 0 // Variable Name' />
									<exp exp='.NvsSettings[13] = 0 // Variable Name' />
									<exp exp='.NvsSettings[14] = 0 // Variable Name' />
									<exp exp='.NvsSettings[15] = 0 // Variable Name' />
									<exp exp='.NvsSettings[16] = 0 // Variable Name' />
									<exp exp='.NvsSettings[17] = 0 // Variable Name' />
									<exp exp='.NvsSettings[18] = 0 // Variable Name' />
									<exp exp='.NvsSettings[19] = 0 // Variable Name' />
									<exp exp='.NvsSettings[20] = 0 // Variable Name' />
									<exp exp='.NvsSettings[21] = 0 // Variable Name' />
									<exp exp='.NvsSettings[22] = 0 // Variable Name' />
									<exp exp='.NvsSettings[23] = 0 // Variable Name' />
									<exp exp='.NvsSettings[24] = 0 // Variable Name' />
									<exp exp='.NvsSettings[25] = 0 // Variable Name' />
									<exp exp='.NvsSettings[26] = 0 // Variable Name' />
									<exp exp='.NvsSettings[27] = 0 // Variable Name' />
									<exp exp='.NvsSettings[28] = 0 // Variable Name' />
									<exp exp='.NvsSettings[29] = 0 // Variable Name' />
									<exp exp='.NvsSettings[30] = 0 // Variable Name' />
									<exp exp='.NvsSettings[31] = 0 // Variable Name' />
									<exp exp='.NvsSettings[32] = 0 // Variable Name' />
									<exp exp='.NvsSettings[33] = 0 // Variable Name' />
									<exp exp='.NvsSettings[34] = 0 // Variable Name' />
									<exp exp='.NvsSettings[35] = 0 // Variable Name' />
									<exp exp='.NvsSettings[36] = 0 // Variable Name' />
									<exp exp='.NvsSettings[37] = 0 // Variable Name' />
									<exp exp='.NvsSettings[38] = 0 // Variable Name' />
									<exp exp='.NvsSettings[39] = 0 // Variable Name' />
									<exp exp='.NvsSettings[40] = 0 // Variable Name' />
									<exp exp='.NvsSettings[41] = 0 // Variable Name' />
									<exp exp='.NvsSettings[42] = 0 // Variable Name' />
									<exp exp='.NvsSettings[43] = 0 // Variable Name' />
									<exp exp='.NvsSettings[44] = 0 // Variable Name' />
									<exp exp='.NvsSettings[45] = 0 // Variable Name' />
									<exp exp='.NvsSettings[46] = 0 // Variable Name' />
									<exp exp='.NvsSettings[47] = 0 // Variable Name' />
									<exp exp='.NvsSettings[48] = 0 // Variable Name' />
									<exp exp='.NvsSettings[49] = 0 // Variable Name' />
									<exp exp='.NvsSettings[50] = 0 // Variable Name' />
									<exp exp='.NvsSettings[51] = 0 // Variable Name' />
									<exp exp='.NvsSettings[52] = 0 // Variable Name' />
									<exp exp='.NvsSettings[53] = 0 // Variable Name' />
									<exp exp='.NvsSettings[54] = 0 // Variable Name' />
									<exp exp='.NvsSettings[55] = 0 // Variable Name' />
									<exp exp='.NvsSettings[56] = 0 // Variable Name' />
									<exp exp='.NvsSettings[57] = 0 // Variable Name' />
									<exp exp='.NvsSettings[58] = 0 // Variable Name' />
									<exp exp='.NvsSettings[59] = 0 // Variable Name' />
									<exp exp='.NvsSettings[60] = 0 // Variable Name' />
									<exp exp='.NvsSettings[61] = 0 // Variable Name' />
									<exp exp='.NvsSettings[62] = 0 // Variable Name' />
									<exp exp='.NvsSettings[63] = 0 // Variable Name' />
									<exp exp='.NvsSettings[64] = 0 // Variable Name' />
									<exp exp='.NvsSettings[65] = 0 // Variable Name' />
									<exp exp='.NvsSettings[66] = 0 // Variable Name' />
									<exp exp='.NvsSettings[67] = 0 // Variable Name' />
									<exp exp='.NvsSettings[68] = 0 // Variable Name' />
									<exp exp='.NvsSettings[69] = 0 // Variable Name' />
									<exp exp='.NvsSettings[70] = 0 // Variable Name' />
									<exp exp='.NvsSettings[71] = 0 // Variable Name' />
									<exp exp='.NvsSettings[72] = 0 // Variable Name' />
									<exp exp='.NvsSettings[73] = 0 // Variable Name' />
									<exp exp='.NvsSettings[74] = 0 // Variable Name' />
									<exp exp='.NvsSettings[75] = 0 // Variable Name' />
									<exp exp='.NvsSettings[76] = 0 // Variable Name' />
									<exp exp='.NvsSettings[77] = 0 // Variable Name' />
									<exp exp='.NvsSettings[78] = 0 // Variable Name' />
									<exp exp='.NvsSettings[79] = 0 // Variable Name' />
									<exp exp='.NvsSettings[80] = 0 // Variable Name' />
									<exp exp='.NvsSettings[81] = 0 // Variable Name' />
									<exp exp='.NvsSettings[82] = 0 // Variable Name' />
									<exp exp='.NvsSettings[83] = 0 // Variable Name' />
									<exp exp='.NvsSettings[84] = 0 // Variable Name' />
									<exp exp='.NvsSettings[85] = 0 // Variable Name' />
									<exp exp='.NvsSettings[86] = 0 // Variable Name' />
									<exp exp='.NvsSettings[87] = 0 // Variable Name' />
									<exp exp='.NvsSettings[88] = 0 // Variable Name' />
									<exp exp='.NvsSettings[89] = 0 // Variable Name' />
									<exp exp='.NvsSettings[90] = 0 // Variable Name' />
									<exp exp='.NvsSettings[91] = 0 // Variable Name' />
									<exp exp='.NvsSettings[92] = 0 // Variable Name' />
									<exp exp='.NvsSettings[93] = 0 // Variable Name' />
									<exp exp='.NvsSettings[94] = 0 // Variable Name' />
									<exp exp='.NvsSettings[95] = 0 // Variable Name' />
									<exp exp='.NvsSettings[96] = 0 // Variable Name' />
									<exp exp='.NvsSettings[97] = 0 // Variable Name' />
									<exp exp='.NvsSettings[98] = 0 // Variable Name' />
									<exp exp='.NvsSettings[99] = 0 // Variable Name' />
								</command>
								<command class_type='calculation' title='Initialise file pointer' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='.Count = 0' />
								</command>
								<command class_type='loop' title='Inititialise 1024 bytes' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='2' exp='1024' >
									<flowline >
										<command class_type='call' title='Append byte to file' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='File_RPI1' macro='AppendByteToFile' >
											<argument exp='.NvsSettings[.Count]' />
										</command>
										<command class_type='calculation' title='Adjust file pointer' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='.Count = .Count + 1' />
										</command>
									</flowline>
								</command>
							</flowline>
						</command>
						<command class_type='call' title='Close NvsSettings.bin' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='File_RPI1' macro='CloseFile' />
						<command class_type='calculation' title='Move NVS stored settings to their variables' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='TestNvsData[0] = .NvsSettings[2] // Variable Name' />
							<exp exp='TestNvsData[1] = .NvsSettings[3] // Variable Name' />
							<exp exp='TestNvsData[2] = .NvsSettings[4] // Variable Name' />
							<exp exp='TestNvsData[3] = .NvsSettings[5] // Variable Name' />
							<exp exp='TestNvsData[4] = .NvsSettings[6] // Variable Name' />
							<exp exp='TestNvsData[5] = .NvsSettings[7] // Variable Name' />
							<exp exp='TestNvsData[6] = .NvsSettings[8] // Variable Name' />
							<exp exp='TestNvsData[7] = .NvsSettings[9] // Variable Name' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='SetTrueForegroundColour' description='Specifies the colour of the background by creating a mixture of red, green and blue.
' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Red' type='u8' description='0 - 255 where 0 = no red and 255 = maximum red' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Green' type='u8' description='0 - 255 where 0 = no green and 255 = maximum green' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Blue' type='u8' description='0 - 255 where 0 = no blue and 255 = maximum blue' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='SetTrueForegroundColour' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='.Red = .Red &gt;&gt; (8 - 5)' />
							<exp exp='.Green = .Green &gt;&gt; (8 - 6)' />
							<exp exp='.Blue = .Blue &gt;&gt; (8 - 5)' />
							<exp exp='GLCD_RPI1::SetForegroundColour(.Red,.Green,.Blue)' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Servo_Initialise' description='Check servo drive is communicating,
check servo limit stops and initialse position.
Return 0 is good, else error.' statediag='0' >
						<return name='Return' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='LimitSwitchActive' type='u8' description='&apos;2&apos; = CCW Limit, &apos;4&apos; = CW Limit' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='calculation' title='Initialise Return value' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='.Return = 255' />
						</command>
						<command class_type='comment' title='' comment='Reset the drive in case restart' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
						<command class_type='calculation' title='Servo Drive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='ServoDriveCommand[1] = &apos;R&apos;' />
							<exp exp='ServoDriveCommand[2] = &apos;E&apos;' />
							<exp exp='TxMsgByteCount = 2' />
						</command>
						<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
						<command class_type='delay' title='Delay to skip &lt;FF&gt;&lt;01&gt;&lt;B4&gt;' cmdcolor='14697803' cmdcolor_sec='16755119' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='2' type='2' />
						<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
						<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='Message_Line1Text = &quot;Initialising Servo Drive&quot;' />
							<exp exp='Message_Line2Text = &quot;Servo Drive Reset&quot;' />
						</command>
						<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Message_Box_Write' />
						<command class_type='delay' title='Delay' cmdcolor='14697803' cmdcolor_sec='16755119' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='1' type='2' />
						<command class_type='comment' title='' comment='Alarm Reset' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
						<command class_type='calculation' title='Alarm Reset Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='ServoDriveCommand[1] = &apos;A&apos;' />
							<exp exp='ServoDriveCommand[2] = &apos;R&apos;' />
							<exp exp='TxMsgByteCount = 2' />
						</command>
						<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
						<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
						<command class_type='comment' title='' comment='Check DL (define limits) before initialising' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
						<command class_type='calculation' title='Servo Drive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='ServoDriveCommand[1] = &apos;D&apos;' />
							<exp exp='ServoDriveCommand[2] = &apos;L&apos;' />
							<exp exp='TxMsgByteCount = 2' />
						</command>
						<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
						<command class_type='call' title='Check for response' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
						<command class_type='decision' title='Check for message' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='RxMsgByteCount != 0' swap='0' >
							<flowline >
								<command class_type='decision' title='Check message content' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ServoDriveResponse[0] == &apos;@&apos; &amp;&amp; ServoDriveResponse[1] == &apos;D&apos; &amp;&amp; ServoDriveResponse[2] == &apos;L&apos; &amp;&amp; ServoDriveResponse[4] == &apos;2&apos;' swap='0' >
									<flowline >
										<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='Message_Line2Text = &quot;Servo drive limit setup reply good&quot;' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='Message_Line2Text = &quot;Servo drive limit setup incorrect:&quot;' />
											<exp exp='.Return = 2 //Show bad limits' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='Message_Line2Text = &quot;Servo Drive check DL no reply&quot;' />
									<exp exp='.Return = 1 //Show No Reply' />
								</command>
							</flowline>
						</command>
						<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Message_Box_Write' />
						<command class_type='delay' title='Delay' cmdcolor='14697803' cmdcolor_sec='16755119' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='1' type='2' />
						<command class_type='decision' title='Check servo drive response Bad' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='.Return != 255' swap='0' >
							<flowline >
								<command class_type='goto' title='Goto Connection Point' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' labelid='0' labelname='' />
							</flowline>
							<flowline />
						</command>
						<command class_type='comment' title='' comment='Send AR (Alarm Reset) and check SC (status code) before initialising' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
						<command class_type='calculation' title='Alarm Reset Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='ServoDriveCommand[1] = &apos;A&apos;' />
							<exp exp='ServoDriveCommand[2] = &apos;R&apos;' />
							<exp exp='TxMsgByteCount = 2' />
						</command>
						<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
						<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
						<command class_type='delay' title='Delay' cmdcolor='14697803' cmdcolor_sec='16755119' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='50' type='1' />
						<command class_type='calculation' title='Servo Drive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='ServoDriveCommand[1] = &apos;S&apos;' />
							<exp exp='ServoDriveCommand[2] = &apos;C&apos;' />
							<exp exp='TxMsgByteCount = 2' />
						</command>
						<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
						<command class_type='call' title='Check for response' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
						<command class_type='decision' title='Check for message' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='RxMsgByteCount != 0' swap='0' >
							<flowline >
								<command class_type='decision' title='Check message content' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ServoDriveResponse[0] == &apos;@&apos; &amp;&amp; ServoDriveResponse[1] == &apos;S&apos; &amp;&amp; ServoDriveResponse[2] == &apos;C&apos; &amp;&amp; ServoDriveResponse[4] == &apos;8&apos; &amp;&amp; ServoDriveResponse[5] == &apos;0&apos; &amp;&amp; ServoDriveResponse[6] == &apos;0&apos; &amp;&amp; ServoDriveResponse[7] == &apos;0&apos;' swap='0' >
									<flowline >
										<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='Message_Line2Text = &quot;Servo Drive READY&quot;' />
										</command>
									</flowline>
									<flowline >
										<command class_type='decision' title='Check if Alarm 0x8200' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ServoDriveResponse[4] == &apos;8&apos; &amp;&amp; ServoDriveResponse[5] == &apos;2&apos; &amp;&amp; ServoDriveResponse[6] == &apos;0&apos; &amp;&amp; ServoDriveResponse[7] == &apos;0&apos;' swap='0' >
											<flowline >
												<command class_type='comment' title='' comment='Read Alarm Code and check if Limit input' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
												<command class_type='delay' title='Delay' cmdcolor='14697803' cmdcolor_sec='16755119' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='50' type='1' />
												<command class_type='calculation' title='Servo Drive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
													<exp exp='ServoDriveCommand[1] = &apos;A&apos;' />
													<exp exp='ServoDriveCommand[2] = &apos;L&apos;' />
													<exp exp='TxMsgByteCount = 2' />
												</command>
												<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
												<command class_type='call' title='Check for response' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
												<command class_type='decision' title='Check Message content' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ServoDriveResponse[0] == &apos;@&apos; &amp;&amp; ServoDriveResponse[1] == &apos;A&apos; &amp;&amp; ServoDriveResponse[2] == &apos;L&apos; &amp;&amp; ServoDriveResponse[4] == &apos;0&apos; &amp;&amp; ServoDriveResponse[5] == &apos;0&apos; &amp;&amp; ServoDriveResponse[6] == &apos;0&apos;' swap='0' >
													<flowline >
														<command class_type='switch' title='Test Limit Switch alarm' textarea='36,25,36,25' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ServoDriveResponse[7]' >
															<case >
																<flowline >
																	<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
																		<exp exp='Message_Line2Text = &quot;Alarm Code fault&quot;' />
																		<exp exp='//Message_Line2Text = ServoDriveResponse' />
																		<exp exp='.Return = 5 //Show bad Alarm Code' />
																	</command>
																</flowline>
															</case>
															<case exp='&apos;2&apos;' >
																<flowline >
																	<command class_type='comment' title='' comment='CCW Limit active' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
																	<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
																		<exp exp='Message_Line2Text = &quot;CCW Limit Switch active:&quot;' />
																		<exp exp='.LimitSwitchActive = &apos;2&apos; //Show CCW Limit active' />
																	</command>
																</flowline>
															</case>
															<case exp='&apos;4&apos;' >
																<flowline >
																	<command class_type='comment' title='' comment='CW Limit active' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
																	<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
																		<exp exp='Message_Line2Text = &quot;CW Limit Switch active:&quot;' />
																		<exp exp='.LimitSwitchActive = &apos;4&apos; //Show CW Limit active' />
																	</command>
																</flowline>
															</case>
														</command>
													</flowline>
													<flowline >
														<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
															<exp exp='Message_Line2Text = &quot;Alarm Code fault&quot;' />
															<exp exp='//Message_Line2Text = ServoDriveResponse' />
															<exp exp='.Return = 5 //Show bad Alarm Code' />
														</command>
													</flowline>
												</command>
											</flowline>
											<flowline >
												<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
													<exp exp='Message_Line2Text = &quot;Status Code incorrect&quot;' />
													<exp exp='//Message_Line2Text = ServoDriveResponse' />
													<exp exp='.Return = 4 //Show bad Status Code' />
												</command>
											</flowline>
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='Message_Line2Text = &quot;Servo Drive SC no reply&quot;' />
									<exp exp='.Return = 3 //Show No Reply' />
								</command>
							</flowline>
						</command>
						<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Message_Box_Write' />
						<command class_type='delay' title='Delay' cmdcolor='14697803' cmdcolor_sec='16755119' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='2' type='2' />
						<command class_type='decision' title='Check servo drive response Bad' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='.Return != 255' swap='0' >
							<flowline >
								<command class_type='goto' title='Goto Connection Point' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' labelid='0' labelname='' />
							</flowline>
							<flowline />
						</command>
						<command class_type='comment' title='' comment='Wait for user to Start initialisation' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
						<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='Message_Line1Text = &quot;OK to initialise servo hardware?&quot;' />
							<exp exp='Message_Line2Text = &quot;YES or NO&quot;' />
						</command>
						<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Message_Box_Write' />
						<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='Button1_Text = &quot; YES&quot;' />
							<exp exp='Button2_Text = &quot; NO&quot;' />
							<exp exp='ButtonUpdate = true' />
						</command>
						<command class_type='loop' title='Wait for Yes or No' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='1' exp='ButtonPressed == BUTTON_1 || ButtonPressed == BUTTON_2' start='0' >
							<flowline >
								<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Button_Scan' />
								<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Button_Redraw' />
							</flowline>
						</command>
						<command class_type='decision' title='Check Initialise Yes' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ButtonPressed == BUTTON_1' swap='0' >
							<flowline >
								<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='Message_Line1Text = &quot;Initialising servo hardware&quot;' />
									<exp exp='Message_Line2Text = &quot;&quot;' />
								</command>
								<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Message_Box_Write' />
								<command class_type='calculation' title='Icons' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='Icon1_Text = &quot;0.50 RPS&quot;' />
									<exp exp='Icon2_Text = &quot;AIR OFF&quot;' />
									<exp exp='Icon2_Colour = 2 //Red' />
									<exp exp='Icon3_Text = &quot;SEEK&quot;' />
									<exp exp='Icon3_Colour = 5 //Green' />
								</command>
								<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Icons_Redraw' />
								<command class_type='calculation' title='ServoDrive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='ServoDriveCommand[1] = &apos;V&apos; //Velocity (rev/sec)' />
									<exp exp='ServoDriveCommand[2] = &apos;E&apos;' />
									<exp exp='ServoDriveCommand[3] = &apos;0&apos;' />
									<exp exp='ServoDriveCommand[4] = &apos;0&apos;' />
									<exp exp='ServoDriveCommand[5] = &apos;0&apos;' />
									<exp exp='ServoDriveCommand[6] = &apos;.&apos;' />
									<exp exp='ServoDriveCommand[7] = &apos;5&apos;' />
									<exp exp='ServoDriveCommand[8] = &apos;0&apos;' />
									<exp exp='TxMsgByteCount = 8' />
								</command>
								<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
								<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
								<command class_type='delay' title='Delay' cmdcolor='14697803' cmdcolor_sec='16755119' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='10' type='1' />
								<command class_type='calculation' title='Servo Drive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='ServoDriveCommand[1] = &apos;M&apos; //Motor' />
									<exp exp='ServoDriveCommand[2] = &apos;E&apos; //Enable' />
									<exp exp='TxMsgByteCount = 2' />
								</command>
								<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
								<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
								<command class_type='decision' title='Need to move off limit' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='.LimitSwitchActive != 0' swap='0' >
									<flowline >
										<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='Message_Line1Text = &quot;Limit Switch active&quot;' />
											<exp exp='Message_Line2Text = &quot;Jog to clear&quot;' />
										</command>
										<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Message_Box_Write' />
										<command class_type='decision' title='Check CCW limit' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='.LimitSwitchActive == &apos;2&apos;' swap='0' >
											<flowline >
												<command class_type='comment' title='' comment='CCW Limit Switch active
Move 20000 CW to clear' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
												<command class_type='calculation' title='ServoDriveCommand' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
													<exp exp='ServoDriveCommand[1] = &apos;F&apos;' />
													<exp exp='ServoDriveCommand[2] = &apos;L&apos;' />
													<exp exp='ServoDriveCommand[3] = &apos;2&apos;' />
													<exp exp='ServoDriveCommand[4] = &apos;0&apos;' />
													<exp exp='ServoDriveCommand[5] = &apos;0&apos;' />
													<exp exp='ServoDriveCommand[6] = &apos;0&apos;' />
													<exp exp='ServoDriveCommand[7] = &apos;0&apos;' />
													<exp exp='TxMsgByteCount = 7' />
												</command>
											</flowline>
											<flowline >
												<command class_type='comment' title='' comment='CW Limit Switch active
Move 20000 CCW to clear' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
												<command class_type='calculation' title='ServoDriveCommand' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
													<exp exp='ServoDriveCommand[1] = &apos;F&apos;' />
													<exp exp='ServoDriveCommand[2] = &apos;L&apos;' />
													<exp exp='ServoDriveCommand[3] = &apos;-&apos;' />
													<exp exp='ServoDriveCommand[4] = &apos;2&apos;' />
													<exp exp='ServoDriveCommand[5] = &apos;0&apos;' />
													<exp exp='ServoDriveCommand[6] = &apos;0&apos;' />
													<exp exp='ServoDriveCommand[7] = &apos;0&apos;' />
													<exp exp='ServoDriveCommand[8] = &apos;0&apos;' />
													<exp exp='TxMsgByteCount = 8' />
												</command>
											</flowline>
										</command>
										<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
										<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
										<command class_type='delay' title='Delay to jog off limit switch' cmdcolor='14697803' cmdcolor_sec='16755119' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='5' type='2' />
										<command class_type='calculation' title='Alarm Reset Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='ServoDriveCommand[1] = &apos;A&apos;' />
											<exp exp='ServoDriveCommand[2] = &apos;R&apos;' />
											<exp exp='TxMsgByteCount = 2' />
										</command>
										<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
										<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
										<command class_type='delay' title='Delay' cmdcolor='14697803' cmdcolor_sec='16755119' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='10' type='1' />
										<command class_type='calculation' title='Servo Drive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='ServoDriveCommand[1] = &apos;A&apos;' />
											<exp exp='ServoDriveCommand[2] = &apos;L&apos;' />
											<exp exp='TxMsgByteCount = 2' />
										</command>
										<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
										<command class_type='call' title='Check for response' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
										<command class_type='decision' title='Check Message content' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ServoDriveResponse[0] == &apos;@&apos; &amp;&amp; ServoDriveResponse[1] == &apos;A&apos; &amp;&amp; ServoDriveResponse[2] == &apos;L&apos; &amp;&amp; ServoDriveResponse[4] == &apos;0&apos; &amp;&amp; ServoDriveResponse[5] == &apos;0&apos; &amp;&amp; ServoDriveResponse[6] == &apos;0&apos; &amp;&amp; ServoDriveResponse[7] == &apos;0&apos;' swap='0' >
											<flowline >
												<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
													<exp exp='Message_Line2Text = &quot;Limit Switch cleared&quot;' />
													<exp exp='.LimitSwitchActive = 0 //Clear Limit Switch active' />
												</command>
												<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Message_Box_Write' />
												<command class_type='delay' title='Delay' cmdcolor='14697803' cmdcolor_sec='16755119' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='1' type='2' />
											</flowline>
											<flowline >
												<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
													<exp exp='Message_Line2Text = &quot;Alarm Code fault:&quot;' />
													<exp exp='//Message_Line2Text = ServoDriveResponse' />
													<exp exp='.Return = 5 //Show bad Alarm Code' />
												</command>
												<command class_type='goto' title='Goto Connection Point' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' labelid='0' labelname='' />
											</flowline>
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='Message_Line1Text = &quot;Initialise servo hardware&quot;' />
									<exp exp='Message_Line2Text = &quot;User cancels&quot;' />
									<exp exp='.Return = 6 //Show Do Not  Initialise' />
								</command>
								<command class_type='goto' title='Goto Connection Point' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' labelid='0' labelname='' />
							</flowline>
						</command>
						<command class_type='comment' title='' comment='Servo Drive is between Limit Stops.
Jog CCW until CCW Limit Stop is reached.' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
						<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='//Message_Line1Text = &quot;Initialising servo hardware.&quot;' />
							<exp exp='Message_Line2Text = &quot;Seek CCW Limit Stop&quot;' />
						</command>
						<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Message_Box_Write' />
						<command class_type='calculation' title='ServoDrive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='ServoDriveCommand[1] = &apos;D&apos; //Set Direction CCW' />
							<exp exp='ServoDriveCommand[2] = &apos;I&apos;' />
							<exp exp='ServoDriveCommand[3] = &apos;-&apos;' />
							<exp exp='ServoDriveCommand[4] = &apos;1&apos;' />
							<exp exp='ServoDriveCommand[5] = &apos;0&apos;' />
							<exp exp='TxMsgByteCount = 5' />
						</command>
						<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
						<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
						<command class_type='calculation' title='ServoDrive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='ServoDriveCommand[1] = &apos;J&apos; //Jog Speed (rev/sec)' />
							<exp exp='ServoDriveCommand[2] = &apos;S&apos;' />
							<exp exp='ServoDriveCommand[3] = &apos;0&apos;' />
							<exp exp='ServoDriveCommand[4] = &apos;0&apos;' />
							<exp exp='ServoDriveCommand[5] = &apos;0&apos;' />
							<exp exp='ServoDriveCommand[6] = &apos;.&apos;' />
							<exp exp='ServoDriveCommand[7] = &apos;5&apos;' />
							<exp exp='ServoDriveCommand[8] = &apos;0&apos;' />
							<exp exp='TxMsgByteCount = 8' />
						</command>
						<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
						<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
						<command class_type='calculation' title='ServoDrive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='ServoDriveCommand[1] = &apos;J&apos; //Jog Acc/Decleration (rps/sec)' />
							<exp exp='ServoDriveCommand[2] = &apos;A&apos;' />
							<exp exp='ServoDriveCommand[3] = &apos;1&apos;' />
							<exp exp='ServoDriveCommand[5] = &apos;0&apos;' />
							<exp exp='ServoDriveCommand[6] = &apos;0&apos;' />
							<exp exp='ServoDriveCommand[7] = &apos;.&apos;' />
							<exp exp='ServoDriveCommand[8] = &apos;0&apos;' />
							<exp exp='TxMsgByteCount = 8' />
						</command>
						<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
						<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
						<command class_type='calculation' title='ServoDrive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='ServoDriveCommand[1] = &apos;C&apos; //Commence jogging' />
							<exp exp='ServoDriveCommand[2] = &apos;J&apos;' />
							<exp exp='TxMsgByteCount = 2' />
						</command>
						<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
						<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
						<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='Button1_Text = &quot;&quot;' />
							<exp exp='Button2_Text = &quot;&quot;' />
							<exp exp='Button4_Text = &quot;STOP&quot;' />
							<exp exp='ButtonPressed = 0' />
							<exp exp='ButtonUpdate = true' />
						</command>
						<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Button_Redraw' />
						<command class_type='loop' title='Jog until CCW limit' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='1' exp='.LimitSwitchActive = &apos;2&apos;' start='0' >
							<flowline >
								<command class_type='comment' title='' comment='Check CCW limit stop by issuing AL command' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
								<command class_type='calculation' title='Servo Drive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='ServoDriveCommand[1] = &apos;A&apos;' />
									<exp exp='ServoDriveCommand[2] = &apos;L&apos;' />
									<exp exp='TxMsgByteCount = 2' />
								</command>
								<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
								<command class_type='call' title='Check for response' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
								<command class_type='decision' title='Check Message content' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ServoDriveResponse[0] == &apos;@&apos; &amp;&amp; ServoDriveResponse[1] == &apos;A&apos; &amp;&amp; ServoDriveResponse[2] == &apos;L&apos; &amp;&amp; ServoDriveResponse[4] == &apos;0&apos; &amp;&amp; ServoDriveResponse[5] == &apos;0&apos; &amp;&amp; ServoDriveResponse[6] == &apos;0&apos; &amp;&amp; ServoDriveResponse[7] == &apos;0&apos;' swap='1' >
									<flowline >
										<command class_type='decision' title='Check CCW Limit' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ServoDriveResponse[7] == &apos;2&apos;' swap='0' >
											<flowline >
												<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
													<exp exp='Message_Line2Text = &quot;CCW Limit Switch active:&quot;' />
													<exp exp='.LimitSwitchActive = &apos;2&apos; //Show CCW Limit active' />
												</command>
												<command class_type='calculation' title='Servo Drive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
													<exp exp='ServoDriveCommand[1] = &apos;S&apos; //Stop Jogging' />
													<exp exp='ServoDriveCommand[2] = &apos;J&apos;' />
													<exp exp='TxMsgByteCount = 2' />
												</command>
												<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
												<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
											</flowline>
											<flowline >
												<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
													<exp exp='Message_Line2Text = &quot;Alarm Code fault:&quot;' />
													<exp exp='//Message_Line2Text = ServoDriveResponse' />
													<exp exp='.Return = 7 //Show bad Alarm Code when jogging' />
												</command>
												<command class_type='goto' title='Goto Connection Point' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' labelid='0' labelname='' />
											</flowline>
										</command>
									</flowline>
									<flowline >
										<command class_type='comment' title='' comment='No limit or alarm
Keep jogging' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
										<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Button_Scan' />
										<command class_type='decision' title='Check STOP button' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ButtonPressed == BUTTON_4' swap='0' >
											<flowline >
												<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Button_Redraw' />
												<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
													<exp exp='Message_Line1Text = &quot;User pressed STOP&quot;' />
													<exp exp='Message_Line2Text = &quot;&quot;' />
													<exp exp='.Return = 6 //Show user pressed STOP' />
												</command>
												<command class_type='goto' title='Goto Connection Point' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' labelid='0' labelname='' />
											</flowline>
											<flowline />
										</command>
									</flowline>
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='Message_Line2Text = &quot;CCW Limit found&quot;' />
							<exp exp='' />
						</command>
						<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Message_Box_Write' />
						<command class_type='delay' title='Delay' cmdcolor='14697803' cmdcolor_sec='16755119' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='1' type='2' />
						<command class_type='comment' title='' comment='Zero encoder and position so distance to CW Limit Stop can be measured.' textarea='36,27,36,27' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
						<command class_type='calculation' title='Servo Drive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='ServoDriveCommand[1] = &apos;E&apos; //Encoder Position' />
							<exp exp='ServoDriveCommand[2] = &apos;P&apos;' />
							<exp exp='ServoDriveCommand[3] = &apos;0&apos; //Zero' />
							<exp exp='TxMsgByteCount = 3' />
						</command>
						<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
						<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
						<command class_type='calculation' title='Servo Drive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='ServoDriveCommand[1] = &apos;S&apos; //Set Position' />
							<exp exp='ServoDriveCommand[2] = &apos;P&apos;' />
							<exp exp='ServoDriveCommand[3] = &apos;0&apos; //Zero' />
							<exp exp='TxMsgByteCount = 3' />
						</command>
						<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
						<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
						<command class_type='comment' title='' comment='Jog to CW Limit Stop' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
						<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='Message_Line2Text = &quot;Seek CW Limit Stop&quot;' />
							<exp exp='' />
						</command>
						<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Message_Box_Write' />
						<command class_type='calculation' title='ServoDrive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='ServoDriveCommand[1] = &apos;D&apos; //Set Direction CW' />
							<exp exp='ServoDriveCommand[2] = &apos;I&apos;' />
							<exp exp='ServoDriveCommand[3] = &apos;1&apos;' />
							<exp exp='ServoDriveCommand[4] = &apos;0&apos;' />
							<exp exp='TxMsgByteCount = 4' />
						</command>
						<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
						<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
						<command class_type='calculation' title='ServoDrive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='ServoDriveCommand[1] = &apos;C&apos; //Commence jogging' />
							<exp exp='ServoDriveCommand[2] = &apos;J&apos;' />
							<exp exp='TxMsgByteCount = 2' />
						</command>
						<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
						<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
						<command class_type='loop' title='Jog until CW limit' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='1' exp='.LimitSwitchActive = &apos;4&apos;' start='0' >
							<flowline >
								<command class_type='comment' title='' comment='Check CW limit stop by issuing AL command' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
								<command class_type='calculation' title='Servo Drive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='ServoDriveCommand[1] = &apos;A&apos;' />
									<exp exp='ServoDriveCommand[2] = &apos;L&apos;' />
									<exp exp='TxMsgByteCount = 2' />
								</command>
								<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
								<command class_type='call' title='Check for response' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
								<command class_type='decision' title='Check Message content' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ServoDriveResponse[0] == &apos;@&apos; &amp;&amp; ServoDriveResponse[1] == &apos;A&apos; &amp;&amp; ServoDriveResponse[2] == &apos;L&apos; &amp;&amp; ServoDriveResponse[4] == &apos;0&apos; &amp;&amp; ServoDriveResponse[5] == &apos;0&apos; &amp;&amp; ServoDriveResponse[6] == &apos;0&apos; &amp;&amp; ServoDriveResponse[7] == &apos;0&apos;' swap='1' >
									<flowline >
										<command class_type='decision' title='Check CW Limit' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ServoDriveResponse[7] == &apos;4&apos;' swap='0' >
											<flowline >
												<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
													<exp exp='Message_Line2Text = &quot;CW Limit Switch active:&quot;' />
													<exp exp='.LimitSwitchActive = &apos;4&apos; //Show CW Limit active' />
												</command>
												<command class_type='calculation' title='Servo Drive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
													<exp exp='ServoDriveCommand[1] = &apos;S&apos; //Stop Jogging' />
													<exp exp='ServoDriveCommand[2] = &apos;J&apos;' />
													<exp exp='TxMsgByteCount = 2' />
												</command>
												<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
												<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
											</flowline>
											<flowline >
												<command class_type='decision' title='Check CCW Limit cleared' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='.LimitSwitchActive = &apos;2&apos;' swap='0' >
													<flowline >
														<command class_type='decision' title='Check CCW Limit active' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ServoDriveResponse[7] == &apos;2&apos;' swap='1' >
															<flowline >
																<command class_type='calculation' title='Clear flag' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
																	<exp exp='.LimitSwitchActive = &apos;0&apos; //Show CCW Limit cleared' />
																</command>
															</flowline>
															<flowline >
																<command class_type='comment' title='' comment='Keep resetting alarm until CCW limit cleared' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
																<command class_type='calculation' title='Alarm Reset Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
																	<exp exp='ServoDriveCommand[1] = &apos;A&apos;' />
																	<exp exp='ServoDriveCommand[2] = &apos;R&apos;' />
																	<exp exp='TxMsgByteCount = 2' />
																</command>
																<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
																<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
															</flowline>
														</command>
													</flowline>
													<flowline >
														<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
															<exp exp='Message_Line2Text = &quot;Alarm Code fault:&quot;' />
															<exp exp='//Message_Line2Text = ServoDriveResponse' />
															<exp exp='.Return = 7 //Show bad Alarm Code when jogging' />
														</command>
														<command class_type='goto' title='Goto Connection Point' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' labelid='0' labelname='' />
													</flowline>
												</command>
											</flowline>
										</command>
									</flowline>
									<flowline >
										<command class_type='comment' title='' comment='No limit or alarm
Keep jogging' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
										<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Button_Scan' />
										<command class_type='decision' title='Check STOP button' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ButtonPressed == BUTTON_4' swap='0' >
											<flowline >
												<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Button_Redraw' />
												<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
													<exp exp='Message_Line2Text = &quot;User pressed STOP&quot;' />
													<exp exp='.Return = 6 //Show user pressed STOP' />
												</command>
												<command class_type='goto' title='Goto Connection Point' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' labelid='0' labelname='' />
											</flowline>
											<flowline />
										</command>
									</flowline>
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='Message_Line2Text = &quot;CW Limit Stop found&quot;' />
							<exp exp='' />
						</command>
						<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Message_Box_Write' />
						<command class_type='delay' title='Delay' cmdcolor='14697803' cmdcolor_sec='16755119' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='1' type='2' />
						<command class_type='comment' title='' comment='Read encoder and position for CCW to CW distance' textarea='36,27,36,27' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
						<command class_type='calculation' title='Servo Drive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='ServoDriveCommand[1] = &apos;S&apos; //Read Set Position' />
							<exp exp='ServoDriveCommand[2] = &apos;P&apos;' />
							<exp exp='TxMsgByteCount = 2' />
						</command>
						<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
						<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
						<command class_type='call' title='Calc limit range' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='SP_To_ULong' >
							<return exp='ServoLimitRange' />
						</command>
						<command class_type='decision' title='Check Limit Range' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ServoLimitRange &gt; ServoLimitRangeMax' swap='0' >
							<flowline >
								<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='Message_Line2Text = &quot;Servo Limit Range error:&quot;' />
									<exp exp='.Return = 8 //Show bad ServoLimitRange Code' />
								</command>
								<command class_type='goto' title='Goto Connection Point' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' labelid='0' labelname='' />
							</flowline>
							<flowline >
								<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='Message_Line1Text = &quot;Servo Range:&quot;' />
								</command>
								<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Position_To_Message' >
									<argument exp='ServoLimitRange' />
								</command>
								<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Message_Box_Write' />
								<command class_type='delay' title='Delay' cmdcolor='14697803' cmdcolor_sec='16755119' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='1' type='2' />
							</flowline>
						</command>
						<command class_type='calculation' title='Set CW and CCW end positions' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='ServoCcwEndPosition = 3000' />
							<exp exp='ServoCwEndPosition = ServoLimitRange - 3000' />
						</command>
						<command class_type='comment' title='' comment='Feed CCW to clear CW Limit Switch' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
						<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='Message_Line2Text = &quot;Feed to clear CW Limit Switch&quot;' />
							<exp exp='' />
						</command>
						<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Message_Box_Write' />
						<command class_type='calculation' title='ServoDriveCommand' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='ServoDriveCommand[1] = &apos;F&apos;' />
							<exp exp='ServoDriveCommand[2] = &apos;L&apos;' />
							<exp exp='ServoDriveCommand[3] = &apos;-&apos;' />
							<exp exp='ServoDriveCommand[4] = &apos;1&apos;' />
							<exp exp='ServoDriveCommand[5] = &apos;0&apos;' />
							<exp exp='ServoDriveCommand[6] = &apos;0&apos;' />
							<exp exp='ServoDriveCommand[7] = &apos;0&apos;' />
							<exp exp='TxMsgByteCount = 7' />
						</command>
						<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
						<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
						<command class_type='delay' title='Delay to feed clear of limit switch' cmdcolor='14697803' cmdcolor_sec='16755119' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='1' type='2' />
						<command class_type='calculation' title='Alarm Reset Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='ServoDriveCommand[1] = &apos;A&apos;' />
							<exp exp='ServoDriveCommand[2] = &apos;R&apos;' />
							<exp exp='TxMsgByteCount = 2' />
						</command>
						<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
						<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
						<command class_type='delay' title='Delay' cmdcolor='14697803' cmdcolor_sec='16755119' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='10' type='1' />
						<command class_type='calculation' title='Servo Drive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='ServoDriveCommand[1] = &apos;A&apos;' />
							<exp exp='ServoDriveCommand[2] = &apos;L&apos;' />
							<exp exp='TxMsgByteCount = 2' />
						</command>
						<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
						<command class_type='call' title='Check for response' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
						<command class_type='decision' title='Check Message content' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ServoDriveResponse[1] == &apos;A&apos; &amp;&amp; ServoDriveResponse[2] == &apos;L&apos; &amp;&amp; ServoDriveResponse[4] == &apos;0&apos; &amp;&amp; ServoDriveResponse[5] == &apos;0&apos; &amp;&amp; ServoDriveResponse[6] == &apos;0&apos; &amp;&amp; ServoDriveResponse[7] == &apos;0&apos;' swap='0' >
							<flowline >
								<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='Message_Line2Text = &quot;Limit Switch cleared:&quot;' />
									<exp exp='.LimitSwitchActive = 0 //Clear Limit Switch active' />
									<exp exp='.Return = 0 //Show success' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='Message_Line2Text = &quot;Alarm Code fault:&quot;' />
									<exp exp='//Message_Line2Text = ServoDriveResponse' />
									<exp exp='.Return = 5 //Show bad Alarm Code' />
								</command>
							</flowline>
						</command>
						<command class_type='label' title='Declare Connection Point' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' labelid='0' labelname='Return' />
						<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Message_Box_Write' />
						<command class_type='delay' title='Delay' cmdcolor='14697803' cmdcolor_sec='16755119' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='1' type='2' />
						<command class_type='decision' title='Check Return code' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='.Return != 0' swap='0' >
							<flowline >
								<command class_type='comment' title='' comment='.Return code is not &apos;success&apos;.
Disable Motor (MD)' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
							</flowline>
							<flowline >
								<command class_type='calculation' title='Icons' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='Icon3_Text = &quot;HOME&quot;' />
								</command>
								<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Icons_Redraw' />
							</flowline>
						</command>
						<command class_type='calculation' title='Set travel limits' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='ServoCcwEndPosition = 1333 //10mm' />
							<exp exp='ServoCwEndPosition = ServoLimitRange - 1333 //Max - 10mm' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Position_To_Message' description='Convert Unsigned Long target servo position to ASCII characters in Message_Line2Text string.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='ServoPosition' type='u32' description='Target servo Set Position in ASCII is loaded to buffer' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='Count' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='Divisor' type='u32' description='Divisor for converting Long to ASCII digits' isconst='0' isHidden='0' isinit='1' usrinit='1000000000' setinit='1000000000' />
						<local name='IsLeadingZero' type='b1' description='True indicates no non-zero digit has been written yet' isconst='0' isHidden='0' isinit='1' usrinit='1' setinit='true' />
						<command class_type='calculation' title='Set Index and sign' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='.Count = 0' />
							<exp exp='.IsLeadingZero = true' />
						</command>
						<command class_type='loop' title='Loop adding digits to message' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='1' exp='.Divisor == 0' start='0' >
							<flowline >
								<command class_type='calculation' title='Calculate next digit' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='Message_Line2Text[.Count] = (.ServoPosition / .Divisor) + 0x30' />
									<exp exp='' />
								</command>
								<command class_type='decision' title='Check if leading zero' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='(.IsLeadingZero == true) &amp;&amp; (Message_Line2Text[.Count] == 0x30)' swap='0' >
									<flowline />
									<flowline >
										<command class_type='calculation' title='Keep digit' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='.IsLeadingZero = false //Show not leading zero' />
											<exp exp='.ServoPosition = .ServoPosition - ((Message_Line2Text[.Count] - 0x30) * .Divisor) //Adjust Servo Position' />
											<exp exp='.Count = .Count + 1 //Adjust to next digit' />
											<exp exp='' />
										</command>
									</flowline>
								</command>
								<command class_type='calculation' title='Adjust Divisor' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='.Divisor = .Divisor / 10' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Add string terminator' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='Message_Line2Text[.Count] = 0' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Exp_Read' description='Read a single input in an expansion port.
Port address: 0 = E1/P0-0 to 47 = E3/P1-7, use alias constants
Data: 0, 1

' statediag='0' >
						<return name='Return' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Port' type='u8' description='Port to read from 0 to 47 = E1/P0-0 to E3/P1-7' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='ExpAddress' type='u8' description='Expansion address on I2C' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='BitMask' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Define bit mask' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='.BitMask = .Port &amp; 0b00000111' />
						</command>
						<command class_type='switch' title='Select Bit Mask' textarea='36,25,36,25' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='.BitMask' >
							<case >
								<flowline />
							</case>
							<case exp='0' >
								<flowline >
									<command class_type='calculation' title='Define bit mask' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.BitMask = 0b00000001' />
									</command>
								</flowline>
							</case>
							<case exp='1' >
								<flowline >
									<command class_type='calculation' title='Define bit mask' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.BitMask = 0b00000010' />
									</command>
								</flowline>
							</case>
							<case exp='2' >
								<flowline >
									<command class_type='calculation' title='Define bit mask' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.BitMask = 0b00000100' />
									</command>
								</flowline>
							</case>
							<case exp='3' >
								<flowline >
									<command class_type='calculation' title='Define bit mask' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.BitMask = 0b00001000' />
									</command>
								</flowline>
							</case>
							<case exp='4' >
								<flowline >
									<command class_type='calculation' title='Define bit mask' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.BitMask = 0b00010000' />
									</command>
								</flowline>
							</case>
							<case exp='5' >
								<flowline >
									<command class_type='calculation' title='Define bit mask' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.BitMask = 0b00100000' />
									</command>
								</flowline>
							</case>
							<case exp='6' >
								<flowline >
									<command class_type='calculation' title='Define bit mask' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.BitMask = 0b01000000' />
									</command>
								</flowline>
							</case>
							<case exp='7' >
								<flowline >
									<command class_type='calculation' title='Define bit mask' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.BitMask = 0b10000000' />
									</command>
								</flowline>
							</case>
						</command>
						<command class_type='calculation' title='Define bit mask' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='.Port = .Port / 8' />
						</command>
						<command class_type='switch' title='Select Expansion' textarea='36,25,36,25' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='.Port' >
							<case >
								<flowline />
							</case>
							<case exp='0' >
								<flowline >
									<command class_type='calculation' title='Find Exp address, Exp register and Exp data' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.ExpAddress = EXP1_I2C_ADDR' />
										<exp exp='I2Cdata[0] = EXP_P0_IN_REG' />
									</command>
								</flowline>
							</case>
							<case exp='1' >
								<flowline >
									<command class_type='calculation' title='Find Exp address, Exp register and Exp data' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.ExpAddress = EXP1_I2C_ADDR' />
										<exp exp='I2Cdata[0] = EXP_P1_IN_REG' />
									</command>
								</flowline>
							</case>
							<case exp='2' >
								<flowline >
									<command class_type='calculation' title='Find Exp address, Exp register and Exp data' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.ExpAddress = EXP2_I2C_ADDR' />
										<exp exp='I2Cdata[0] = EXP_P0_IN_REG' />
									</command>
								</flowline>
							</case>
							<case exp='3' >
								<flowline >
									<command class_type='calculation' title='Find Exp address, Exp register and Exp data' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.ExpAddress = EXP2_I2C_ADDR' />
										<exp exp='I2Cdata[0] = EXP_P1_IN_REG' />
									</command>
								</flowline>
							</case>
							<case exp='4' >
								<flowline >
									<command class_type='calculation' title='Find Exp address, Exp register and Exp data' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.ExpAddress = EXP3_I2C_ADDR' />
										<exp exp='I2Cdata[0] = EXP_P0_IN_REG' />
									</command>
								</flowline>
							</case>
							<case exp='5' >
								<flowline >
									<command class_type='calculation' title='Find Exp address, Exp register and Exp data' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.ExpAddress = EXP3_I2C_ADDR' />
										<exp exp='I2Cdata[0] = EXP_P1_IN_REG' />
									</command>
								</flowline>
							</case>
						</command>
						<command class_type='call' title='I2C Transaction Initialise' textmode='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Initialise' >
							<argument exp='.ExpAddress' />
						</command>
						<command class_type='call' title='I2C Transaction Write' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Write' >
							<argument exp='I2Cdata' />
							<argument exp='0x8001' />
						</command>
						<command class_type='call' title='I2C Transaction Read' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Read' >
							<argument exp='I2Cdata' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Uninit' />
						<command class_type='decision' title='Is input 0' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='(I2Cdata[0] &amp; .BitMask) = 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Return 0' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='.Return = 0' />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Return 1' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='.Return = 1' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Exp_Initialise' description='Initialise the I2C and expansion ports' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='MenuKey' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='I2C Master 1 Initialise' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Initialise' />
						<command class_type='comment' title='' comment='Set Exp 1 directions:

Outputs: P0-0 P0-1 P0-2 P0-3 P0-4 P0-5 P0-6 P0-7
 Inputs: None

Outputs: P1-0 P1-1 P1-2 P1-3 P1-4 P1-5 P1-6 P1-7
 Inputs: None
' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
						<command class_type='calculation' title='Data: Config P0' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='I2Cdata[0] = EXP_P0_CONFIG_REG' />
							<exp exp='I2Cdata[1] = 0b00000000' />
						</command>
						<command class_type='call' title='Exp 1 I2C Transaction Initialise' textmode='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Initialise' >
							<argument exp='EXP1_I2C_ADDR' />
						</command>
						<command class_type='call' title='I2C Transaction Write' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Write' >
							<argument exp='I2Cdata' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Uninit' />
						<command class_type='calculation' title='Data: Config P1' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='I2Cdata[0] = EXP_P1_CONFIG_REG' />
							<exp exp='I2Cdata[1] = 0b00000000' />
						</command>
						<command class_type='call' title='Exp 1 I2C Transaction Initialise' textmode='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Initialise' >
							<argument exp='EXP1_I2C_ADDR' />
						</command>
						<command class_type='call' title='I2C Transaction Write' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Write' >
							<argument exp='I2Cdata' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Uninit' />
						<command class_type='comment' title='' comment='Set Exp 1 polarity:

Inverted: None
' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
						<command class_type='calculation' title='Data: Polarity P0' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='I2Cdata[0] = EXP_P0_POL_REG' />
							<exp exp='I2Cdata[1] = 0' />
						</command>
						<command class_type='call' title='Exp 1 I2C Transaction Initialise' textmode='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Initialise' >
							<argument exp='EXP1_I2C_ADDR' />
						</command>
						<command class_type='call' title='I2C Transaction Write' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Write' >
							<argument exp='I2Cdata' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Uninit' />
						<command class_type='calculation' title='Data: Polarity P1' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='I2Cdata[0] = EXP_P1_POL_REG' />
							<exp exp='I2Cdata[1] = 0' />
						</command>
						<command class_type='call' title='Exp 1 I2C Transaction Initialise' textmode='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Initialise' >
							<argument exp='EXP1_I2C_ADDR' />
						</command>
						<command class_type='call' title='I2C Transaction Write' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Write' >
							<argument exp='I2Cdata' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Uninit' />
						<command class_type='comment' title='' comment='Set Exp 1 initial values:

Outputs:
P0-0 low, P0-1 low, P0-2 low, P0-3 low
P0-4 low, P0-5 low, P0-6 low, P0-7 high

Outputs:
P1-0 low, P1-1 low, P1-2 low, P1-3 low
P1-4 low, P1-5 low, P1-6 low, P1-7 low
' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
						<command class_type='calculation' title='Data: Initial Output P0' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='I2Cdata[0] = EXP_P0_OUT_REG' />
							<exp exp='ExpOutputData[0] = 0b10000000' />
							<exp exp='I2Cdata[1] = ExpOutputData[0]' />
						</command>
						<command class_type='call' title='Exp 1 I2C Transaction Initialise' textmode='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Initialise' >
							<argument exp='EXP1_I2C_ADDR' />
						</command>
						<command class_type='call' title='I2C Transaction Write' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Write' >
							<argument exp='I2Cdata' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Uninit' />
						<command class_type='calculation' title='Data: Initial Output P1' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='I2Cdata[0] = EXP_P1_OUT_REG' />
							<exp exp='ExpOutputData[1] = 0b00000000' />
							<exp exp='I2Cdata[1] = ExpOutputData[1]' />
						</command>
						<command class_type='call' title='Exp 1 I2C Transaction Initialise' textmode='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Initialise' >
							<argument exp='EXP1_I2C_ADDR' />
						</command>
						<command class_type='call' title='I2C Transaction Write' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Write' >
							<argument exp='I2Cdata' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Uninit' />
						<command class_type='comment' title='' comment='Set Exp 2 directions:

Outputs: P0-0 P0-1 P0-2 P0-3 P0-4 P0-5 P0-6 P0-7
 Inputs: None

Outputs: P1-0 P1-1 P1-2 P1-3 P1-5 P1-6 P1-7
 Inputs: P1-4
' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
						<command class_type='calculation' title='Data: Config P0' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='I2Cdata[0] = EXP_P0_CONFIG_REG' />
							<exp exp='I2Cdata[1] = 0b00000000' />
						</command>
						<command class_type='call' title='Exp 1 I2C Transaction Initialise' textmode='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Initialise' >
							<argument exp='EXP2_I2C_ADDR' />
						</command>
						<command class_type='call' title='I2C Transaction Write' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Write' >
							<argument exp='I2Cdata' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Uninit' />
						<command class_type='calculation' title='Data: Config P1' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='I2Cdata[0] = EXP_P1_CONFIG_REG' />
							<exp exp='I2Cdata[1] = 0b00010000' />
						</command>
						<command class_type='call' title='Exp 1 I2C Transaction Initialise' textmode='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Initialise' >
							<argument exp='EXP2_I2C_ADDR' />
						</command>
						<command class_type='call' title='I2C Transaction Write' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Write' >
							<argument exp='I2Cdata' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Uninit' />
						<command class_type='comment' title='' comment='Set Exp 2 polarity:

Inverted: None
' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
						<command class_type='calculation' title='Data: Polarity P0' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='I2Cdata[0] = EXP_P0_POL_REG' />
							<exp exp='I2Cdata[1] = 0' />
						</command>
						<command class_type='call' title='Exp 1 I2C Transaction Initialise' textmode='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Initialise' >
							<argument exp='EXP2_I2C_ADDR' />
						</command>
						<command class_type='call' title='I2C Transaction Write' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Write' >
							<argument exp='I2Cdata' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Uninit' />
						<command class_type='calculation' title='Data: Polarity P1' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='I2Cdata[0] = EXP_P1_POL_REG' />
							<exp exp='I2Cdata[1] = 0' />
						</command>
						<command class_type='call' title='Exp 1 I2C Transaction Initialise' textmode='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Initialise' >
							<argument exp='EXP2_I2C_ADDR' />
						</command>
						<command class_type='call' title='I2C Transaction Write' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Write' >
							<argument exp='I2Cdata' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Uninit' />
						<command class_type='comment' title='' comment='Set Exp 2 initial values:

Outputs:
P0-0 low, P0-1 low, P0-2 low, P0-3 low
P0-4 low, P0-5 low, P0-6 low, P0-7 low

Outputs:
P1-0 low, P1-1 low, P1-2 low, P1-3 low
P1-4 xxx, P1-5 low, P1-6 low, P1-7 low
' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
						<command class_type='calculation' title='Data: Initial Output P0' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='I2Cdata[0] = EXP_P0_OUT_REG' />
							<exp exp='ExpOutputData[2] = 0b00000000' />
							<exp exp='I2Cdata[1] = ExpOutputData[2]' />
						</command>
						<command class_type='call' title='Exp 1 I2C Transaction Initialise' textmode='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Initialise' >
							<argument exp='EXP2_I2C_ADDR' />
						</command>
						<command class_type='call' title='I2C Transaction Write' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Write' >
							<argument exp='I2Cdata' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Uninit' />
						<command class_type='calculation' title='Data: Initial Output P1' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='I2Cdata[0] = EXP_P1_OUT_REG' />
							<exp exp='ExpOutputData[3] = 0b00000000' />
							<exp exp='I2Cdata[1] = ExpOutputData[3]' />
						</command>
						<command class_type='call' title='Exp 1 I2C Transaction Initialise' textmode='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Initialise' >
							<argument exp='EXP2_I2C_ADDR' />
						</command>
						<command class_type='call' title='I2C Transaction Write' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Write' >
							<argument exp='I2Cdata' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Uninit' />
						<command class_type='comment' title='' comment='Set Exp 3 directions:

Outputs: P0-0 P0-1 P0-2 P0-3 P0-4
 Inputs: P0-5 P0-6 P0-7

Outputs: P1-5 P1-6 P1-7
 Inputs: P1-0 P1-1 P1-2 P1-3 P1-4
' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
						<command class_type='calculation' title='Data: Config P0' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='I2Cdata[0] = EXP_P0_CONFIG_REG' />
							<exp exp='I2Cdata[1] = 0b11100000' />
						</command>
						<command class_type='call' title='Exp 1 I2C Transaction Initialise' textmode='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Initialise' >
							<argument exp='EXP3_I2C_ADDR' />
						</command>
						<command class_type='call' title='I2C Transaction Write' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Write' >
							<argument exp='I2Cdata' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Uninit' />
						<command class_type='calculation' title='Data: Config P1' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='I2Cdata[0] = EXP_P1_CONFIG_REG' />
							<exp exp='I2Cdata[1] = 0b00011111' />
						</command>
						<command class_type='call' title='Exp 1 I2C Transaction Initialise' textmode='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Initialise' >
							<argument exp='EXP3_I2C_ADDR' />
						</command>
						<command class_type='call' title='I2C Transaction Write' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Write' >
							<argument exp='I2Cdata' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Uninit' />
						<command class_type='comment' title='' comment='Set Exp 3 polarity:

Inverted: None
' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
						<command class_type='calculation' title='Data: Polarity P0' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='I2Cdata[0] = EXP_P0_POL_REG' />
							<exp exp='I2Cdata[1] = 0' />
						</command>
						<command class_type='call' title='Exp 1 I2C Transaction Initialise' textmode='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Initialise' >
							<argument exp='EXP3_I2C_ADDR' />
						</command>
						<command class_type='call' title='I2C Transaction Write' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Write' >
							<argument exp='I2Cdata' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Uninit' />
						<command class_type='calculation' title='Data: Polarity P1' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='I2Cdata[0] = EXP_P1_POL_REG' />
							<exp exp='I2Cdata[1] = 0' />
						</command>
						<command class_type='call' title='Exp 1 I2C Transaction Initialise' textmode='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Initialise' >
							<argument exp='EXP3_I2C_ADDR' />
						</command>
						<command class_type='call' title='I2C Transaction Write' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Write' >
							<argument exp='I2Cdata' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Uninit' />
						<command class_type='comment' title='' comment='Set Exp 3 initial values:

Outputs:
P0-0 low, P0-1 low, P0-2 low, P0-3 low
P0-4 low, P0-5 xxx, P0-6 xxx, P0-7 xxx

Outputs:
P1-0 xxx, P1-1 xxx, P1-2 xxx, P1-3 xxx
P1-4 xxx, P1-5 low, P1-6 low, P1-7 low
' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
						<command class_type='calculation' title='Data: Initial Output P0' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='I2Cdata[0] = EXP_P0_OUT_REG' />
							<exp exp='ExpOutputData[4] = 0b00000000' />
							<exp exp='I2Cdata[1] = ExpOutputData[4]' />
						</command>
						<command class_type='call' title='Exp 1 I2C Transaction Initialise' textmode='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Initialise' >
							<argument exp='EXP3_I2C_ADDR' />
						</command>
						<command class_type='call' title='I2C Transaction Write' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Write' >
							<argument exp='I2Cdata' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Uninit' />
						<command class_type='calculation' title='Data: Initial Output P1' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='I2Cdata[0] = EXP_P1_OUT_REG' />
							<exp exp='ExpOutputData[5] = 0b00000000' />
							<exp exp='I2Cdata[1] = ExpOutputData[5]' />
						</command>
						<command class_type='call' title='Exp 1 I2C Transaction Initialise' textmode='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Initialise' >
							<argument exp='EXP3_I2C_ADDR' />
						</command>
						<command class_type='call' title='I2C Transaction Write' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Write' >
							<argument exp='I2Cdata' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Uninit' />
						<command class_type='comment' title='' comment='Reset steppers' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
						<command class_type='call' title='STEP A reset enable' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Exp_Write' >
							<argument exp='1' />
							<argument exp='STEPA_RESET' />
						</command>
						<command class_type='call' title='STEP B reset enable' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Exp_Write' >
							<argument exp='0' />
							<argument exp='STEPB_RESET' />
						</command>
						<command class_type='delay' title='Stepper reset time' cmdcolor='14697803' cmdcolor_sec='16755119' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='1' type='1' />
						<command class_type='call' title='STEP A reset disable' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Exp_Write' >
							<argument exp='0' />
							<argument exp='STEPA_RESET' />
						</command>
						<command class_type='call' title='STEP B reset disable' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Exp_Write' >
							<argument exp='1' />
							<argument exp='STEPB_RESET' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Display_Initialise' description='Initialise the display and print test areas' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='GLCD Initialise' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='Initialise' />
						<command class_type='call' title='Display Rotation 0' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='SetDisplayOrientation' >
							<argument exp='0' />
						</command>
						<command class_type='call' title='GLCD Clear' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='ClearDisplay' />
						<command class_type='call' title='Set Font Scale' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='SetFontScaler' >
							<argument exp='2' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Create Icons' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Icons_Create' />
						<command class_type='call' title='Creat buttons' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Buttons_Create' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Button_Redraw' description='Re-draw a button with its label, pressed or released
ButtonPressed variable controls action.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='ButtonCount' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='decision' title='Test if no change' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='(ButtonPressed == ButtonSaved) &amp;&amp; (ButtonUpdate == false)' swap='1' >
							<flowline >
								<command class_type='calculation' title='start button count' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='.ButtonCount = 1' />
								</command>
								<command class_type='loop' title='Loop' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='1' exp='.ButtonCount = 5' start='0' >
									<flowline >
										<command class_type='decision' title='Set background by pressed' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='.ButtonCount = ButtonPressed' swap='0' >
											<flowline >
												<command class_type='call' title='Background medium grey' ccode='      // Name: Background Grey, Type: User Macro: SetTrueBackgroundColour(255, 255, 255)
      FCM_SetTrueBackgroundColour(255, 255, 255);' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='SetTrueBackgroundColour' >
													<argument exp='192' />
													<argument exp='192' />
													<argument exp='192' />
												</command>
											</flowline>
											<flowline >
												<command class_type='call' title='Background light grey' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='SetTrueBackgroundColour' >
													<argument exp='225' />
													<argument exp='225' />
													<argument exp='225' />
												</command>
											</flowline>
										</command>
										<command class_type='call' title='Draw Button' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='DrawRectangle' >
											<argument exp='ButtonHorizontalOrigins[.ButtonCount] + 1' />
											<argument exp='ButtonVerticalOrigin + 1' />
											<argument exp='ButtonHorizontalOrigins[.ButtonCount] + ButtonHorizontalSize - 1' />
											<argument exp='ButtonVerticalOrigin + ButtonVerticalSize - 1' />
											<argument exp='0' />
											<argument exp='0' />
										</command>
										<command class_type='switch' title='which button text ' textarea='36,25,36,25' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='.ButtonCount' >
											<case >
												<flowline />
											</case>
											<case exp='1' >
												<flowline >
													<command class_type='call' title='Label Button 1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='Print' >
														<argument exp='Button1_Text' />
														<argument exp='ButtonHorizontalOrigins[.ButtonCount] + 10' />
														<argument exp='ButtonTextVertical' />
														<argument exp='Arial_14_Bold' />
														<argument exp='1' />
													</command>
												</flowline>
											</case>
											<case exp='2' >
												<flowline >
													<command class_type='call' title='Label Button 2' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='Print' >
														<argument exp='Button2_Text' />
														<argument exp='ButtonHorizontalOrigins[.ButtonCount] + 10' />
														<argument exp='ButtonTextVertical' />
														<argument exp='Arial_14_Bold' />
														<argument exp='false' />
													</command>
												</flowline>
											</case>
											<case exp='3' >
												<flowline >
													<command class_type='call' title='Label Button 3' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='Print' >
														<argument exp='Button3_Text' />
														<argument exp='ButtonHorizontalOrigins[.ButtonCount] + 10' />
														<argument exp='ButtonTextVertical' />
														<argument exp='Arial_14_Bold' />
														<argument exp='false' />
													</command>
												</flowline>
											</case>
											<case exp='4' >
												<flowline >
													<command class_type='call' title='Label Button 4' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='Print' >
														<argument exp='Button4_Text' />
														<argument exp='ButtonHorizontalOrigins[.ButtonCount] + 10' />
														<argument exp='ButtonTextVertical' />
														<argument exp='Arial_14_Bold' />
														<argument exp='false' />
													</command>
												</flowline>
											</case>
										</command>
										<command class_type='calculation' title='adjust button count' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='.ButtonCount = .ButtonCount + 1' />
										</command>
									</flowline>
								</command>
								<command class_type='calculation' title='Save Button Press' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='ButtonSaved = ButtonPressed' />
									<exp exp='ButtonUpdate = false' />
								</command>
								<command class_type='call' title='Background light cyan' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='SetTrueBackgroundColour' >
									<argument exp='233' />
									<argument exp='255' />
									<argument exp='255' />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Display_Full_Msg' description='Display all the bytes in a UART Rx Msg' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='ByteCnt' type='u16' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='PrintString' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='100' />
						</local>
						<command class_type='calculation' title='Init byte count' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='.ByteCnt = 0' />
						</command>
						<command class_type='loop' title='Loop' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='1' exp='.ByteCnt == RxMsgByteCount' start='0' >
							<flowline >
								<command class_type='decision' title='Split Number/Alpha' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='(ServoDriveResponse[.ByteCnt] / 0x10) &gt; 9' swap='0' >
									<flowline >
										<command class_type='calculation' title='Alpha' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='.PrintString[.ByteCnt * 3 + 0] = 0x37 + (ServoDriveResponse[.ByteCnt] / 0x10) //Hi' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Number' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='.PrintString[.ByteCnt * 3 + 0] = 0x30 + (ServoDriveResponse[.ByteCnt] / 0x10) //Hi' />
										</command>
									</flowline>
								</command>
								<command class_type='decision' title='Split Number/Alpha' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='(ServoDriveResponse[.ByteCnt] &amp; 0x0F) &gt; 9' swap='0' >
									<flowline >
										<command class_type='calculation' title='Alpha' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='.PrintString[.ByteCnt * 3 + 1] = 0x37 + (ServoDriveResponse[.ByteCnt] &amp; 0x0F) //Hi' />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Number' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='.PrintString[.ByteCnt * 3 + 1] = 0x30 + (ServoDriveResponse[.ByteCnt] &amp; 0x0F) //Hi' />
										</command>
									</flowline>
								</command>
								<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='.PrintString[.ByteCnt * 3 + 2] = 0x2E //&apos;,&apos;' />
									<exp exp='.ByteCnt = .ByteCnt + 1' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='.PrintString[.ByteCnt * 3] = 0 //Add string terminator' />
							<exp exp='Message_Line2Text = .PrintString' />
						</command>
						<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Message_Box_Write' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Icons_Redraw' description='Redraws Status icons with labels and colours
' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='IconCount' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Initialise icon count' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='.IconCount = 1' />
						</command>
						<command class_type='loop' title='Loop' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='1' exp='.IconCount = 4' start='0' >
							<flowline >
								<command class_type='switch' title='which icon colour' textarea='36,25,36,25' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='.IconCount' >
									<case >
										<flowline />
									</case>
									<case exp='2' >
										<flowline >
											<command class_type='switch' title='' textarea='36,25,36,25' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='Icon2_Colour' >
												<case >
													<flowline />
												</case>
												<case exp='2' >
													<flowline >
														<command class_type='call' title='Background red' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='SetTrueBackgroundColour' >
															<argument exp='225' />
															<argument exp='0' />
															<argument exp='0' />
														</command>
													</flowline>
												</case>
												<case exp='5' >
													<flowline >
														<command class_type='call' title='Background green' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='SetTrueBackgroundColour' >
															<argument exp='0' />
															<argument exp='225' />
															<argument exp='0' />
														</command>
													</flowline>
												</case>
												<case exp='8' >
													<flowline >
														<command class_type='call' title='Background light grey' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='SetTrueBackgroundColour' >
															<argument exp='225' />
															<argument exp='225' />
															<argument exp='225' />
														</command>
													</flowline>
												</case>
											</command>
										</flowline>
									</case>
									<case exp='3' >
										<flowline >
											<command class_type='switch' title='' textarea='36,25,36,25' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='Icon3_Colour' >
												<case >
													<flowline />
												</case>
												<case exp='2' >
													<flowline >
														<command class_type='call' title='Background red' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='SetTrueBackgroundColour' >
															<argument exp='225' />
															<argument exp='0' />
															<argument exp='0' />
														</command>
													</flowline>
												</case>
												<case exp='5' >
													<flowline >
														<command class_type='call' title='Background green' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='SetTrueBackgroundColour' >
															<argument exp='0' />
															<argument exp='225' />
															<argument exp='0' />
														</command>
													</flowline>
												</case>
												<case exp='8' >
													<flowline >
														<command class_type='call' title='Background light grey' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='SetTrueBackgroundColour' >
															<argument exp='225' />
															<argument exp='225' />
															<argument exp='225' />
														</command>
													</flowline>
												</case>
											</command>
										</flowline>
									</case>
								</command>
								<command class_type='call' title='Draw Icon Box' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='DrawRectangle' >
									<argument exp='IconHorizontalOrigins[.IconCount] + 1' />
									<argument exp='IconVerticalOrigin + 1' />
									<argument exp='IconHorizontalOrigins[.IconCount] + IconHorizontalSize - 1' />
									<argument exp='IconVerticalOrigin + IconVerticalSize - 1' />
									<argument exp='0' />
									<argument exp='0' />
								</command>
								<command class_type='switch' title='which icon text ' textarea='36,25,36,25' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='.IconCount' >
									<case >
										<flowline />
									</case>
									<case exp='1' >
										<flowline >
											<command class_type='call' title='Label Icon 1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='Print' >
												<argument exp='Icon1_Text' />
												<argument exp='IconHorizontalOrigins[.IconCount] + 10' />
												<argument exp='IconTextVertical' />
												<argument exp='Arial_14_Bold' />
												<argument exp='1' />
											</command>
										</flowline>
									</case>
									<case exp='2' >
										<flowline >
											<command class_type='call' title='Label Icon 2' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='Print' >
												<argument exp='Icon2_Text' />
												<argument exp='IconHorizontalOrigins[.IconCount] + 10' />
												<argument exp='IconTextVertical' />
												<argument exp='Arial_14_Bold' />
												<argument exp='false' />
											</command>
										</flowline>
									</case>
									<case exp='3' >
										<flowline >
											<command class_type='call' title='Label Icon 3' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='Print' >
												<argument exp='Icon3_Text' />
												<argument exp='IconHorizontalOrigins[.IconCount] + 10' />
												<argument exp='IconTextVertical' />
												<argument exp='Arial_14_Bold' />
												<argument exp='false' />
											</command>
										</flowline>
									</case>
								</command>
								<command class_type='calculation' title='adjust button count' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='.IconCount = .IconCount + 1' />
								</command>
							</flowline>
						</command>
						<command class_type='call' title='Background light cyan' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='SetTrueBackgroundColour' >
							<argument exp='233' />
							<argument exp='255' />
							<argument exp='255' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Buttons_Create' description='Draws four button outlines with labels
' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='ButtonCount' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Initialise button count' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='.ButtonCount = 1' />
						</command>
						<command class_type='call' title='Foreground black' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='SetTrueForegroundColour' >
							<argument exp='0' />
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Background light grey' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='SetTrueBackgroundColour' >
							<argument exp='225' />
							<argument exp='225' />
							<argument exp='225' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='SetFontScaler' >
							<argument exp='2' />
							<argument exp='2' />
						</command>
						<command class_type='loop' title='Loop' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='1' exp='.ButtonCount = 5' start='0' >
							<flowline >
								<command class_type='call' title='Draw Button Shadow' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='DrawRectangle' >
									<argument exp='ButtonHorizontalOrigins[.ButtonCount] - 3' />
									<argument exp='ButtonVerticalOrigin - 3' />
									<argument exp='ButtonHorizontalOrigins[.ButtonCount] + ButtonHorizontalSize + 3' />
									<argument exp='ButtonVerticalOrigin + ButtonVerticalSize + 3' />
									<argument exp='0' />
									<argument exp='0' />
								</command>
								<command class_type='call' title='Draw Button' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='DrawRectangle' >
									<argument exp='ButtonHorizontalOrigins[.ButtonCount] + 1' />
									<argument exp='ButtonVerticalOrigin + 1' />
									<argument exp='ButtonHorizontalOrigins[.ButtonCount] + ButtonHorizontalSize - 1' />
									<argument exp='ButtonVerticalOrigin + ButtonVerticalSize - 1' />
									<argument exp='0' />
									<argument exp='0' />
								</command>
								<command class_type='switch' title='which button text ' textarea='36,25,36,25' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='.ButtonCount' >
									<case >
										<flowline />
									</case>
									<case exp='1' >
										<flowline >
											<command class_type='call' title='Label Button 1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='Print' >
												<argument exp='Button1_Text' />
												<argument exp='ButtonHorizontalOrigins[.ButtonCount] + 10' />
												<argument exp='ButtonTextVertical' />
												<argument exp='Arial_14_Bold' />
												<argument exp='1' />
											</command>
										</flowline>
									</case>
									<case exp='2' >
										<flowline >
											<command class_type='call' title='Label Button 2' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='Print' >
												<argument exp='Button2_Text' />
												<argument exp='ButtonHorizontalOrigins[.ButtonCount] + 10' />
												<argument exp='ButtonTextVertical' />
												<argument exp='Arial_14_Bold' />
												<argument exp='false' />
											</command>
										</flowline>
									</case>
									<case exp='3' >
										<flowline >
											<command class_type='call' title='Label Button 3' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='Print' >
												<argument exp='Button3_Text' />
												<argument exp='ButtonHorizontalOrigins[.ButtonCount] + 10' />
												<argument exp='ButtonTextVertical' />
												<argument exp='Arial_14_Bold' />
												<argument exp='false' />
											</command>
										</flowline>
									</case>
									<case exp='4' >
										<flowline >
											<command class_type='call' title='Label Button 4' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='Print' >
												<argument exp='Button4_Text' />
												<argument exp='ButtonHorizontalOrigins[.ButtonCount] + 10' />
												<argument exp='ButtonTextVertical' />
												<argument exp='Arial_14_Bold' />
												<argument exp='false' />
											</command>
										</flowline>
									</case>
								</command>
								<command class_type='calculation' title='adjust button count' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='.ButtonCount = .ButtonCount + 1' />
								</command>
							</flowline>
						</command>
						<command class_type='call' title='Background light cyan' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='SetTrueBackgroundColour' >
							<argument exp='233' />
							<argument exp='255' />
							<argument exp='255' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Exp_Write' description='Write a single output in an expansion port.
Port address: 0 = E1/P0-0 to 47 = E3/P1-7, use alias constants
Data: 0, 1

' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Data' type='b1' description='data to write to the Expansion' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='Port' type='u8' description='Port to write to 0 to 47 = E1/P0-0 to E3/P1-7' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='ExpAddress' type='u8' description='Expansion address on I2C' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='BitMask' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Define bit mask' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='.BitMask = .Port &amp; 0b00000111' />
						</command>
						<command class_type='switch' title='Select Bit Mask' textarea='36,25,36,25' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='.BitMask' >
							<case >
								<flowline />
							</case>
							<case exp='0' >
								<flowline >
									<command class_type='calculation' title='Define bit mask' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.BitMask = 0b00000001' />
									</command>
								</flowline>
							</case>
							<case exp='1' >
								<flowline >
									<command class_type='calculation' title='Define bit mask' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.BitMask = 0b00000010' />
									</command>
								</flowline>
							</case>
							<case exp='2' >
								<flowline >
									<command class_type='calculation' title='Define bit mask' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.BitMask = 0b00000100' />
									</command>
								</flowline>
							</case>
							<case exp='3' >
								<flowline >
									<command class_type='calculation' title='Define bit mask' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.BitMask = 0b00001000' />
									</command>
								</flowline>
							</case>
							<case exp='4' >
								<flowline >
									<command class_type='calculation' title='Define bit mask' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.BitMask = 0b00010000' />
									</command>
								</flowline>
							</case>
							<case exp='5' >
								<flowline >
									<command class_type='calculation' title='Define bit mask' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.BitMask = 0b00100000' />
									</command>
								</flowline>
							</case>
							<case exp='6' >
								<flowline >
									<command class_type='calculation' title='Define bit mask' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.BitMask = 0b01000000' />
									</command>
								</flowline>
							</case>
							<case exp='7' >
								<flowline >
									<command class_type='calculation' title='Define bit mask' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.BitMask = 0b10000000' />
									</command>
								</flowline>
							</case>
						</command>
						<command class_type='calculation' title='Define bit mask' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='.Port = .Port / 8' />
						</command>
						<command class_type='switch' title='Select Expansion' textarea='36,25,36,25' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='.Port' >
							<case >
								<flowline />
							</case>
							<case exp='0' >
								<flowline >
									<command class_type='calculation' title='Find Exp address, Exp register and Exp data' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.ExpAddress = EXP1_I2C_ADDR' />
										<exp exp='I2Cdata[0] = EXP_P0_OUT_REG' />
										<exp exp='ExpOutputData[0] = ExpOutputData[0] &amp; ( ~.BitMask)' />
										<exp exp='ExpOutputData[0] = ExpOutputData[0] | (.BitMask * .Data)' />
										<exp exp='I2Cdata[1] = ExpOutputData[0]' />
									</command>
								</flowline>
							</case>
							<case exp='1' >
								<flowline >
									<command class_type='calculation' title='Find Exp address, Exp register and Exp data' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.ExpAddress = EXP1_I2C_ADDR' />
										<exp exp='I2Cdata[0] = EXP_P1_OUT_REG' />
										<exp exp='ExpOutputData[1] = ExpOutputData[1] &amp; ( ~.BitMask)' />
										<exp exp='ExpOutputData[1] = ExpOutputData[1] | (.BitMask * .Data)' />
										<exp exp='I2Cdata[1] = ExpOutputData[1]' />
									</command>
								</flowline>
							</case>
							<case exp='2' >
								<flowline >
									<command class_type='calculation' title='Find Exp address, Exp register and Exp data' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.ExpAddress = EXP2_I2C_ADDR' />
										<exp exp='I2Cdata[0] = EXP_P0_OUT_REG' />
										<exp exp='ExpOutputData[2] = ExpOutputData[2] &amp; ( ~.BitMask)' />
										<exp exp='ExpOutputData[2] = ExpOutputData[2] | (.BitMask * .Data)' />
										<exp exp='I2Cdata[1] = ExpOutputData[2]' />
									</command>
								</flowline>
							</case>
							<case exp='3' >
								<flowline >
									<command class_type='calculation' title='Find Exp address, Exp register and Exp data' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.ExpAddress = EXP2_I2C_ADDR' />
										<exp exp='I2Cdata[0] = EXP_P1_OUT_REG' />
										<exp exp='ExpOutputData[3] = ExpOutputData[3] &amp; ( ~.BitMask)' />
										<exp exp='ExpOutputData[3] = ExpOutputData[3] | (.BitMask * .Data)' />
										<exp exp='I2Cdata[1] = ExpOutputData[3]' />
									</command>
								</flowline>
							</case>
							<case exp='4' >
								<flowline >
									<command class_type='calculation' title='Find Exp address, Exp register and Exp data' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.ExpAddress = EXP3_I2C_ADDR' />
										<exp exp='I2Cdata[0] = EXP_P0_OUT_REG' />
										<exp exp='ExpOutputData[4] = ExpOutputData[4] &amp; ( ~.BitMask)' />
										<exp exp='ExpOutputData[4] = ExpOutputData[4] | (.BitMask * .Data)' />
										<exp exp='I2Cdata[1] = ExpOutputData[4]' />
									</command>
								</flowline>
							</case>
							<case exp='5' >
								<flowline >
									<command class_type='calculation' title='Find Exp address, Exp register and Exp data' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
										<exp exp='.ExpAddress = EXP3_I2C_ADDR' />
										<exp exp='I2Cdata[0] = EXP_P1_OUT_REG' />
										<exp exp='ExpOutputData[5] = ExpOutputData[5] &amp; ( ~.BitMask)' />
										<exp exp='ExpOutputData[5] = ExpOutputData[5] | (.BitMask * .Data)' />
										<exp exp='I2Cdata[1] = ExpOutputData[5]' />
									</command>
								</flowline>
							</case>
						</command>
						<command class_type='call' title='I2C Transaction Initialise' textmode='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Initialise' >
							<argument exp='.ExpAddress' />
						</command>
						<command class_type='call' title='I2C Transaction Write' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Write' >
							<argument exp='I2Cdata' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='I2C_Master1' macro='Transaction_Uninit' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Read_Servo_Msg' description='Receive a message from the servo drive within &apos;Timeout&apos;' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='calculation' title='Clear response' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='//ServoDriveResponse[0] = &apos;\r&apos;' />
							<exp exp='ServoDriveResponse[0] = 0' />
							<exp exp='RxMsgByteCount = 0' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='UART1' macro='ReceiveByteArray' >
							<return exp='RxMsgByteCount' />
							<argument exp='ServoDriveResponse' />
							<argument exp='100' />
							<argument exp='10' />
						</command>
						<command class_type='call' title='Clear byte count display for test' disable='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='Print' >
							<argument exp='&quot;          &quot;' />
							<argument exp='70' />
							<argument exp='180' />
							<argument exp='Arial_14_Bold' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Display byte count for test' disable='1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='PrintNumber' >
							<argument exp='RxMsgByteCount' />
							<argument exp='70' />
							<argument exp='180' />
							<argument exp='Arial_14_Bold' />
							<argument exp='1' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Message_Box_Write' description='Write new messages to Message Box.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<local name='ButtonCount' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='call' title='Background light grey' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='SetTrueBackgroundColour' >
							<argument exp='225' />
							<argument exp='225' />
							<argument exp='225' />
						</command>
						<command class_type='call' title='Draw Msg Box' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='DrawRectangle' >
							<argument exp='MessageHorizontalOrigin + 1' />
							<argument exp='MessageBoxVerticalOrigin + 1' />
							<argument exp='MessageHorizontalOrigin + MessageBoxHorizontalSize - 1' />
							<argument exp='MessageBoxVerticalOrigin + MessageBoxVerticalSize - 1' />
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Message Line 1' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='Print' >
							<argument exp='Message_Line1Text' />
							<argument exp='MessageLinesHorizontal' />
							<argument exp='MessageLine1Vertical' />
							<argument exp='Arial_14_Bold' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Message Line 2' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='GLCD_RPI1' macro='Print' >
							<argument exp='Message_Line2Text' />
							<argument exp='MessageLinesHorizontal' />
							<argument exp='MessageLine2Vertical' />
							<argument exp='Arial_14_Bold' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Background light cyan' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='SetTrueBackgroundColour' >
							<argument exp='233' />
							<argument exp='255' />
							<argument exp='255' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='RPi_Servo_Drive_V1.0_06.01.2026

Modified to linear drive with active limit  switches
' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='calculation' title='Set displayed version' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
							<exp exp='Message_Line1Text = &quot;Agri Samplers Servo Drive&quot;' />
							<exp exp='Message_Line2Text = &quot;V1.0 06.01.2026&quot;' />
						</command>
						<command class_type='call' title='Display init' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Display_Initialise' />
						<command class_type='call' title='Initialise UART for Servo Drive' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' component='UART1' macro='Initialise' />
						<command class_type='call' title='Initialise Expansion Ports' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Exp_Initialise' />
						<command class_type='call' title='Initialise Servo Control and limit positions' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Servo_Initialise' >
							<return exp='ServoStatus' />
						</command>
						<command class_type='loop' title='Main Function Loop' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='0' exp='1' >
							<flowline >
								<command class_type='decision' title='Check Servo Status' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ServoStatus == 0' swap='1' >
									<flowline >
										<command class_type='comment' title='' comment='Status Code not 0
Disable Motor (MD)
Requires power cycle to clear.' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
										<command class_type='calculation' title='Servo Drive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='ServoDriveCommand[1] = &apos;S&apos; //Motor Stop' />
											<exp exp='ServoDriveCommand[2] = &apos;T&apos;' />
											<exp exp='TxMsgByteCount = 2' />
										</command>
										<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
										<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
										<command class_type='calculation' title='Servo Drive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='ServoDriveCommand[1] = &apos;M&apos; //Motor Disable' />
											<exp exp='ServoDriveCommand[2] = &apos;D&apos;' />
											<exp exp='TxMsgByteCount = 2' />
										</command>
										<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
										<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
										<command class_type='call' title='Air On' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Exp_Write' >
											<argument exp='0' />
											<argument exp='SOLENOID1' />
										</command>
										<command class_type='calculation' title='Icons' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='Icon1_Text = &quot;&quot;' />
											<exp exp='Icon2_Text = &quot;AIR OFF&quot;' />
											<exp exp='Icon2_Colour = 2 //Red' />
											<exp exp='Icon3_Text = &quot;MOTOR OFF&quot;' />
											<exp exp='Icon3_Colour = 2 //Red' />
										</command>
										<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Icons_Redraw' />
										<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='Message_Line1Text = &quot;Servo has stopped with code:&quot;' />
											<exp exp='Message_Line2Text = ToString$(ServoStatus)' />
											<exp exp='' />
											<exp exp='' />
										</command>
										<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Message_Box_Write' />
										<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='Button1_Text = &quot;&quot;' />
											<exp exp='Button2_Text = &quot;&quot;' />
											<exp exp='Button3_Text = &quot;&quot;' />
											<exp exp='Button4_Text = &quot;&quot;' />
											<exp exp='ButtonPressed = 0' />
											<exp exp='ButtonUpdate = true' />
										</command>
										<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Button_Redraw' />
										<command class_type='loop' title='Never ending loop' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='0' exp='1' >
											<flowline />
										</command>
									</flowline>
									<flowline >
										<command class_type='calculation' title='Icons' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
											<exp exp='Icon1_Text = ToString$(ServoCcwSpeed) //Converts speed to string to display' />
											<exp exp='Count = Length$(Icon1_Text)' />
											<exp exp='LeftString = Left$(Icon1_Text,(Count - 2)) //Units of speed' />
											<exp exp='RightString = Right$(Icon1_Text,2) //Fractions of speed' />
											<exp exp='Icon1_Text = LeftString + &quot;.&quot; + RightString + &quot; RPS&quot; //Reformat speed with decimal point' />
											<exp exp='Icon3_Text = &quot;HOME&quot;' />
											<exp exp='Icon3_Colour = 5 //Green' />
										</command>
										<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Icons_Redraw' />
									</flowline>
								</command>
								<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='Message_Line1Text = &quot;Ready for operation&quot;' />
									<exp exp='Message_Line2Text = &quot;Select function button&quot;' />
									<exp exp='' />
									<exp exp='' />
								</command>
								<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Message_Box_Write' />
								<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
									<exp exp='Button1_Text = &quot;RUN&quot;' />
									<exp exp='Button2_Text = &quot;SPEED&quot;' />
									<exp exp='Button3_Text = &quot;PURGE&quot;' />
									<exp exp='Button4_Text = &quot;SERVICE&quot;' />
									<exp exp='ButtonUpdate = true' />
								</command>
								<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Button_Redraw' />
								<command class_type='loop' title='Wait for button press' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='0' exp='ButtonPressed = BUTTON_NONE' start='0' >
									<flowline >
										<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Button_Scan' />
									</flowline>
								</command>
								<command class_type='switch' title='Switch' textarea='36,25,36,25' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ButtonPressed' >
									<case >
										<flowline />
									</case>
									<case exp='BUTTON_1' >
										<flowline >
											<command class_type='comment' title='' comment='Perform RUN
Air On, delay, then Feed CCW, Feed CW repeatedly until STOP' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
											<command class_type='calculation' title='Reset ServoStatus' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
												<exp exp='ServoStatus = 255' />
											</command>
											<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
												<exp exp='Message_Line1Text = &quot;Performing Run&quot;' />
												<exp exp='Message_Line2Text = &quot;Press STOP to abort&quot;' />
											</command>
											<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Message_Box_Write' />
											<command class_type='calculation' title='Icons' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
												<exp exp='Icon2_Text = &quot;AIR ON&quot;' />
												<exp exp='Icon2_Colour = 5 //Green' />
												<exp exp='Icon3_Text = &quot;RUN&quot;' />
												<exp exp='Icon3_Colour = 5 //Green' />
											</command>
											<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Icons_Redraw' />
											<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
												<exp exp='Button1_Text = &quot;&quot;' />
												<exp exp='Button2_Text = &quot;&quot;' />
												<exp exp='Button3_Text = &quot;&quot;' />
												<exp exp='Button4_Text = &quot;STOP&quot;' />
												<exp exp='ButtonPressed = 0' />
												<exp exp='ButtonUpdate = true' />
											</command>
											<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Button_Redraw' />
											<command class_type='call' title='Air On' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Exp_Write' >
												<argument exp='1' />
												<argument exp='SOLENOID1' />
											</command>
											<command class_type='comment' title='' comment='Set servo speed to ServoCcwSpeed
Using same speed for CCW and CW' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
											<command class_type='calculation' title='ServoDrive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
												<exp exp='//Create &apos;@VEnnn.nn&apos; velocity message from ServoCcwSpeed' />
												<exp exp='AnyString = &quot;0000&quot; + ToString$(ServoCcwSpeed) //Converts speed to string to display' />
												<exp exp='Count = Length$(AnyString)' />
												<exp exp='LeftString = Mid$(AnyString,(Count - 5),3) //Units of speed' />
												<exp exp='RightString = Right$(AnyString,2) //Fractions of speed' />
												<exp exp='ServoDriveCommand = &quot;@VE&quot; + LeftString + &quot;.&quot; + RightString //Reformat speed with decimal point' />
												<exp exp='TxMsgByteCount = 8' />
												<exp exp='' />
											</command>
											<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
											<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
											<command class_type='loop' title='Run Loop' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='0' exp='1' >
												<flowline >
													<command class_type='comment' title='' comment='Perform CCW movement' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
													<command class_type='calculation' title='ServoDrive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
														<exp exp='ServoDriveCommand[1] = &apos;D&apos; //Distance/Position' />
														<exp exp='ServoDriveCommand[2] = &apos;I&apos;' />
														<exp exp='//Need to add encoder counts and msg size using &apos;Long_To_ServoMsg&apos;' />
													</command>
													<command class_type='call' title='Add position to servo message' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='ULong_To_ServoMsg' >
														<argument exp='ServoCcwEndPosition' />
													</command>
													<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
													<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
													<command class_type='calculation' title='Servo Drive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
														<exp exp='ServoDriveCommand[1] = &apos;F&apos; //Feed to Position' />
														<exp exp='ServoDriveCommand[2] = &apos;P&apos;' />
														<exp exp='TxMsgByteCount = 2' />
													</command>
													<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
													<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
													<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Button_Scan' />
													<command class_type='decision' title='Check STOP button' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ButtonPressed == BUTTON_4' swap='0' >
														<flowline >
															<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Button_Redraw' />
															<command class_type='goto' title='Goto Connection Point' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' labelid='1' labelname='' />
														</flowline>
														<flowline />
													</command>
													<command class_type='loop' title='Loop until motor in position' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='1' exp='ServoDriveResponse[1] == &apos;S&apos; &amp;&amp; ServoDriveResponse[2] == &apos;C&apos; &amp;&amp; ServoDriveResponse[7] == &apos;9&apos;' start='0' >
														<flowline >
															<command class_type='calculation' title='Servo Drive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
																<exp exp='//Status Code' />
																<exp exp='ServoDriveCommand[1] = &apos;S&apos;' />
																<exp exp='ServoDriveCommand[2] = &apos;C&apos;' />
																<exp exp='TxMsgByteCount = 2' />
															</command>
															<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
															<command class_type='call' title='Check for response' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
														</flowline>
													</command>
													<command class_type='comment' title='' comment='Perform CW movement' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
													<command class_type='calculation' title='ServoDrive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
														<exp exp='ServoDriveCommand[1] = &apos;D&apos; //Distance/Position' />
														<exp exp='ServoDriveCommand[2] = &apos;I&apos;' />
														<exp exp='//Need to add encoder counts and msg size using &apos;Long_To_ServoMsg&apos;' />
													</command>
													<command class_type='call' title='Add position to servo message' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='ULong_To_ServoMsg' >
														<argument exp='ServoCwEndPosition' />
													</command>
													<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
													<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
													<command class_type='calculation' title='Servo Drive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
														<exp exp='ServoDriveCommand[1] = &apos;F&apos; //Feed to Position' />
														<exp exp='ServoDriveCommand[2] = &apos;P&apos;' />
														<exp exp='TxMsgByteCount = 2' />
													</command>
													<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
													<command class_type='call' title='Check for ACK' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
													<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Button_Scan' />
													<command class_type='decision' title='Check STOP button' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ButtonPressed == BUTTON_4' swap='0' >
														<flowline >
															<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Button_Redraw' />
															<command class_type='goto' title='Goto Connection Point' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' labelid='1' labelname='' />
														</flowline>
														<flowline />
													</command>
													<command class_type='loop' title='Loop until motor in position' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='1' exp='ServoDriveResponse[1] == &apos;S&apos; &amp;&amp; ServoDriveResponse[2] == &apos;C&apos; &amp;&amp; ServoDriveResponse[7] == &apos;9&apos;' start='0' >
														<flowline >
															<command class_type='calculation' title='Servo Drive Command' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
																<exp exp='//Status Code' />
																<exp exp='ServoDriveCommand[1] = &apos;S&apos;' />
																<exp exp='ServoDriveCommand[2] = &apos;C&apos;' />
																<exp exp='TxMsgByteCount = 2' />
															</command>
															<command class_type='call' title='Send command to servo' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Send_Servo_Msg' />
															<command class_type='call' title='Check for response' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Read_Servo_Msg' />
														</flowline>
													</command>
												</flowline>
											</command>
											<command class_type='label' title='Stop Connection Point' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' labelid='1' labelname='Stop' />
											<command class_type='call' title='Air Off' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Exp_Write' >
												<argument exp='0' />
												<argument exp='SOLENOID1' />
											</command>
											<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
												<exp exp='Message_Line2Text = &quot;User pressed STOP&quot;' />
												<exp exp='ServoStatus = 10 //Show user pressed STOP' />
											</command>
											<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Message_Box_Write' />
											<command class_type='comment' title='' comment='Perform return movement' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
											<command class_type='calculation' title='Icons' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
												<exp exp='Icon1_Text = ToString$(ServoCcwSpeed) //Converts speed to string to display' />
												<exp exp='Count = Length$(Icon1_Text)' />
												<exp exp='LeftString = Left$(Icon1_Text,(Count - 2)) //Units of speed' />
												<exp exp='RightString = Right$(Icon1_Text,2) //Fractions of speed' />
												<exp exp='Icon1_Text = LeftString + &quot;.&quot; + RightString + &quot; RPS&quot; //Reformat speed with decimal point' />
												<exp exp='Icon2_Text = &quot;AIR OFF&quot;' />
												<exp exp='Icon2_Colour = 2 //Red' />
												<exp exp='Icon3_Text = &quot;RETURN&quot;' />
												<exp exp='Icon3_Colour = 5 //Green' />
											</command>
											<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Icons_Redraw' />
										</flowline>
									</case>
									<case exp='BUTTON_2' >
										<flowline >
											<command class_type='comment' title='' comment='Set SPEED function' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
											<command class_type='calculation' title='Message Box Text' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
												<exp exp='Message_Line1Text = &quot;Set Motor Speed&quot;' />
												<exp exp='Message_Line2Text = &quot;Use PLUS or Minus then OK&quot;' />
											</command>
											<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Message_Box_Write' />
											<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
												<exp exp='Button1_Text = &quot;PLUS&quot;' />
												<exp exp='Button2_Text = &quot;MINUS&quot;' />
												<exp exp='Button3_Text = &quot;OK&quot;' />
												<exp exp='Button4_Text = &quot;CANCEL&quot;' />
												<exp exp='ButtonUpdate = true' />
											</command>
											<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Button_Redraw' />
											<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
												<exp exp='//Temporary store for new speed until OK&apos;d' />
												<exp exp='TemporarySpeed = ServoCcwSpeed' />
											</command>
											<command class_type='loop' title='Wait for Speed button release' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='1' exp='ButtonPressed = BUTTON_NONE' >
												<flowline >
													<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Button_Scan' />
												</flowline>
											</command>
											<command class_type='loop' title='Wait for Cancel' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' type='1' exp='ButtonPressed == BUTTON_4' start='0' >
												<flowline >
													<command class_type='calculation' title='Icons' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
														<exp exp='//Update speed display' />
														<exp exp='Icon1_Text = ToString$(TemporarySpeed) //Converts speed to string to display' />
														<exp exp='Count = Length$(Icon1_Text)' />
														<exp exp='LeftString = Left$(Icon1_Text,(Count - 2)) //Units of speed' />
														<exp exp='RightString = Right$(Icon1_Text,2) //Fractions of speed' />
														<exp exp='Icon1_Text = LeftString + &quot;.&quot; + RightString + &quot; RPS&quot; //Reformat speed with decimal point' />
														<exp exp='' />
													</command>
													<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Icons_Redraw' />
													<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Button_Redraw' />
													<command class_type='call' title='User Macro' cmdcolor='15443959' cmdcolor_sec='8864659' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' macro='Button_Scan' />
													<command class_type='switch' title='Switch' textarea='36,25,36,25' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ButtonPressed' >
														<case >
															<flowline >
																<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
																	<exp exp='//Reset Button Jump value' />
																	<exp exp='ButtonJump = 1' />
																	<exp exp='ButtonJumpCount = 0' />
																</command>
															</flowline>
														</case>
														<case exp='BUTTON_1' >
															<flowline >
																<command class_type='comment' title='' comment='PLUS' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
																<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
																	<exp exp='//Update speed display' />
																	<exp exp='TemporarySpeed = TemporarySpeed + ButtonJump' />
																	<exp exp='ButtonJumpCount = ButtonJumpCount + ButtonJump' />
																</command>
																<command class_type='decision' title='Check maximum speed' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='TemporarySpeed &gt; 10000' swap='0' >
																	<flowline >
																		<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
																			<exp exp='//Limit speed to max' />
																			<exp exp='TemporarySpeed = 10000' />
																		</command>
																	</flowline>
																	<flowline />
																</command>
																<command class_type='delay' title='Delay' cmdcolor='14697803' cmdcolor_sec='16755119' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ButtonDelay' type='1' />
															</flowline>
														</case>
														<case exp='BUTTON_2' >
															<flowline >
																<command class_type='comment' title='' comment='MINUS' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
																<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
																	<exp exp='//Update speed' />
																	<exp exp='TemporarySpeed = TemporarySpeed - ButtonJump' />
																	<exp exp='ButtonJumpCount = ButtonJumpCount + ButtonJump' />
																</command>
																<command class_type='decision' title='Check minimum speed' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='TemporarySpeed &lt; 100 || TemporarySpeed &gt; 10000' swap='0' >
																	<flowline >
																		<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
																			<exp exp='//Limit speed to min 1.00 RPS' />
																			<exp exp='TemporarySpeed = 100' />
																		</command>
																	</flowline>
																	<flowline />
																</command>
																<command class_type='delay' title='Delay' cmdcolor='14697803' cmdcolor_sec='16755119' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ButtonDelay' type='1' />
															</flowline>
														</case>
														<case exp='BUTTON_3' >
															<flowline >
																<command class_type='comment' title='' comment='OK' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
																<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
																	<exp exp='//Save speed' />
																	<exp exp='ServoCcwSpeed = TemporarySpeed' />
																</command>
																<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
																	<exp exp='//Force exit' />
																	<exp exp='ButtonPressed = BUTTON_4' />
																	<exp exp='' />
																</command>
															</flowline>
														</case>
														<case exp='BUTTON_4' >
															<flowline >
																<command class_type='comment' title='' comment='CANCEL' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
															</flowline>
														</case>
													</command>
													<command class_type='decision' title='Decision' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ButtonJumpCount &gt; 10' swap='0' >
														<flowline >
															<command class_type='decision' title='Decision' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' exp='ButtonJumpCount &gt; 100' swap='0' >
																<flowline >
																	<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
																		<exp exp='//Update Button Jump' />
																		<exp exp='ButtonJump = 100' />
																		<exp exp='' />
																	</command>
																	<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
																		<exp exp='//Change speed to xx.00' />
																		<exp exp='TemporarySpeed = TemporarySpeed - (TemporarySpeed % 100)' />
																	</command>
																</flowline>
																<flowline >
																	<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
																		<exp exp='//Update Button Jump' />
																		<exp exp='ButtonJump = 10' />
																		<exp exp='' />
																	</command>
																	<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
																		<exp exp='//Change speed to xx.x0' />
																		<exp exp='TemporarySpeed = TemporarySpeed - (TemporarySpeed % 10)' />
																	</command>
																</flowline>
															</command>
															<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
																<exp exp='//Update Button Delay' />
																<exp exp='ButtonDelay = 100' />
																<exp exp='' />
															</command>
														</flowline>
														<flowline >
															<command class_type='calculation' title='Calculation' cmdcolor='8124159' cmdcolor_sec='1544914' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' >
																<exp exp='//Update Button Delay' />
																<exp exp='ButtonDelay = 500' />
																<exp exp='' />
															</command>
														</flowline>
													</command>
												</flowline>
											</command>
										</flowline>
									</case>
									<case exp='BUTTON_3' >
										<flowline >
											<command class_type='comment' title='' comment='Perform PURGE' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
										</flowline>
									</case>
									<case exp='BUTTON_4' >
										<flowline >
											<command class_type='comment' title='' comment='Move to SERVICE position' textarea='12,0,12,0' cmdcolor='11370621' cmdcolor_sec='11370621' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' />
										</flowline>
									</case>
								</command>
								<command class_type='label' title='Error entry point' cmdcolor='16777119' cmdcolor_sec='16494651' cmdcolor_txt='8355711' cmdgradient='1' cmdopacity='1' labelid='0' labelname='Error' />
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='24219805-113d-4b12-b6bd-e1b0b0c33981' vmin='4' vmaj='1' codename='I2C_Master1' panelId='-1' x='-8.452' y='-284' z='0' xsz='25.1778' ysz='25.1392' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='cal_i2c::CHANNEL' data='001' />
					<value target='cal_i2c::BAUD_LIST' data='002' />
					<value target='cal_i2c::BAUD' data='400000' />
					<value target='cal_i2c::StopDel' data='0' />
					<value target='cal_i2c::SRC' data='000' />
					<value target='cal_i2c::SMB' data='000' />
					<value target='cal_i2c::ClockStretching' data='0' />
					<value target='cal_i2c::SDA' data='$PORTG.2' />
					<value target='cal_i2c::SDAPins' data='002' />
					<value target='cal_i2c::SCL' data='$PORTG.3' />
					<value target='cal_i2c::SCLPins' data='010' />
					<value target='label' data='I2C Master' />
					<value target='cal_i2c::ScopeTraces' data='0' />
					<value target='cal_i2c::ConsoleData' data='1' />
					<value target='cal_i2c::Injector' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='7c3895d3-0359-4b4c-8fa4-ab6314cd5fbf' vmin='4' vmaj='1' codename='GLCD_RPI1' panelId='-1' x='-278.244' y='189.201' z='0' xsz='12.4193' ysz='45.0721' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='pixel_width' data='800' />
					<value target='pixel_height' data='480' />
					<value target='monochrome' data='' />
					<value target='foreground_colour' data='0' />
					<value target='background_colour' data='16777193' />
					<value target='colour_bit_depth' data='16' />
					<value target='red_bit_depth' data='5' />
					<value target='green_bit_depth' data='6' />
					<value target='blue_bit_depth' data='5' />
					<value target='FGCOL' data='4278190080' />
					<value target='BGCOL' data='4278251519' />
					<value target='Base_GLCD::FontCount' data='002' />
					<value target='Base_GLCD::gLCD_Font1::Font' data='002' />
					<value target='Base_GLCD::gLCD_Font1::CustomFontFile' data='' />
					<value target='Base_GLCD::gLCD_Font1::BytesRequired' data='1317' />
					<value target='Base_GLCD::gLCD_Font1::FontSpace' data='001' />
					<value target='Base_GLCD::gLCD_Font1::SpaceWidth' data='008' />
					<value target='Base_GLCD::gLCD_Font2::Font' data='005' />
					<value target='Base_GLCD::gLCD_Font2::CustomFontFile' data='' />
					<value target='Base_GLCD::gLCD_Font2::BytesRequired' data='967' />
					<value target='Base_GLCD::gLCD_Font2::FontSpace' data='001' />
					<value target='Base_GLCD::gLCD_Font2::SpaceWidth' data='002' />
					<value target='Base_GLCD::gLCD_Font3::Font' data='002' />
					<value target='Base_GLCD::gLCD_Font3::CustomFontFile' data='' />
					<value target='Base_GLCD::gLCD_Font3::BytesRequired' data='' />
					<value target='Base_GLCD::gLCD_Font3::FontSpace' data='001' />
					<value target='Base_GLCD::gLCD_Font3::SpaceWidth' data='004' />
					<value target='Base_GLCD::gLCD_Font4::Font' data='015' />
					<value target='Base_GLCD::gLCD_Font4::CustomFontFile' data='' />
					<value target='Base_GLCD::gLCD_Font4::BytesRequired' data='' />
					<value target='Base_GLCD::gLCD_Font4::FontSpace' data='001' />
					<value target='Base_GLCD::gLCD_Font4::SpaceWidth' data='004' />
					<value target='DisplayMethod' data='000' />
					<value target='Base_GLCD::PhysicalOrientation' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='900b40e1-a72c-445c-9ec4-eff95cd6c377' vmin='7' vmaj='2' codename='File_RPI1' panelId='-1' x='-374.766' y='575.869' z='0' xsz='25.1778' ysz='25.1392' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='RootFolder' data='/home/autotrap/' />
					<value target='FileCount' data='1' />
					<value target='SimRootFolder' data='$(srcdir)' />
					<value target='IsSim' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c73616d1-7ad0-45d9-aada-69ccfa4c5efc' vmin='0' vmaj='3' codename='UART1' panelId='-1' x='-420' y='940' z='0' xsz='25' ysz='25' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='1' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='cal_uart::CHANNEL' data='001' />
					<value target='cal_uart::BAUD_LIST' data='004' />
					<value target='cal_uart::BAUD' data='9600' />
					<value target='cal_uart::DBITS' data='008' />
					<value target='cal_uart::RETURN' data='001' />
					<value target='cal_uart::ECHO' data='000' />
					<value target='cal_uart::UseTX' data='1' />
					<value target='cal_uart::TX' data='$PORTG.14' />
					<value target='cal_uart::OutputPins' data='000' />
					<value target='cal_uart::TXAlt' data='0' />
					<value target='cal_uart::UseRX' data='1' />
					<value target='cal_uart::RX' data='$PORTG.15' />
					<value target='cal_uart::InputPins' data='001' />
					<value target='cal_uart::RXAlt' data='0' />
					<value target='cal_uart::FLOWEN' data='000' />
					<value target='cal_uart::RTS' data='$PORTB.2' />
					<value target='cal_uart::CTS' data='$PORTB.1' />
					<value target='label' data='UART' />
					<value target='cal_uart::ScopeTraces' data='0' />
					<value target='cal_uart::ConsoleData' data='1' />
					<value target='cal_uart::ConsoleFormat' data='000' />
					<value target='cal_uart::ConsoleColumns' data='64' />
					<value target='cal_uart::DataSource' data='000' />
					<value target='cal_uart::com_port' data='000' />
					<value target='cal_uart::Injector' data='000' />
					<value target='cal_uart::APIUseDDR' data='' />
					<value target='cal_uart::APIDDRPin' data='' />
					<value target='cal_uart::APIDDRRXState' data='' />
					<value target='cal_uart::APIUseFC' data='' />
					<value target='cal_uart::APICTSPin' data='' />
					<value target='cal_uart::APIRTSPin' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='f137a538-3ebf-42e7-a941-b8f628802070' vmin='0' vmaj='1' codename='Timeout' panelId='-1' x='-410' y='750' z='0' xsz='25' ysz='25' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='TimePeriodUnits' data='000' />
					<value target='TimePeriodValue' data='5' />
					<value target='TimePeriodCount' data='5' />
					<value target='CallMacro' data='0' />
					<value target='Macro' data='' />
					<value target='AutoReset' data='1' />
					<value target='StartRanAtAll' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='7292207' img='' style='0' />
		<camera xe='-214.122' ye='445.018' ze='727.732' xt='-214.122' yt='445.018' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<viewport dx='362' dy='801' zoom='60.1897' fix_topleft='0' />
		<page x='1000' y='1000' show='0' rgb='7360576' />
		<winpos ID='7005' RectRecentFloat='191,80,1455,973' RectRecentDocked='1538,141,1920,1032' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='1' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='1' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='0' />
		<camera xe='-160.091' ye='79.2932' ze='183.78' xt='-160.091' yt='79.2932' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey0 xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey1 xe='-3.67394e-14' ye='0' ze='-300' xt='0' yt='0' zt='0' xquat='0' yquat='1' zquat='0' wquat='6.12323e-17' />
		<camerakey2 xe='0' ye='-300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.707107' yquat='0' zquat='0' wquat='0.707107' />
		<camerakey3 xe='-3.67394e-14' ye='300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-4.32978e-17' yquat='0.707107' zquat='0.707107' wquat='4.32978e-17' />
		<camerakey4 xe='-300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='0.5' zquat='0.5' wquat='0.5' />
		<camerakey5 xe='300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='-0.5' zquat='-0.5' wquat='0.5' />
		<camerakey6 xe='-173.205' ye='-173.205' ze='173.205' xt='0' yt='0' zt='0' xquat='-0.424708' yquat='0.17592' zquat='0.339851' wquat='0.820473' />
		<winpos ID='7004' RectRecentFloat='378,0,1163,922' RectRecentDocked='0,0,210,1013' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='0' />
	</panel3d>
	<panels2d count='0' />
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATwQAAHYDAAA' zoom='100' scrollx='0' scrolly='61' flags='0' />
		<view type='0' name='Servo_Initialise' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATwQAAHYDAAA' zoom='100' scrollx='0' scrolly='14272' flags='0' />
		<view type='0' name='Exp_Read' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATwQAAHYDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Exp_Initialise' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATwQAAHYDAAA' zoom='100' scrollx='0' scrolly='1584' flags='0' />
		<view type='0' name='Exp_Write' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATwQAAHYDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Buttons_Create' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATwQAAHYDAAA' zoom='100' scrollx='1860' scrolly='191' flags='0' />
		<view type='0' name='Display_Initialise' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATwQAAHYDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Button_Redraw' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATwQAAHYDAAA' zoom='100' scrollx='0' scrolly='367' flags='0' />
		<view type='0' name='Button_Scan' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATwQAAHYDAAA' zoom='100' scrollx='0' scrolly='926' flags='0' />
		<view type='0' name='Send_Servo_Msg' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATwQAAHYDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Read_Servo_Msg' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATwQAAHYDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Icons_Create' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATwQAAHYDAAA' zoom='100' scrollx='0' scrolly='494' flags='0' />
		<view type='0' name='Icons_Redraw' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATwQAAHYDAAA' zoom='100' scrollx='0' scrolly='33' flags='0' />
		<view type='0' name='ULong_To_ServoMsg' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATwQAAHYDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='SP_To_ULong' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATwQAAHYDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Message_Box_Write' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATwQAAHYDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='NVS_Read' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATwQAAHYDAAA' zoom='100' scrollx='0' scrolly='998' flags='0' />
		<view type='0' name='Display_Full_Msg' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATwQAAHYDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='NVS_Write' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATwQAAHYDAAA' zoom='100' scrollx='0' scrolly='25' flags='0' />
		<view type='0' name='SetTrueForegroundColour' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATwQAAHYDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Position_To_Message' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAATwQAAHYDAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
