<root>
<document schema='100' platform='pic8' license='Upgraded,v5 User,******' title='' description='' guid='' target='16F877' >
	<config data='#0,3f7a' clkspd='12288000' simspd='1' usewdt='0' constif='0' />
	<supplement use='1' head='#define COMMS_BUFF_SIZE 50' body='' />
	<debug />
	<components >
		<settings autoimg='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' protect='207' />
		<definition guid='' vmin='0' vmaj='1' visiblename='' description='' category='' dynamic='0' standalone='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' >
			<resources />
			<properties />
			<values />
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='result' type='ubyte' array='0' byref='0' description='' isconst='0' isinit='0' usrinit='0x0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='rx_data' type='string' array='50' byref='0' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='count' type='ubyte' array='0' byref='0' description='' isconst='0' isinit='0' usrinit='0x0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='rx_buff_start' type='ubyte' array='0' byref='0' description='' isconst='0' isinit='0' usrinit='0x0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='rx_buff_end' type='ubyte' array='0' byref='0' description='' isconst='0' isinit='0' usrinit='0x0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='rx_receive_level' type='ubyte' array='0' byref='0' description='' isconst='0' isinit='0' usrinit='0x0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='RS232_In' type='ubyte' array='0' byref='0' description='' isconst='0' isinit='0' usrinit='0x0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='data_out' type='string' array='50' byref='0' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='add_string' type='string' array='10' byref='0' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='data_index' type='ubyte' array='0' byref='0' description='' isconst='0' isinit='0' usrinit='0x0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='csum' type='ubyte' array='0' byref='0' description='' isconst='0' isinit='0' usrinit='0x0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='rx_byte_count' type='ubyte' array='0' byref='0' description='' isconst='0' isinit='0' usrinit='0x0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='rx_buff' type='string' array='50' byref='0' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='unit_address' type='ubyte' array='0' byref='0' description='' isconst='0' isinit='0' usrinit='0x0' setinit='' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='respond_to_command' description='' >
						<local name='result' type='ubyte' array='0' byref='0' description='' isconst='0' isinit='0' usrinit='0x0' setinit='' />
						<local name='tlm' type='string' array='4' byref='0' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' />
						<command class_type='calculation' title='get 3 letter pnemonic' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
							<exp exp='respond_to_command.tlm = Left$ (rx_data,3)' />
						</command>
						<command class_type='comment' title='' comment='CHK Command Starts' ccode='' textshow='1' textmode='0' textarea='12,0,487,300' break='0' mark='0' disable='0' hide='0' customize='0' />
						<command class_type='calculation' title='Check for ACK' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
							<exp exp='respond_to_command.result = Compare$ (respond_to_command.tlm,&quot;CHK&quot;,1)' />
						</command>
						<command class_type='decision' title='check result' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' exp='respond_to_command.result = 0' swap='0' >
							<flowline name='respond_to_command' description='' >
								<command class_type='calculation' title='ACK' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
									<exp exp='data_out = &quot;ACK&quot;' />
								</command>
							</flowline>
							<flowline name='respond_to_command' description='' />
						</command>
						<command class_type='comment' title='' comment='CHK Command Stops' ccode='' textshow='1' textmode='0' textarea='12,0,487,300' break='0' mark='0' disable='0' hide='0' customize='0' />
						<command class_type='comment' title='' comment='RSW Command Starts' ccode='' textshow='1' textmode='0' textarea='12,0,487,300' break='0' mark='0' disable='0' hide='0' customize='0' />
						<command class_type='calculation' title='Check for RSW' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
							<exp exp='respond_to_command.result = Compare$ (respond_to_command.tlm,&quot;RSW&quot;,1)' />
						</command>
						<command class_type='decision' title='check result' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' exp='respond_to_command.result = 0' swap='0' >
							<flowline name='respond_to_command' description='' >
								<command class_type='calculation' title='ACK' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
									<exp exp='data_out = &quot;123 &quot; + &quot;345&quot;' />
								</command>
							</flowline>
							<flowline name='respond_to_command' description='' />
						</command>
						<command class_type='comment' title='' comment='RSW Command Stops' ccode='' textshow='1' textmode='0' textarea='12,0,487,300' break='0' mark='0' disable='0' hide='0' customize='0' />
						<command class_type='comment' title='' comment='DIC Command Starts' ccode='' textshow='1' textmode='0' textarea='12,0,487,300' break='0' mark='0' disable='0' hide='0' customize='0' />
						<command class_type='calculation' title='Check for DIC' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
							<exp exp='respond_to_command.result = Compare$ (respond_to_command.tlm,&quot;DIC&quot;,1)' />
						</command>
						<command class_type='decision' title='check result' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' exp='respond_to_command.result = 0' swap='0' >
							<flowline name='respond_to_command' description='' >
								<command class_type='calculation' title='ACK' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
									<exp exp='data_out = &quot;USB COMMS TEST BOX&quot;' />
								</command>
							</flowline>
							<flowline name='respond_to_command' description='' />
						</command>
						<command class_type='call' title='' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' macro='send_response_string' />
						<command class_type='comment' title='' comment='RSW Command Stops' ccode='' textshow='1' textmode='0' textarea='12,0,487,300' break='0' mark='0' disable='0' hide='0' customize='0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='int_recieve_packet' description='' >
						<command class_type='call' title='check received packet' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' macro='check_received_packet' >
							<return exp='result' />
						</command>
						<command class_type='decision' title='check result' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' exp='result = 1' swap='0' >
							<flowline name='int_recieve_packet' description='' >
								<command class_type='call' title='Respond' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' macro='respond_to_command' />
							</flowline>
							<flowline name='int_recieve_packet' description='' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='RS232_Rx' description='' >
						<command class_type='native' title='Receive character and stick it in the rx input buffer' comment='' 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;

	
	
}

' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='send_response_string' description='send response via RS232' >
						<local name='csum' type='ubyte' array='0' byref='0' description='' isconst='0' isinit='0' usrinit='0x0' setinit='' />
						<local name='byte_count' type='ubyte' array='0' byref='0' description='' isconst='0' isinit='0' usrinit='0x0' setinit='' />
						<local name='counter' type='ubyte' array='0' byref='0' description='' isconst='0' isinit='0' usrinit='0x0' setinit='' />
						<command class_type='output' title='Output' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' mode='2' port='0' mask='1' exp='1' />
						<command class_type='delay' title='Delay' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' exp='10' type='1' />
						<command class_type='calculation' title='csum' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
							<exp exp='send_response_string.csum = 0' />
						</command>
						<command class_type='calculation' title='Data Count' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
							<exp exp='send_response_string.byte_count = Length$ (data_out)' />
						</command>
						<command class_type='call' title='EOP' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' component='v5__rs2320' macro='SendChar' >
							<argument exp='0xFF' />
						</command>
						<command class_type='call' title='EOP' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' component='v5__rs2320' macro='SendChar' >
							<argument exp='0xFF' />
						</command>
						<command class_type='call' title='SOP' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' component='v5__rs2320' macro='SendChar' >
							<argument exp='0xD0' />
						</command>
						<command class_type='call' title='Address' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' component='v5__rs2320' macro='SendChar' >
							<argument exp='unit_address' />
						</command>
						<command class_type='call' title='Byte Count' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' component='v5__rs2320' macro='SendChar' >
							<argument exp='send_response_string.byte_count' />
						</command>
						<command class_type='calculation' title='Calculation' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
							<exp exp='send_response_string.counter = 0' />
						</command>
						<command class_type='loop' title='send all data bytes' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' exp='send_response_string.counter &lt; send_response_string.byte_count' type='0' start='1' count='1' breakend='0' >
							<flowline name='send_response_string' description='' >
								<command class_type='call' title='next data byte' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' component='v5__rs2320' macro='SendChar' >
									<argument exp='data_out[send_response_string.counter]' />
								</command>
								<command class_type='calculation' title='csum' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
									<exp exp='send_response_string.csum = send_response_string.csum + data_out[send_response_string.counter]' />
								</command>
								<command class_type='calculation' title='increase counter' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
									<exp exp='send_response_string.counter = send_response_string.counter + 1' />
								</command>
							</flowline>
						</command>
						<command class_type='calculation' title='csum' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
							<exp exp='send_response_string.csum = send_response_string.csum &amp; 0x7f' />
						</command>
						<command class_type='call' title='send checksum' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' component='v5__rs2320' macro='SendChar' >
							<argument exp='send_response_string.csum' />
						</command>
						<command class_type='call' title='EOP' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' component='v5__rs2320' macro='SendChar' >
							<argument exp='0xFF' />
						</command>
						<command class_type='call' title='EOP' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' component='v5__rs2320' macro='SendChar' >
							<argument exp='0xFF' />
						</command>
						<command class_type='delay' title='Delay' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' exp='30' type='1' />
						<command class_type='output' title='Output' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' mode='2' port='0' mask='1' exp='0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='check_received_packet' description='' >
						<return name='Return' type='ubyte' array='0' byref='0' description='' isconst='0' isinit='0' usrinit='0x0' setinit='' />
						<local name='byte' type='sint' array='0' byref='0' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='No packet received yet' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
							<exp exp='check_received_packet.Return = -1' />
						</command>
						<command class_type='decision' title='byte received?' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' exp='rx_buff_start = rx_buff_end' swap='1' >
							<flowline name='check_received_packet' description='' >
								<command class_type='calculation' title='Get New Byte' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
									<exp exp='check_received_packet.byte = rx_buff[rx_buff_start]' />
								</command>
								<command class_type='native' title='C Code' comment='' ccode='FCV_RX_BUFF_START++;
