<root>
<document scada='0' schema='102' license='1,DAVIDJOINER,58DBQD' title='' description='' fcversion='524800' target='ARD.ATMEGA.Arduino Mega 2560 R3' >
	<config data='' clkspd='16000000' simspd='1' usewdt='0' constif='0' commport='27' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='1' head='typedef union
{
  MX_FLOAT AsFloat;
  MX_UINT32 AsLong;
  MX_UINT16 AsInt[2];
  MX_UINT8  AsByte[4];
} MX_Union_32;

MX_Union_32 convert;

//ADC Channel Definitions to unlock these pins via 1 component
#define MX_ADC_CHANNEL_1
#define MX_ADC_CHANNEL_2
#define MX_ADC_CHANNEL_3
#define MX_ADC_CHANNEL_4
#define MX_ADC_CHANNEL_5' 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='7' />
			<data name='ClockPin' value='6' />
			<data name='DataPort' value='7' />
			<data name='DataPin' value='5' />
			<data name='UseDefaultPins' value='1' />
			<data name='WrapEnabled' value='1' />
			<data name='CommsDelayOverridden' value='0' />
			<data name='CommsDelay' value='11' />
			<data name='CalculatedCommsDelay' value='11' />
			<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='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='cc0c6f87-a58f-4d73-8a8f-a717445ec8e9' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='1' scadaCompatible='0' embeddedCompatible='1' iconpath='' />
		<component class_type='root' codename='panel' 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='0' poslock='0' >
			<resources />
			<properties >
				<property name='Use TX' target='UART1::cal_uart::UseTX' typeid='7' hidden='0' locked='0' info='Selects if the Transmit pin is used by the component. 
