<root>
<document schema='101' license='1,Dev User,HJVC24' title='' description='' target='PIC.16F.16F877' >
	<config data='!0,3f7a%0,2%2,0%3,1%6,1%7,0%9,1%b,1%8,1%4,303' clkspd='12288000' simspd='1' usewdt='0' constif='0' />
	<plugins >
		<dll_dbg_icd enabled='0' >
			<data name='debug' value='1' />
			<data name='userpins' value='0' />
			<data name='speed' value='0' />
			<data name='usev9' value='0' />
			<data name='breaks' value='8' />
			<data name='stacks' value='8' />
			<data name='clkport' value='1' />
			<data name='clkbit' value='6' />
			<data name='dataport' value='1' />
			<data name='databit' value='7' />
			<data name='ghostype' value='0' />
			<data name='monitor' value='1' />
			<data name='ictloop' value='0' />
			<data name='ictrate' value='20000' />
			<data name='ictmask' value='0' />
			<data name='anlpres' value='19' />
			<data name='digmask1' value='-1' />
			<data name='digmask2' value='-1' />
		</dll_dbg_icd>
		<dll_models enabled='1' />
		<dll_upgrader enabled='1' />
		<dll_webhelp enabled='1' />
	</plugins>
	<supplement use='1' head='#define COMMS_BUFF_SIZE 50' body='' />
	<debug />
	<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='1' />
			<data name='ClockPin' value='6' />
			<data name='DataPort' value='1' />
			<data name='DataPin' value='7' />
			<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' />
		</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='' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='0' 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' interactive='1' solid='1' layer='0' poslock='0' >
			<resources />
			<properties />
			<values />
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='result' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='count' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='rx_data' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='50' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='rx_buff_start' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='rx_buff_end' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='rx_receive_level' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RS232_In' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='data_out' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='50' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='data_index' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='add_string' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='10' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='csum' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='rx_byte_count' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='rx_buff' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='50' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='unit_address' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='respond_to_command' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='result' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='tlm' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='4' />
						</local>
						<command class_type='calculation' title='get 3 letter pnemonic' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='respond_to_command.tlm = Left$ (rx_data,3)' />
						</command>
						<command class_type='comment' title='' comment='CHK Command Starts' textarea='12,0,487,300' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='calculation' title='Check for ACK' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='respond_to_command.result = Compare$ (respond_to_command.tlm,&quot;CHK&quot;,1)' />
						</command>
						<command class_type='decision' title='check result' textarea='36,0,511,300' cmdcolor='3568629' cmdcolor_sec='3568629' exp='respond_to_command.result = 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='ACK' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='data_out = &quot;ACK&quot;' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='comment' title='' comment='CHK Command Stops' textarea='12,0,487,300' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='comment' title='' comment='RSW Command Starts' textarea='12,0,487,300' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='calculation' title='Check for RSW' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='respond_to_command.result = Compare$ (respond_to_command.tlm,&quot;RSW&quot;,1)' />
						</command>
						<command class_type='decision' title='check result' textarea='36,0,511,300' cmdcolor='3568629' cmdcolor_sec='3568629' exp='respond_to_command.result = 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='ACK' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='data_out = &quot;123 &quot; + &quot;345&quot;' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='comment' title='' comment='RSW Command Stops' textarea='12,0,487,300' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='comment' title='' comment='DIC Command Starts' textarea='12,0,487,300' cmdcolor='1975743' cmdcolor_sec='1975743' />
						<command class_type='calculation' title='Check for DIC' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='respond_to_command.result = Compare$ (respond_to_command.tlm,&quot;DIC&quot;,1)' />
						</command>
						<command class_type='decision' title='check result' textarea='36,0,511,300' cmdcolor='3568629' cmdcolor_sec='3568629' exp='respond_to_command.result = 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='ACK' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='data_out = &quot;USB COMMS TEST BOX&quot;' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='call' title='' textarea='36,0,511,300' cmdcolor='1975743' cmdcolor_sec='1975743' macro='send_response_string' />
						<command class_type='comment' title='' comment='RSW Command Stops' textarea='12,0,487,300' cmdcolor='1975743' cmdcolor_sec='1975743' />
					</flowline>
				</macro>
				<macro >
					<flowline name='int_recieve_packet' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='check received packet' textarea='36,0,511,300' cmdcolor='1975743' cmdcolor_sec='1975743' macro='check_received_packet' >
							<return exp='result' />
						</command>
						<command class_type='decision' title='check result' textarea='36,0,511,300' cmdcolor='3568629' cmdcolor_sec='3568629' exp='result = 1' swap='0' >
							<flowline >
								<command class_type='call' title='Respond' textarea='36,0,511,300' cmdcolor='1975743' cmdcolor_sec='1975743' macro='respond_to_command' />
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='RS232_Rx' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='native' title='Receive character and stick it in the rx input buffer' textarea='36,0,511,300' ccode='
char dummy;