if(FCV_RX_BUFF_START == COMMS_BUFF_SIZE)
	FCV_RX_BUFF_START = 0;' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' language='C' />
								<command class_type='decision' title='level0' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' exp='rx_receive_level = 0' swap='0' >
									<flowline name='check_received_packet' description='' >
										<command class_type='decision' title='Start Packet?' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' exp='check_received_packet.byte = 0xd0' swap='0' >
											<flowline name='check_received_packet' description='' >
												<command class_type='calculation' title='increase level' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
													<exp exp='rx_receive_level = rx_receive_level + 1' />
												</command>
											</flowline>
											<flowline name='check_received_packet' description='' />
										</command>
									</flowline>
									<flowline name='check_received_packet' description='' >
										<command class_type='decision' title='level1' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' exp='rx_receive_level = 1' swap='0' >
											<flowline name='check_received_packet' description='' >
												<command class_type='decision' title='Right address?' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' exp='check_received_packet.byte = unit_address' swap='0' >
													<flowline name='check_received_packet' description='' >
														<command class_type='calculation' title='increase level' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
															<exp exp='rx_receive_level = rx_receive_level + 1' />
														</command>
													</flowline>
													<flowline name='check_received_packet' description='' >
														<command class_type='calculation' title='reset level' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
															<exp exp='rx_receive_level = 0' />
														</command>
													</flowline>
												</command>
											</flowline>
											<flowline name='check_received_packet' description='' >
												<command class_type='decision' title='level2' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' exp='rx_receive_level = 2' swap='0' >
													<flowline name='check_received_packet' description='' >
														<command class_type='calculation' title='get data count, increase level' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
															<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 name='check_received_packet' description='' >
														<command class_type='decision' title='level3' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' exp='rx_receive_level = 3' swap='0' >
															<flowline name='check_received_packet' description='' >
																<command class_type='calculation' title='store data byte, checksum' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
																	<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?' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' exp='data_index = rx_byte_count' swap='0' >
																	<flowline name='check_received_packet' description='' >
																		<command class_type='calculation' title='increase level' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
																			<exp exp='rx_receive_level = rx_receive_level + 1' />
																		</command>
																	</flowline>
																	<flowline name='check_received_packet' description='' />
																</command>
															</flowline>
															<flowline name='check_received_packet' description='' >
																<command class_type='decision' title='level4' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' exp='rx_receive_level = 4' swap='0' >
																	<flowline name='check_received_packet' description='' >
																		<command class_type='calculation' title='remove top csum bit' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
																			<exp exp='csum = csum &amp; 0x7F' />
																		</command>
																		<command class_type='decision' title='compare checksum' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' exp='csum = check_received_packet.byte' swap='0' >
																			<flowline name='check_received_packet' description='' >
																				<command class_type='calculation' title='increase level' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
																					<exp exp='rx_receive_level = rx_receive_level + 1' />
																				</command>
																			</flowline>
																			<flowline name='check_received_packet' description='' >
																				<command class_type='calculation' title='reset' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
																					<exp exp='rx_receive_level = 0' />
																				</command>
																			</flowline>
																		</command>
																	</flowline>
																	<flowline name='check_received_packet' description='' >
																		<command class_type='decision' title='level5' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' exp='rx_receive_level = 5' swap='0' >
																			<flowline name='check_received_packet' description='' >
																				<command class_type='decision' title='end packet' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' exp='check_received_packet.byte = 0xff' swap='0' >
																					<flowline name='check_received_packet' description='' >
																						<command class_type='calculation' title='Good packet' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
																							<exp exp='check_received_packet.Return = 1' />
																						</command>
																					</flowline>
																					<flowline name='check_received_packet' description='' />
																				</command>
																				<command class_type='calculation' title='reset' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
																					<exp exp='rx_receive_level = 0' />
																				</command>
																			</flowline>
																			<flowline name='check_received_packet' description='' />
																		</command>
																	</flowline>
																</command>
															</flowline>
														</command>
													</flowline>
												</command>
											</flowline>
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline name='check_received_packet' description='' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<command class_type='call' title='' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,36,0' break='0' mark='0' disable='0' hide='0' customize='0' component='v5__rs2320' macro='Initialise' />
						<command class_type='output' title='Output' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' mode='1' port='0' mask='1' exp='0' />
						<command class_type='calculation' title='Calculation' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' >
							<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' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' 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='pie1.RCIE=1;
intcon.PEIE = 1;
set_bit(rcsta, CREN);
intcon.GIE = 1;' disable='' />
						</command>
						<command class_type='call' title='Call Component Macro' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' component='v5__rs2320' macro='ReceiveChar' >
							<return exp='RS232_In' />
							<argument exp='20' />
						</command>
						<command class_type='loop' title='Infinite Loop' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' exp='1' type='0' start='1' count='1' breakend='0' >
							<flowline name='Main' description='' >
								<command class_type='call' title='Call Macro' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' macro='int_recieve_packet' />
								<command class_type='delay' title='Delay' comment='' ccode='' textshow='1' textmode='0' textarea='36,0,511,300' break='0' mark='0' disable='0' hide='0' customize='0' exp='25' type='1' />
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='c73616d1-7ad0-45d9-aada-69ccfa4c5efc' vmin='0' vmaj='0' 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' >
				<resources />
				<properties />
				<values >
					<value target='CHANNEL' data='1' />
					<value target='FLOWEN' data='0' />
					<value target='ECHO' data='0' />
					<value target='BAUD_LIST' data='3' />
					<value target='DBITS' data='8' />
					<value target='RETURN' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
</document>
</root>