Yes: The TX pin is active and used to transmit data for the UART.
No: The TX pin is disabled and free to be used as general I/O.' />
				<property name='TX' target='UART1::cal_uart::TX' typeid='5' hidden='0' locked='1' info='Pin to be used for Transmit data' />
			</properties>
			<values >
				<value target='UART1::cal_uart::UseTX' data='1' />
				<value target='UART1::cal_uart::TX' data='$PORTE.1' />
			</values>
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='Mode' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ReturnCount' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='false' type='b1' description='' isconst='1' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Command' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ParamCount' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Returns' type='u8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='2' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ReturnIdx' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ParamIdx' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Params' type='u8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='3' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='MatchCommand' description='Looks for a matching command code and assigns parameter and return counters.
If no parameters or returns are required then the command is performed' >
						<return name='Return' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='CommandCode' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Default settings' cmdcolor='16760919' cmdcolor_sec='16760832' >
							<exp exp='ParamCount = 0' />
							<exp exp='ParamIdx = 0' />
							<exp exp='ReturnCount = 0' />
							<exp exp='ReturnIdx = 0' />
							<exp exp='Command = .CommandCode' />
						</command>
						<command class_type='switch' title='IO Commands' textarea='36,25,36,25' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Command' >
							<case >
								<flowline />
							</case>
							<case exp='0x80' >
								<flowline >
									<command class_type='comment' title='' comment='Set Output' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='calculation' title='Number of param bytes' cmdcolor='16760919' cmdcolor_sec='16760832' >
										<exp exp='ParamCount = 2' />
									</command>
								</flowline>
							</case>
							<case exp='0x81' >
								<flowline >
									<command class_type='comment' title='' comment='Get Input' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='calculation' title='Number of param bytes' cmdcolor='16760919' cmdcolor_sec='16760832' >
										<exp exp='ParamCount = 1' />
									</command>
									<command class_type='calculation' title='Number of return bytes' cmdcolor='16760919' cmdcolor_sec='16760832' >
										<exp exp='ReturnCount = 1' />
									</command>
								</flowline>
							</case>
						</command>
						<command class_type='switch' title='Analog Commands' textarea='36,25,36,25' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Command' >
							<case >
								<flowline />
							</case>
							<case exp='0x82' >
								<flowline >
									<command class_type='comment' title='' comment='ADC 8' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='calculation' title='Number of param bytes' cmdcolor='16760919' cmdcolor_sec='16760832' >
										<exp exp='ParamCount = 1' />
									</command>
									<command class_type='calculation' title='Number of return bytes' cmdcolor='16760919' cmdcolor_sec='16760832' >
										<exp exp='ReturnCount = 1' />
									</command>
								</flowline>
							</case>
							<case exp='0x83' >
								<flowline >
									<command class_type='comment' title='' comment='ADC 10' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='calculation' title='Number of param bytes' cmdcolor='16760919' cmdcolor_sec='16760832' >
										<exp exp='ParamCount = 1' />
									</command>
									<command class_type='calculation' title='Number of return bytes' cmdcolor='16760919' cmdcolor_sec='16760832' >
										<exp exp='ReturnCount = 2' />
									</command>
								</flowline>
							</case>
						</command>
						<command class_type='switch' title='SPI Commands' textarea='36,25,36,25' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Command' >
							<case >
								<flowline />
							</case>
							<case exp='0x84' >
								<flowline >
									<command class_type='comment' title='' comment='SPI Init' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='cal_spi1' macro='Master_Init' />
								</flowline>
							</case>
							<case exp='0x85' >
								<flowline >
									<command class_type='comment' title='' comment='SPI Transfer' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='calculation' title='Number of param bytes' cmdcolor='16760919' cmdcolor_sec='16760832' >
										<exp exp='ParamCount = 1' />
									</command>
									<command class_type='calculation' title='Number of return bytes' cmdcolor='16760919' cmdcolor_sec='16760832' >
										<exp exp='ReturnCount = 1' />
									</command>
								</flowline>
							</case>
							<case exp='0x86' >
								<flowline >
									<command class_type='comment' title='' comment='SPI Set Prescaler' textarea='40,0,40,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='calculation' title='Number of param bytes' textarea='40,0,40,0' cmdcolor='16760919' cmdcolor_sec='16760832' >
										<exp exp='ParamCount = 1' />
									</command>
								</flowline>
							</case>
						</command>
						<command class_type='switch' title='I2C Commands' textarea='36,25,36,25' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Command' >
							<case >
								<flowline />
							</case>
							<case exp='0x87' >
								<flowline >
									<command class_type='comment' title='' comment='I2C Init' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='I2C_Master1' macro='Initialise' />
								</flowline>
							</case>
							<case exp='0x88' >
								<flowline >
									<command class_type='comment' title='' comment='I2C Start' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='I2C_Master1' macro='Start' />
								</flowline>
							</case>
							<case exp='0x89' >
								<flowline >
									<command class_type='comment' title='' comment='I2C Restart' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='I2C_Master1' macro='Restart' />
								</flowline>
							</case>
							<case exp='0x8A' >
								<flowline >
									<command class_type='comment' title='' comment='I2C Stop' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='I2C_Master1' macro='Stop' />
								</flowline>
							</case>
							<case exp='0x8B' >
								<flowline >
									<command class_type='comment' title='' comment='I2C Send' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='calculation' title='Number of param bytes' cmdcolor='16760919' cmdcolor_sec='16760832' >
										<exp exp='ParamCount = 1' />
									</command>
									<command class_type='calculation' title='Number of return bytes' cmdcolor='16760919' cmdcolor_sec='16760832' >
										<exp exp='ReturnCount = 1' />
									</command>
								</flowline>
							</case>
							<case exp='0x8C' >
								<flowline >
									<command class_type='comment' title='' comment='I2C Receive' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='calculation' title='Number of param bytes' cmdcolor='16760919' cmdcolor_sec='16760832' >
										<exp exp='ParamCount = 1' />
									</command>
									<command class_type='calculation' title='Number of return bytes' cmdcolor='16760919' cmdcolor_sec='16760832' >
										<exp exp='ReturnCount = 1' />
									</command>
								</flowline>
							</case>
						</command>
						<command class_type='switch' title='PWM Commands' textarea='36,25,36,25' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Command' >
							<case >
								<flowline />
							</case>
							<case exp='0x8D' >
								<flowline >
									<command class_type='comment' title='' comment='Enable' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='calculation' title='Number of param bytes' cmdcolor='16760919' cmdcolor_sec='16760832' >
										<exp exp='ParamCount = 1' />
									</command>
								</flowline>
							</case>
							<case exp='0x8E' >
								<flowline >
									<command class_type='comment' title='' comment='Disable' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='calculation' title='Number of param bytes' cmdcolor='16760919' cmdcolor_sec='16760832' >
										<exp exp='ParamCount = 1' />
									</command>
								</flowline>
							</case>
							<case exp='0x8F' >
								<flowline >
									<command class_type='comment' title='' comment='Prescaler' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='calculation' title='Number of param bytes' cmdcolor='16760919' cmdcolor_sec='16760832' >
										<exp exp='ParamCount = 1' />
									</command>
								</flowline>
							</case>
							<case exp='0x90' >
								<flowline >
									<command class_type='comment' title='' comment='Duty 8' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='calculation' title='Number of param bytes' cmdcolor='16760919' cmdcolor_sec='16760832' >
										<exp exp='ParamCount = 2' />
									</command>
								</flowline>
							</case>
						</command>
						<command class_type='decision' title='Do we need to collect parameters?' cmdcolor='12615680' cmdcolor_sec='15376912' exp='ParamCount &gt; 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Mode - Collect Params' cmdcolor='16760919' cmdcolor_sec='16760832' >
									<exp exp='Mode = 1' />
								</command>
							</flowline>
							<flowline >
								<command class_type='decision' title='Do we need to send returns' cmdcolor='12615680' cmdcolor_sec='15376912' exp='ReturnCount &gt; 0' swap='0' >
									<flowline >
										<command class_type='calculation' title='Mode - Send Returns' cmdcolor='16760919' cmdcolor_sec='16760832' >
											<exp exp='Mode = 2' />
										</command>
									</flowline>
									<flowline >
										<command class_type='comment' title='' comment='Command Complete or Unrecognised' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
										<command class_type='calculation' title='Mode - Collect Command' cmdcolor='16760919' cmdcolor_sec='16760832' >
											<exp exp='Mode = 0' />
										</command>
									</flowline>
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='ActionCommand' description='Once all the parameters are received we action the command' >
						<return name='Return' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='TempUINT' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='switch' title='IO Commands' textarea='36,25,36,25' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Command' >
							<case >
								<flowline />
							</case>
							<case exp='0x80' >
								<flowline >
									<command class_type='comment' title='' comment='Set Output' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='switch' title='IO Channel' textarea='36,25,36,25' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Params[0]' >
										<case >
											<flowline />
										</case>
										<case exp='0' >
											<flowline >
												<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048578' mask='1' exp='Params[1]' />
											</flowline>
										</case>
										<case exp='1' >
											<flowline >
												<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048578' mask='2' exp='Params[1]' />
											</flowline>
										</case>
										<case exp='2' >
											<flowline >
												<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048578' mask='4' exp='Params[1]' />
											</flowline>
										</case>
										<case exp='3' >
											<flowline >
												<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048578' mask='8' exp='Params[1]' />
											</flowline>
										</case>
										<case exp='4' >
											<flowline >
												<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048578' mask='16' exp='Params[1]' />
											</flowline>
										</case>
										<case exp='5' >
											<flowline >
												<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048578' mask='32' exp='Params[1]' />
											</flowline>
										</case>
										<case exp='6' >
											<flowline >
												<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048578' mask='64' exp='Params[1]' />
											</flowline>
										</case>
										<case exp='7' >
											<flowline >
												<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048578' mask='128' exp='Params[1]' />
											</flowline>
										</case>
										<case exp='8' >
											<flowline >
												<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048576' mask='1' exp='Params[1]' />
											</flowline>
										</case>
										<case exp='9' >
											<flowline >
												<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048576' mask='2' exp='Params[1]' />
											</flowline>
										</case>
									</command>
									<command class_type='switch' title='IO Channel' textarea='36,25,36,25' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Params[0]' >
										<case >
											<flowline />
										</case>
										<case exp='10' >
											<flowline >
												<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048576' mask='4' exp='Params[1]' />
											</flowline>
										</case>
										<case exp='11' >
											<flowline >
												<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048576' mask='8' exp='Params[1]' />
											</flowline>
										</case>
										<case exp='12' >
											<flowline >
												<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048576' mask='16' exp='Params[1]' />
											</flowline>
										</case>
										<case exp='13' >
											<flowline >
												<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048576' mask='32' exp='Params[1]' />
											</flowline>
										</case>
									</command>
								</flowline>
							</case>
							<case exp='0x81' >
								<flowline >
									<command class_type='comment' title='' comment='Get Input' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='switch' title='IO Channel' textarea='36,25,36,25' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Params[0]' >
										<case >
											<flowline />
										</case>
										<case exp='0' >
											<flowline >
												<command class_type='input' title='Input' cmdcolor='4664832' cmdcolor_sec='4470784' mode='1' port='1048578' mask='1' exp='Returns[0]' />
											</flowline>
										</case>
										<case exp='1' >
											<flowline >
												<command class_type='input' title='Input' cmdcolor='4664832' cmdcolor_sec='4470784' mode='1' port='1048578' mask='2' exp='Returns[0]' />
											</flowline>
										</case>
										<case exp='2' >
											<flowline >
												<command class_type='input' title='Input' cmdcolor='4664832' cmdcolor_sec='4470784' mode='1' port='1048578' mask='4' exp='Returns[0]' />
											</flowline>
										</case>
										<case exp='3' >
											<flowline >
												<command class_type='input' title='Input' cmdcolor='4664832' cmdcolor_sec='4470784' mode='1' port='1048578' mask='8' exp='Returns[0]' />
											</flowline>
										</case>
										<case exp='4' >
											<flowline >
												<command class_type='input' title='Input' cmdcolor='4664832' cmdcolor_sec='4470784' mode='1' port='1048578' mask='16' exp='Returns[0]' />
											</flowline>
										</case>
										<case exp='5' >
											<flowline >
												<command class_type='input' title='Input' cmdcolor='4664832' cmdcolor_sec='4470784' mode='1' port='1048578' mask='32' exp='Returns[0]' />
											</flowline>
										</case>
										<case exp='6' >
											<flowline >
												<command class_type='input' title='Input' cmdcolor='4664832' cmdcolor_sec='4470784' mode='1' port='1048578' mask='64' exp='Returns[0]' />
											</flowline>
										</case>
										<case exp='7' >
											<flowline >
												<command class_type='input' title='Input' cmdcolor='4664832' cmdcolor_sec='4470784' mode='1' port='1048578' mask='128' exp='Returns[0]' />
											</flowline>
										</case>
										<case exp='8' >
											<flowline >
												<command class_type='input' title='Input' cmdcolor='4664832' cmdcolor_sec='4470784' mode='1' port='1048576' mask='1' exp='Returns[0]' />
											</flowline>
										</case>
										<case exp='9' >
											<flowline >
												<command class_type='input' title='Input' cmdcolor='4664832' cmdcolor_sec='4470784' mode='1' port='1048576' mask='2' exp='Returns[0]' />
											</flowline>
										</case>
									</command>
									<command class_type='switch' title='IO Channel' textarea='36,25,36,25' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Params[0]' >
										<case >
											<flowline />
										</case>
										<case exp='10' >
											<flowline >
												<command class_type='input' title='Input' cmdcolor='4664832' cmdcolor_sec='4470784' mode='1' port='1048576' mask='4' exp='Returns[0]' />
											</flowline>
										</case>
										<case exp='11' >
											<flowline >
												<command class_type='input' title='Input' cmdcolor='4664832' cmdcolor_sec='4470784' mode='1' port='1048576' mask='8' exp='Returns[0]' />
											</flowline>
										</case>
										<case exp='12' >
											<flowline >
												<command class_type='input' title='Input' cmdcolor='4664832' cmdcolor_sec='4470784' mode='1' port='1048576' mask='16' exp='Returns[0]' />
											</flowline>
										</case>
										<case exp='13' >
											<flowline >
												<command class_type='input' title='Input' cmdcolor='4664832' cmdcolor_sec='4470784' mode='1' port='1048576' mask='32' exp='Returns[0]' />
											</flowline>
										</case>
									</command>
								</flowline>
							</case>
						</command>
						<command class_type='switch' title='Analog Commands' textarea='36,25,36,25' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Command' >
							<case >
								<flowline />
							</case>
							<case exp='0x82' >
								<flowline >
									<command class_type='comment' title='' comment='ADC 8' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='comment' title='' comment='We leverage a single ADC component to allow us to read 