if ((RCSTA &amp; (1 &lt;&lt; FERR)) != 0)
{
	dummy = RCREG;      //need to read the rcreg to clear FERR
}
else if ((RCSTA &amp; (1 &lt;&lt; OERR)) != 0)
{
	//need to read the rcreg to clear error
	clear_bit(RCSTA, CREN);
	set_bit(RCSTA, CREN);
}
else {
	FCV_RX_BUFF[FCV_RX_BUFF_END] = RCREG; //no error, so rx byte is valid

	FCV_RX_BUFF_END++;
	if(FCV_RX_BUFF_END == COMMS_BUFF_SIZE)
		FCV_RX_BUFF_END = 0;

	
	
}

' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='send_response_string' description='send response via RS232' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='csum' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='byte_count' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='counter' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='output' title='Output' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' mode='2' port='1048576' mask='1' exp='1' />
						<command class_type='delay' title='Delay' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' exp='10' type='1' />
						<command class_type='calculation' title='csum' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='send_response_string.csum = 0' />
						</command>
						<command class_type='calculation' title='Data Count' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='send_response_string.byte_count = Length$ (data_out)' />
						</command>
						<command class_type='call' title='EOP' textarea='36,0,511,300' cmdcolor='1975743' cmdcolor_sec='1975743' component='v5__rs2320' macro='SendChar' >
							<argument exp='0xFF' />
						</command>
						<command class_type='call' title='EOP' textarea='36,0,511,300' cmdcolor='1975743' cmdcolor_sec='1975743' component='v5__rs2320' macro='SendChar' >
							<argument exp='0xFF' />
						</command>
						<command class_type='call' title='SOP' textarea='36,0,511,300' cmdcolor='1975743' cmdcolor_sec='1975743' component='v5__rs2320' macro='SendChar' >
							<argument exp='0xD0' />
						</command>
						<command class_type='call' title='Address' textarea='36,0,511,300' cmdcolor='1975743' cmdcolor_sec='1975743' component='v5__rs2320' macro='SendChar' >
							<argument exp='unit_address' />
						</command>
						<command class_type='call' title='Byte Count' textarea='36,0,511,300' cmdcolor='1975743' cmdcolor_sec='1975743' component='v5__rs2320' macro='SendChar' >
							<argument exp='send_response_string.byte_count' />
						</command>
						<command class_type='calculation' title='Calculation' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='send_response_string.counter = 0' />
						</command>
						<command class_type='loop' title='send all data bytes' textarea='36,0,511,300' cmdcolor='3568629' cmdcolor_sec='3568629' type='0' exp='send_response_string.counter &lt; send_response_string.byte_count' >
							<flowline >
								<command class_type='call' title='next data byte' textarea='36,0,511,300' cmdcolor='1975743' cmdcolor_sec='1975743' component='v5__rs2320' macro='SendChar' >
									<argument exp='data_out[send_response_string.counter]' />
								</command>
								<command class_type='calculation' title='csum' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='send_response_string.csum = send_response_string.csum + data_out[send_response_string.counter]' />
								</command>
								<command class_type='calculation' title='increase counter' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='send_response_string.counter = send_response_string.counter + 1' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='csum' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='send_response_string.csum = send_response_string.csum &amp; 0x7f' />
						</command>
						<command class_type='call' title='send checksum' textarea='36,0,511,300' cmdcolor='1975743' cmdcolor_sec='1975743' component='v5__rs2320' macro='SendChar' >
							<argument exp='send_response_string.csum' />
						</command>
						<command class_type='call' title='EOP' textarea='36,0,511,300' cmdcolor='1975743' cmdcolor_sec='1975743' component='v5__rs2320' macro='SendChar' >
							<argument exp='0xFF' />
						</command>
						<command class_type='call' title='EOP' textarea='36,0,511,300' cmdcolor='1975743' cmdcolor_sec='1975743' component='v5__rs2320' macro='SendChar' >
							<argument exp='0xFF' />
						</command>
						<command class_type='delay' title='Delay' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' exp='30' type='1' />
						<command class_type='output' title='Output' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' mode='2' port='1048576' mask='1' exp='0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='check_received_packet' description='' >
						<return name='Return' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='byte' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='No packet received yet' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='check_received_packet.Return = -1' />
						</command>
						<command class_type='decision' title='byte received?' textarea='36,0,511,300' cmdcolor='3568629' cmdcolor_sec='3568629' exp='rx_buff_start = rx_buff_end' swap='1' >
							<flowline >
								<command class_type='calculation' title='Get New Byte' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='check_received_packet.byte = rx_buff[rx_buff_start]' />
								</command>
								<command class_type='native' title='C Code' textarea='36,0,511,300' ccode='FCV_RX_BUFF_START++;