any ADC channel by using C code' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='native' title='C Code' ccode='FC_CAL_ADC_Enable(FCV_PARAMS[0], 3, 0, 40);
FCL_TEMPUINT = FC_CAL_ADC_Sample(0);
FC_CAL_ADC_Disable();' cmdcolor='7687168' cmdcolor_sec='8152576' language='C' />
									<command class_type='calculation' title='Copy var into 8-bit return' cmdcolor='16760919' cmdcolor_sec='16760832' >
										<exp exp='Returns[0] = .TempUINT' />
									</command>
								</flowline>
							</case>
							<case exp='0x83' >
								<flowline >
									<command class_type='comment' title='' comment='ADC 10' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='comment' title='' comment='We leverage a single ADC component to allow us to read 
any ADC channel by using C code' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='native' title='C Code' ccode='FC_CAL_ADC_Enable(FCV_PARAMS[0], 3, 0, 40);
FCL_TEMPUINT = FC_CAL_ADC_Sample(1);
FC_CAL_ADC_Disable();' cmdcolor='7687168' cmdcolor_sec='8152576' language='C' />
									<command class_type='calculation' title='Convert 16-bit var into 2x 8-bit' cmdcolor='16760919' cmdcolor_sec='16760832' >
										<exp exp='Returns[1] = .TempUINT' />
										<exp exp='Returns[0] = .TempUINT &gt;&gt; 8' />
									</command>
								</flowline>
							</case>
						</command>
						<command class_type='switch' title='SPI Commands' textarea='36,25,36,25' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Command' >
							<case >
								<flowline />
							</case>
							<case exp='0x84' >
								<flowline >
									<command class_type='comment' title='' comment='SPI Init' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
								</flowline>
							</case>
							<case exp='0x85' >
								<flowline >
									<command class_type='comment' title='' comment='SPI Transfer' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='cal_spi1' macro='Master_Byte' >
										<return exp='Returns[0]' />
										<argument exp='Params[0]' />
									</command>
								</flowline>
							</case>
							<case exp='0x86' >
								<flowline >
									<command class_type='comment' title='' comment='SPI Set Prescaler' textarea='36,-6,36,-6' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='cal_spi1' macro='SetPrescaler' >
										<argument exp='Params[0]' />
									</command>
								</flowline>
							</case>
						</command>
						<command class_type='switch' title='I2C Commands' textarea='36,25,36,25' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Command' >
							<case >
								<flowline />
							</case>
							<case exp='0x87' >
								<flowline >
									<command class_type='comment' title='' comment='I2C Init' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
								</flowline>
							</case>
							<case exp='0x88' >
								<flowline >
									<command class_type='comment' title='' comment='I2C Start' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
								</flowline>
							</case>
							<case exp='0x89' >
								<flowline >
									<command class_type='comment' title='' comment='I2C Restart' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
								</flowline>
							</case>
							<case exp='0x8A' >
								<flowline >
									<command class_type='comment' title='' comment='I2C Stop' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
								</flowline>
							</case>
							<case exp='0x8B' >
								<flowline >
									<command class_type='comment' title='' comment='I2C Send' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='I2C_Master1' macro='TransmitByte' >
										<return exp='Returns[0]' />
										<argument exp='Params[0]' />
									</command>
								</flowline>
							</case>
							<case exp='0x8C' >
								<flowline >
									<command class_type='comment' title='' comment='I2C Receive' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='I2C_Master1' macro='ReceiveByte' >
										<return exp='Returns[0]' />
										<argument exp='Params[0]' />
									</command>
								</flowline>
							</case>
						</command>
						<command class_type='switch' title='PWM Commands' textarea='36,25,36,25' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Command' >
							<case >
								<flowline />
							</case>
							<case exp='0x8D' >
								<flowline >
									<command class_type='comment' title='' comment='Enable' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='switch' title='Switch' textarea='36,25,36,25' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Params[0]' >
										<case >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM1' macro='Enable' />
											</flowline>
										</case>
										<case exp='1' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM2' macro='Enable' />
											</flowline>
										</case>
										<case exp='2' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM3' macro='Enable' />
											</flowline>
										</case>
										<case exp='3' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM4' macro='Enable' />
											</flowline>
										</case>
										<case exp='4' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM5' macro='Enable' />
											</flowline>
										</case>
										<case exp='5' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM6' macro='Enable' />
											</flowline>
										</case>
									</command>
								</flowline>
							</case>
							<case exp='0x8E' >
								<flowline >
									<command class_type='comment' title='' comment='Disable' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='switch' title='Switch' textarea='36,25,36,25' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Params[0]' >
										<case >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM1' macro='Disable' />
											</flowline>
										</case>
										<case exp='1' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM2' macro='Disable' />
											</flowline>
										</case>
										<case exp='2' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM3' macro='Disable' />
											</flowline>
										</case>
										<case exp='3' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM4' macro='Disable' />
											</flowline>
										</case>
										<case exp='4' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM5' macro='Disable' />
											</flowline>
										</case>
										<case exp='5' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM6' macro='Disable' />
											</flowline>
										</case>
									</command>
								</flowline>
							</case>
							<case exp='0x8F' >
								<flowline >
									<command class_type='comment' title='' comment='Prescaler' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='switch' title='Switch' textarea='36,25,36,25' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Params[0]' >
										<case >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM1' macro='ChangePeriod' >
													<argument exp='255' />
													<argument exp='Params[0]' />
												</command>
											</flowline>
										</case>
										<case exp='1' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM2' macro='ChangePeriod' >
													<argument exp='255' />
													<argument exp='Params[0]' />
												</command>
											</flowline>
										</case>
										<case exp='2' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM3' macro='ChangePeriod' >
													<argument exp='255' />
													<argument exp='Params[0]' />
												</command>
											</flowline>
										</case>
										<case exp='3' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM4' macro='ChangePeriod' >
													<argument exp='255' />
													<argument exp='Params[0]' />
												</command>
											</flowline>
										</case>
										<case exp='4' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM5' macro='ChangePeriod' >
													<argument exp='255' />
													<argument exp='Params[0]' />
												</command>
											</flowline>
										</case>
										<case exp='5' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM6' macro='ChangePeriod' >
													<argument exp='255' />
													<argument exp='Params[0]' />
												</command>
											</flowline>
										</case>
									</command>
								</flowline>
							</case>
							<case exp='0x90' >
								<flowline >
									<command class_type='comment' title='' comment='Duty 8' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
									<command class_type='switch' title='Switch' textarea='36,25,36,25' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Params[0]' >
										<case >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM1' macro='SetDutyCycle' >
													<argument exp='Params[1]' />
												</command>
											</flowline>
										</case>
										<case exp='1' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM2' macro='SetDutyCycle' >
													<argument exp='Params[1]' />
												</command>
											</flowline>
										</case>
										<case exp='2' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM3' macro='SetDutyCycle' >
													<argument exp='Params[1]' />
												</command>
											</flowline>
										</case>
										<case exp='3' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM4' macro='SetDutyCycle' >
													<argument exp='Params[1]' />
												</command>
											</flowline>
										</case>
										<case exp='4' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM5' macro='SetDutyCycle' >
													<argument exp='Params[1]' />
												</command>
											</flowline>
										</case>
										<case exp='5' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM6' macro='SetDutyCycle' >
													<argument exp='Params[1]' />
												</command>
											</flowline>
										</case>
									</command>
								</flowline>
							</case>
						</command>
						<command class_type='decision' title='Do we need to send returns' cmdcolor='12615680' cmdcolor_sec='15376912' exp='ReturnCount &gt; 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Mode - Send Returns' cmdcolor='16760919' cmdcolor_sec='16760832' >
									<exp exp='Mode = 2' />
								</command>
							</flowline>
							<flowline >
								<command class_type='comment' title='' comment='Command Complete' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
								<command class_type='calculation' title='Mode - Collect Command' cmdcolor='16760919' cmdcolor_sec='16760832' >
									<exp exp='Mode = 0' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='UART_Receive_Interrupt_Handler' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='Data' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Collect Byte From UART' cmdcolor='1879295' cmdcolor_sec='5751039' component='UART1' macro='ReceiveChar' >
							<return exp='.Data' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Store RX byte into buffer' cmdcolor='1879295' cmdcolor_sec='5751039' component='CircularBuffer1' macro='PutByte' >
							<argument exp='.Data' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='in' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='out' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='Firmware for Arduino megga