if(FCV_RX_BUFF_START == COMMS_BUFF_SIZE)
	FCV_RX_BUFF_START = 0;' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
								<command class_type='decision' title='level0' textarea='36,0,511,300' cmdcolor='3568629' cmdcolor_sec='3568629' exp='rx_receive_level = 0' swap='0' >
									<flowline >
										<command class_type='decision' title='Start Packet?' textarea='36,0,511,300' cmdcolor='3568629' cmdcolor_sec='3568629' exp='check_received_packet.byte = 0xd0' swap='0' >
											<flowline >
												<command class_type='calculation' title='increase level' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
													<exp exp='rx_receive_level = rx_receive_level + 1' />
												</command>
											</flowline>
											<flowline />
										</command>
									</flowline>
									<flowline >
										<command class_type='decision' title='level1' textarea='36,0,511,300' cmdcolor='3568629' cmdcolor_sec='3568629' exp='rx_receive_level = 1' swap='0' >
											<flowline >
												<command class_type='decision' title='Right address?' textarea='36,0,511,300' cmdcolor='3568629' cmdcolor_sec='3568629' exp='check_received_packet.byte = unit_address' swap='0' >
													<flowline >
														<command class_type='calculation' title='increase level' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
															<exp exp='rx_receive_level = rx_receive_level + 1' />
														</command>
													</flowline>
													<flowline >
														<command class_type='calculation' title='reset level' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
															<exp exp='rx_receive_level = 0' />
														</command>
													</flowline>
												</command>
											</flowline>
											<flowline >
												<command class_type='decision' title='level2' textarea='36,0,511,300' cmdcolor='3568629' cmdcolor_sec='3568629' exp='rx_receive_level = 2' swap='0' >
													<flowline >
														<command class_type='calculation' title='get data count, increase level' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
															<exp exp='rx_byte_count = check_received_packet.byte' />
															<exp exp='rx_receive_level = rx_receive_level + 1' />
															<exp exp='data_index = 0' />
															<exp exp='csum = 0' />
														</command>
													</flowline>
													<flowline >
														<command class_type='decision' title='level3' textarea='36,0,511,300' cmdcolor='3568629' cmdcolor_sec='3568629' exp='rx_receive_level = 3' swap='0' >
															<flowline >
																<command class_type='calculation' title='store data byte, checksum' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
																	<exp exp='rx_data[data_index] = check_received_packet.byte' />
																	<exp exp='data_index = data_index + 1' />
																	<exp exp='csum = csum + check_received_packet.byte' />
																</command>
																<command class_type='decision' title='All data received?' textarea='36,0,511,300' cmdcolor='3568629' cmdcolor_sec='3568629' exp='data_index = rx_byte_count' swap='0' >
																	<flowline >
																		<command class_type='calculation' title='increase level' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
																			<exp exp='rx_receive_level = rx_receive_level + 1' />
																		</command>
																	</flowline>
																	<flowline />
																</command>
															</flowline>
															<flowline >
																<command class_type='decision' title='level4' textarea='36,0,511,300' cmdcolor='3568629' cmdcolor_sec='3568629' exp='rx_receive_level = 4' swap='0' >
																	<flowline >
																		<command class_type='calculation' title='remove top csum bit' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
																			<exp exp='csum = csum &amp; 0x7F' />
																		</command>
																		<command class_type='decision' title='compare checksum' textarea='36,0,511,300' cmdcolor='3568629' cmdcolor_sec='3568629' exp='csum = check_received_packet.byte' swap='0' >
																			<flowline >
																				<command class_type='calculation' title='increase level' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
																					<exp exp='rx_receive_level = rx_receive_level + 1' />
																				</command>
																			</flowline>
																			<flowline >
																				<command class_type='calculation' title='reset' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
																					<exp exp='rx_receive_level = 0' />
																				</command>
																			</flowline>
																		</command>
																	</flowline>
																	<flowline >
																		<command class_type='decision' title='level5' textarea='36,0,511,300' cmdcolor='3568629' cmdcolor_sec='3568629' exp='rx_receive_level = 5' swap='0' >
																			<flowline >
																				<command class_type='decision' title='end packet' textarea='36,0,511,300' cmdcolor='3568629' cmdcolor_sec='3568629' exp='check_received_packet.byte = 0xff' swap='0' >
																					<flowline >
																						<command class_type='calculation' title='Good packet' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
																							<exp exp='check_received_packet.Return = 1' />
																						</command>
																					</flowline>
																					<flowline />
																				</command>
																				<command class_type='calculation' title='reset' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
																					<exp exp='rx_receive_level = 0' />
																				</command>
																			</flowline>
																			<flowline />
																		</command>
																	</flowline>
																</command>
															</flowline>
														</command>
													</flowline>
												</command>
											</flowline>
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='' cmdcolor='1975743' cmdcolor_sec='1975743' component='v5__rs2320' macro='Initialise' />
						<command class_type='output' title='Output' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' mode='1' port='1048576' mask='1' exp='0' />
						<command class_type='calculation' title='Calculation' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='unit_address = 1' />
							<exp exp='rx_receive_level = 0' />
							<exp exp='rx_buff_start = 0' />
							<exp exp='rx_buff_end = 0' />
						</command>
						<command class_type='interrupt' title='Enable RS232 Interrupt' textarea='36,0,511,300' cmdcolor='3610239' cmdcolor_sec='3610239' enable='1' name='' call='RS232_Rx' >
							<custom name='RS232_RX' handler='if(PIR1 &amp; (1 &lt;&lt;RCIF))
{
  FCM_RS232_Rx();
  clear_bit(PIR1, RCIF);
}