using a combo board for inputs and outputs

PORT C FOR D0 TO D7
PORT A FOR D8 TO D13

UART BAUD SET TO 115200' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
						<command class_type='calculation' title='Reset Mode to 0 - Waitinfg for command' cmdcolor='16760919' cmdcolor_sec='16760832' >
							<exp exp='Mode = 0' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='UART1' macro='Initialise' />
						<command class_type='interrupt' title='Enable RX Interrupt - Catch bytes as they come in' cmdcolor='17151' cmdcolor_sec='355583' enable='1' name='RXINT0' call='UART_Receive_Interrupt_Handler' >
							<settings timer='0' prescale='-1' postscale='-1' rollover='-1' bitcount='-1' trigger='3' maskhi='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' masklo='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' >
								<option value='0' />
								<option value='0' />
								<option value='0' />
								<option value='0' />
								<option value='0' />
								<option value='0' />
								<option value='0' />
								<option value='0' />
							</settings>
						</command>
						<command class_type='loop' title='Loop' cmdcolor='12615680' cmdcolor_sec='15376912' type='0' exp='1' >
							<flowline >
								<command class_type='decision' title='Data from host in the buffer?' cmdcolor='12615680' cmdcolor_sec='15376912' exp='CircularBuffer1 :: GetNumberBytes () &gt; 0' swap='0' >
									<flowline >
										<command class_type='call' title='Collect byte from buffer' cmdcolor='1879295' cmdcolor_sec='5751039' component='CircularBuffer1' macro='GetByte' >
											<return exp='.in' />
										</command>
										<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' />
										<command class_type='calculation' title='Default reply is to echo incoming byte' cmdcolor='16760919' cmdcolor_sec='16760832' >
											<exp exp='.out = .in' />
										</command>
										<command class_type='switch' title='Finite State Machine - Mode' textarea='36,25,36,25' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Mode' >
											<case >
												<flowline >
													<command class_type='comment' title='' comment='Default - Wait for command code' textarea='36,-6,36,-6' cmdcolor='10944511' cmdcolor_sec='11465458' />
													<command class_type='decision' title='Is Command Byte?' cmdcolor='12615680' cmdcolor_sec='15376912' exp='.in &amp; 0x80' swap='0' >
														<flowline >
															<command class_type='call' title='Call Macro' cmdcolor='1879295' cmdcolor_sec='5751039' macro='MatchCommand' >
																<argument exp='.in' />
															</command>
														</flowline>
														<flowline />
													</command>
												</flowline>
											</case>
											<case exp='1' >
												<flowline >
													<command class_type='comment' title='' comment='Collect Parameters' textarea='36,-6,36,-6' cmdcolor='10944511' cmdcolor_sec='11465458' />
													<command class_type='calculation' title='Store Parameter' cmdcolor='16760919' cmdcolor_sec='16760832' >
														<exp exp='Params[ParamIdx] = .in' />
													</command>
													<command class_type='calculation' title='Increment Parameter Index' cmdcolor='16760919' cmdcolor_sec='16760832' >
														<exp exp='ParamIdx = ParamIdx + 1' />
													</command>
													<command class_type='decision' title='End of params?' cmdcolor='12615680' cmdcolor_sec='15376912' exp='ParamCount = ParamIdx' swap='0' >
														<flowline >
															<command class_type='comment' title='' comment='All Parameters collected