' enable='PIE1bits.RCIE=1;
INTCONbits.PEIE = 1;
set_bit(RCSTA, CREN);
INTCONbits.GIE = 1;' disable='' />
						</command>
						<command class_type='call' title='Call Component Macro' textarea='36,0,511,300' cmdcolor='1975743' cmdcolor_sec='1975743' component='v5__rs2320' macro='ReceiveChar' >
							<return exp='RS232_In' />
							<argument exp='20' />
						</command>
						<command class_type='loop' title='Infinite Loop' textarea='36,0,511,300' cmdcolor='3568629' cmdcolor_sec='3568629' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='Call Macro' textarea='36,0,511,300' cmdcolor='1975743' cmdcolor_sec='1975743' macro='int_recieve_packet' />
								<command class_type='delay' title='Delay' textarea='36,0,511,300' cmdcolor='7895044' cmdcolor_sec='7895044' exp='25' type='1' />
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='c73616d1-7ad0-45d9-aada-69ccfa4c5efc' vmin='0' vmaj='2' codename='v5__rs2320' x='0' y='0' z='0' xsz='60' ysz='26' zsz='1.51' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='0' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='CHANNEL' data='1' />
					<value target='BAUD_LIST' data='3' />
					<value target='BAUD' data='9600' />
					<value target='DBITS' data='8' />
					<value target='RETURN' data='0' />
					<value target='ToutVal' data='255' />
					<value target='FLOWEN' data='0' />
					<value target='ECHO' data='0' />
					<value target='cal_uart::TX' data='$PORTC.6' />
					<value target='cal_uart::TXAlt' data='0' />
					<value target='cal_uart::RX' data='$PORTC.7' />
					<value target='cal_uart::RXAlt' data='0' />
					<value target='CTS' data='$PORTB.1' />
					<value target='RTS' data='$PORTB.2' />
					<value target='TXRemap' data='' />
					<value target='RXRemap' data='' />
					<value target='label' data='UART' />
					<value target='ScopeTraces' data='0' />
					<value target='ConsoleData' data='0' />
					<value target='ConsoleColumns' data='64' />
					<value target='DataSource' data='001' />
					<value target='com_port' data='003' />
					<value target='Injector' data='000' />
					<value target='InjectorHandle' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='2105930' img='' style='0' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='15780518' img='' style='0' />
		<table rgb='15780518' img='' style='0' size='0' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' 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---------------------wUAAAAYAAAAzQMAAEMDAAA' zoom='75' scrollx='0' scrolly='8' flags='0' />
		<view type='0' name='check_received_packet' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAzQMAAEMDAAA' zoom='75' scrollx='2903' scrolly='26' flags='0' />
		<view type='0' name='RS232_Rx' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAzQMAAEMDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='respond_to_command' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAzQMAAEMDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='int_recieve_packet' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAzQMAAEMDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