Action Command' textarea='36,-6,36,-6' cmdcolor='10944511' cmdcolor_sec='11465458' />
															<command class_type='call' title='Call Macro' cmdcolor='1879295' cmdcolor_sec='5751039' macro='ActionCommand' />
														</flowline>
														<flowline />
													</command>
												</flowline>
											</case>
											<case exp='2' >
												<flowline >
													<command class_type='comment' title='' comment='Send Return Values' textarea='36,-6,36,-6' cmdcolor='10944511' cmdcolor_sec='11465458' />
													<command class_type='calculation' title='Assign return value' cmdcolor='16760919' cmdcolor_sec='16760832' >
														<exp exp='.out = Returns[ReturnIdx]' />
													</command>
													<command class_type='calculation' title='Increment bytes to end command' cmdcolor='16760919' cmdcolor_sec='16760832' >
														<exp exp='ReturnIdx = ReturnIdx + 1' />
													</command>
													<command class_type='decision' title='End of command?' cmdcolor='12615680' cmdcolor_sec='15376912' exp='ReturnCount = ReturnIdx' swap='0' >
														<flowline >
															<command class_type='calculation' title='Reset Mode' cmdcolor='16760919' cmdcolor_sec='16760832' >
																<exp exp='Mode = 0' />
															</command>
														</flowline>
														<flowline />
													</command>
												</flowline>
											</case>
										</command>
										<command class_type='call' title='Transmit reply byte' cmdcolor='1879295' cmdcolor_sec='5751039' component='UART1' macro='SendChar' >
											<argument exp='.out' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
						<command class_type='call' title='DUmmy call to include component code' cmdcolor='1879295' cmdcolor_sec='5751039' component='slider_plastic1' macro='GetByte' >
							<return exp='Returns[0]' />
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='c73616d1-7ad0-45d9-aada-69ccfa4c5efc' vmin='0' vmaj='2' codename='UART1' x='0' y='-40' z='3.74999' xsz='66' ysz='34' zsz='7.5' 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' >
				<resources />
				<properties />
				<values >
					<value target='cal_uart::CHANNEL' data='001' />
					<value target='cal_uart::BAUD_LIST' data='009' />
					<value target='cal_uart::BAUD' data='115200' />
					<value target='cal_uart::DBITS' data='008' />
					<value target='cal_uart::RETURN' data='000' />
					<value target='cal_uart::ECHO' data='000' />
					<value target='cal_uart::UseTX' data='1' />
					<value target='cal_uart::TX' data='$PORTE.1' />
					<value target='cal_uart::OutputPins' data='006' />
					<value target='cal_uart::TXAlt' data='0' />
					<value target='cal_uart::UseRX' data='1' />
					<value target='cal_uart::RX' data='$PORTE.0' />
					<value target='cal_uart::InputPins' data='039' />
					<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='0' />
					<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' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='24219805-113d-4b12-b6bd-e1b0b0c33981' vmin='4' vmaj='1' codename='I2C_Master1' x='-30' y='50' z='3.74999' xsz='66' ysz='34' zsz='7.5' 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' >
				<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='1' />
					<value target='cal_i2c::SDA' data='$PORTD.1' />
					<value target='cal_i2c::SDAPins' data='002' />
					<value target='cal_i2c::SCL' data='$PORTD.0' />
					<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='' />
					<value target='cal_i2c::Injector' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='444fb704-814c-4707-a15c-759ba088505c' vmin='9' vmaj='1' codename='PWM1' x='70' y='40' z='1.7793' 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='1' >
				<resources />
				<properties />
				<values >
					<value target='channel' data='001' />
					<value target='altpin' data='0' />
					<value target='pwm_pin' data='$PORTB.7' />
					<value target='RemapPin' data='000' />
					<value target='timer' data='002' />
					<value target='period' data='255' />
					<value target='prescale' data='000' />
					<value target='period_calc' data='16.000000' />
					<value target='frequency_calc2' data='62500.000000' />
					<value target='frequency_calc' data='62.500000' />
					<value target='pwm_prescale' data='1' />
					<value target='ReqFreq' data='100.000000' />
					<value target='OldReqFreq' data='100.000000' />
					<value target='CalcFreq' data='100.004570' />
					<value target='CalcPeriod' data='10936' />
					<value target='CalcScaler' data='64' />
					<value target='Apply' data='0' />
					<value target='SimRep' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='444fb704-814c-4707-a15c-759ba088505c' vmin='9' vmaj='1' codename='PWM2' x='130' y='40' z='1.7793' 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='1' >
				<resources />
				<properties />
				<values >
					<value target='channel' data='002' />
					<value target='altpin' data='0' />
					<value target='pwm_pin' data='$PORTG.5' />
					<value target='RemapPin' data='000' />
					<value target='timer' data='002' />
					<value target='period' data='255' />
					<value target='prescale' data='000' />
					<value target='period_calc' data='16.000000' />
					<value target='frequency_calc2' data='62500.000000' />
					<value target='frequency_calc' data='62.500000' />
					<value target='pwm_prescale' data='1' />
					<value target='ReqFreq' data='100.000000' />
					<value target='OldReqFreq' data='100.000000' />
					<value target='CalcFreq' data='100.004570' />
					<value target='CalcPeriod' data='10936' />
					<value target='CalcScaler' data='64' />
					<value target='Apply' data='0' />
					<value target='SimRep' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c67171df-0ad6-4b11-8361-cfe14b072847' vmin='0' vmaj='2' codename='cal_spi1' x='0' y='0' 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' >
				<resources />
				<properties />
				<values >
					<value target='ENABLED' data='1' />
					<value target='REF' data='1' />
					<value target='CHANNEL' data='000' />
					<value target='MOSI' data='$PORTB.3' />
					<value target='MOSIPins' data='008' />
					<value target='MISO' data='$PORTB.4' />
					<value target='MISOPins' data='013' />
					<value target='CLK' data='$PORTB.5' />
					<value target='CLKPins' data='004' />
					<value target='UseAutoCS' data='0' />
					<value target='UseCS' data='0' />
					<value target='SS' data='$PORTC.2' />
					<value target='SSPins' data='000' />
					<value target='AltSSPin' data='0' />
					<value target='Mode' data='000' />
					<value target='PR_SCALE' data='064' />
					<value target='CKE' data='001' />
					<value target='CKP' data='000' />
					<value target='SMP' data='001' />
					<value target='ScopeTraces' data='1' />
					<value target='ConsoleData' data='1' />
					<value target='Injector' data='000' />
					<value target='InjectorHandle' data='0' />
					<value target='BMODE' data='6' />
					<value target='MOSI_PORT' data='$PORTB.3' />
					<value target='MOSI_TRIS' data='$PORTB.3' />
					<value target='MOSI_PIN' data='3' />
					<value target='MISO_PORT' data='$PORTB.4' />
					<value target='MISO_TRIS' data='$PORTB.4' />
					<value target='MISO_PIN' data='4' />
					<value target='SCK_PORT' data='$PORTB.5' />
					<value target='SCK_TRIS' data='$PORTB.5' />
					<value target='SCK_PIN' data='5' />
					<value target='SS_PORT' data='$PORTC.2' />
					<value target='SS_TRIS' data='$PORTC.2' />
					<value target='SS_PIN' data='2' />
					<value target='Remappable' data='' />
					<value target='MOSIReg' data='008' />
					<value target='CLKREG' data='004' />
					<value target='MOSIRPNUM' data='21' />
					<value target='MOSIBank' data='b' />
					<value target='MOSIBank2' data='c' />
					<value target='CLKRPNUM' data='20' />
					<value target='CLKBank' data='b' />
					<value target='MISORPREG' data='SSP1DATPPS' />
					<value target='MISOBank' data='b' />
					<value target='SPIName' data='' />
					<value target='MISOReg' data='000' />
					<value target='SPIClock' data='' />
					<value target='MISOBank2' data='c' />
					<value target='CLKBank2' data='c' />
					<value target='ParentName' data='' />
					<value target='BitDelay' data='4' />
					<value target='ClockSpeed' data='16000000' />
					<value target='MasterDivider' data='1' />
					<value target='Sim' data='1' />
					<value target='CLKRPREG' data='' />
					<value target='SSRPREG' data='' />
					<value target='SSBank' data='' />
					<value target='SSBank2' data='' />
					<value target='AltSSReg' data='' />
					<value target='AltSSMask' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c34f9b8a-a915-4f75-ad0c-87f2ad670a8a' vmin='5' vmaj='1' codename='CircularBuffer1' x='-70' y='0' z='8' xsz='20' ysz='20' zsz='20' 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' >
				<resources />
				<properties />
				<values >
					<value target='BufferSize' data='128' />
					<value target='StorageType' data='000' />
					<value target='MemType' data='000' />
					<value target='RETURN' data='000' />
					<value target='Console' data='1' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='1a8c2bb7-8bed-4a1c-9186-ba24688c8840' vmin='3' vmaj='1' codename='slider_plastic1' x='-250' y='50' z='5' xsz='12.502' ysz='112.5' zsz='10' 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' >
				<resources />
				<properties />
				<values >
					<value target='tang_col' data='16711680' />
					<value target='mark_col' data='255' />
					<value target='body_color' data='12632256' />
					<value target='ScopeTraces' data='0' />
					<value target='channel' data='0' />
					<value target='vrefvol' data='500' />
					<value target='vrefop' data='000' />
					<value target='convspd' data='005' />
					<value target='actime' data='40' />
					<value target='bits' data='10' />
					<value target='bitmul' data='0.004883' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='444fb704-814c-4707-a15c-759ba088505c' vmin='9' vmaj='1' codename='PWM3' x='70' y='0' z='3.0293' 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='1' >
				<resources />
				<properties />
				<values >
					<value target='channel' data='003' />
					<value target='altpin' data='0' />
					<value target='pwm_pin' data='$PORTB.5' />
					<value target='RemapPin' data='000' />
					<value target='timer' data='002' />
					<value target='period' data='255' />
					<value target='prescale' data='000' />
					<value target='period_calc' data='16.000000' />
					<value target='frequency_calc2' data='62500.000000' />
					<value target='frequency_calc' data='62.500000' />
					<value target='pwm_prescale' data='1' />
					<value target='ReqFreq' data='100.000000' />
					<value target='OldReqFreq' data='100.000000' />
					<value target='CalcFreq' data='100.004570' />
					<value target='CalcPeriod' data='10936' />
					<value target='CalcScaler' data='64' />
					<value target='Apply' data='0' />
					<value target='SimRep' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='444fb704-814c-4707-a15c-759ba088505c' vmin='9' vmaj='1' codename='PWM4' x='130' y='0' z='3.0293' 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='1' >
				<resources />
				<properties />
				<values >
					<value target='channel' data='004' />
					<value target='altpin' data='0' />
					<value target='pwm_pin' data='$PORTB.6' />
					<value target='RemapPin' data='000' />
					<value target='timer' data='002' />
					<value target='period' data='255' />
					<value target='prescale' data='000' />
					<value target='period_calc' data='16.000000' />
					<value target='frequency_calc2' data='62500.000000' />
					<value target='frequency_calc' data='62.500000' />
					<value target='pwm_prescale' data='1' />
					<value target='ReqFreq' data='100.000000' />
					<value target='OldReqFreq' data='100.000000' />
					<value target='CalcFreq' data='100.004570' />
					<value target='CalcPeriod' data='10936' />
					<value target='CalcScaler' data='64' />
					<value target='Apply' data='0' />
					<value target='SimRep' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='444fb704-814c-4707-a15c-759ba088505c' vmin='9' vmaj='1' codename='PWM5' x='70' y='-40' z='1.7793' 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='1' >
				<resources />
				<properties />
				<values >
					<value target='channel' data='005' />
					<value target='altpin' data='0' />
					<value target='pwm_pin' data='$PORTB.7' />
					<value target='RemapPin' data='000' />
					<value target='timer' data='002' />
					<value target='period' data='255' />
					<value target='prescale' data='000' />
					<value target='period_calc' data='16.000000' />
					<value target='frequency_calc2' data='62500.000000' />
					<value target='frequency_calc' data='62.500000' />
					<value target='pwm_prescale' data='1' />
					<value target='ReqFreq' data='100.000000' />
					<value target='OldReqFreq' data='100.000000' />
					<value target='CalcFreq' data='100.004570' />
					<value target='CalcPeriod' data='10936' />
					<value target='CalcScaler' data='64' />
					<value target='Apply' data='0' />
					<value target='SimRep' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='444fb704-814c-4707-a15c-759ba088505c' vmin='9' vmaj='1' codename='PWM6' x='130' y='-40' z='1.7793' 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='1' >
				<resources />
				<properties />
				<values >
					<value target='channel' data='006' />
					<value target='altpin' data='0' />
					<value target='pwm_pin' data='$PORTB.4' />
					<value target='RemapPin' data='000' />
					<value target='timer' data='002' />
					<value target='period' data='255' />
					<value target='prescale' data='000' />
					<value target='period_calc' data='16.000000' />
					<value target='frequency_calc2' data='62500.000000' />
					<value target='frequency_calc' data='62.500000' />
					<value target='pwm_prescale' data='1' />
					<value target='ReqFreq' data='100.000000' />
					<value target='OldReqFreq' data='100.000000' />
					<value target='CalcFreq' data='100.004570' />
					<value target='CalcPeriod' data='10936' />
					<value target='CalcScaler' data='64' />
					<value target='Apply' data='0' />
					<value target='SimRep' data='001' />
				</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='84.4956' ye='363.141' ze='6666.67' xt='84.4956' yt='363.141' zt='0' xquat='0' yquat='0' zquat='0' wquat='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='0.0629235' ye='-0.114286' ze='14.1618' xt='0.0629235' yt='-0.114286' 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' />
	</panel3d>
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAQQUAAKgCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ActionCommand' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAQQUAAKgCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='UART_Receive_Interrupt_Handler' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAQQUAAKgCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='MatchCommand' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAQQUAAKgCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
