<root>
<document schema='101' license='1,NormanSchroeder1,0BN03P' title='' description='' target='ARM.AT91SAM7S.AT91SAM7S512_64' >
	<config data='' clkspd='47923200' 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='255' />
			<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='0' head='' body='' />
	<debug >
		<watch expr='Touch_DC1' />
		<watch expr='Touch_DC2' />
		<watch expr='Touch_len' />
		<watch expr='Touch_DataByte_0' />
		<watch expr='Touch_DataByte_1' />
		<watch expr='Touch_DataByte_2' />
		<watch expr='Touch_OpenTouchMakro_Nr' />
		<watch expr='Touch_bcc' />
	</debug>
	<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='_3_PWM_EN_Bit' type='b1' description='Bit zur Aktivierung von allen PWM Achsen (EN Eingang)' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='_2_Touch___Task_Cycle_Counter' type='u16' description='Zähl Variable zum Erfassen der Task Cyclen' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='PWM_Cycle_Counter' type='u32' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='false' type='s16' description='' isconst='1' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Bit_PortD_7' type='b1' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='_2_Touch_Bit_SBUFpin' type='b1' description='Status des SBUF Pins von Touch Display' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='_1_Error_Code' type='u8' description='Variable mit aktuellem Error-Code. (Ursprung: Circular Buffer 2)' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='_4_Encoder_Value' type='s16' description='Register mit aktuellem Wert von Encoder Handrad (nicht skaliert)' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='_0_Cycle_Timer1' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='_0_TaskCycle_Timer1' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='_2_Touch_OpenTouchMacroNr' type='u8' description='Nummer des Touch Makros der geöffnet werden soll. (0-255). Danach Marco &quot;OpenTouchMacro&quot; öffnen.' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='PortD_Data' type='u8' description='Port D Statusbyte.' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='_2_Touch___Task_Cycle' type='u16' description='!!!!! Anzahl von Maschinenzyklen für Touch Display Datenanfrage, Achtung Mindestwert einhalten!!!!! SBUF Pin von Display muss nach Aktivierung eine Zeit gesperrt werden. Minimum Cycle= 20  (XTAL: 18,432MHz / Flowcode PLL: 47923200 Hz)' isconst='0' isinit='1' usrinit='500' setinit='500' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='_2_Touch_ButtonNrRequest' type='u8' description='Gibt Wert aus, welcher Touch Button mit Nummer &quot;X&quot; gedrückt wurde. (0x00=Kein Button gedrückt.) Variable muss nach dem Auslesen wieder auf 0x00 gesetzt werden. Zum Aktivieren in Macro &quot;RequestTouchPressed&quot; springen.' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='_3_PWM2_Dir_Bit' type='b1' description='Bit zur Drehrichtungswahl von PWM2' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='_3_PWM0_ManualDriveEN' type='b1' description='Bit zur Auswahl von PWM0 während Handbetrieb über Encoderrad' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='_3_PWM_Speed1_Frequency' type='u8' description='Speed 1 = ca. 0,02 mm/sec.' isconst='0' isinit='1' usrinit='50' setinit='50' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='_3_PWM0_Dir_Bit' type='b1' description='Bit zur Drehrichtungswahl von PWM0' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='_3_PWM_Frequency' type='u8' description='Aktueller skalierter PWM Wert' isconst='0' isinit='1' usrinit='250' setinit='250' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='_3_PWM2_ManualDriveEN' type='u8' description='Bit zur Auswahl von PWM2 während Handbetrieb über Encoderrad' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='_3_PWM_Speed2_Frequency' type='u8' description='Speed 2 = ca. 0,1 mm/sec.' isconst='0' isinit='1' usrinit='100' setinit='100' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='_3_PWM1_Dir_Bit' type='b1' description='Bit zur Drehrichtungswahl von PWM1' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='_1_Error_Code_Bit' type='b1' description='Statusbit zum Signalisieren dass ein Error-Code im Speicher ist.' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='_3_PWM_Speed3_Frequency' type='u8' description='' isconst='0' isinit='1' usrinit='200' setinit='200' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='PWM_High_Low_active' type='b1' description='High active = 1  / Low active = 0' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='True' type='s16' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='_3_PWM1_ManualDriveEN' type='u8' description='Bit zur Auswahl von PWM1 während Handbetrieb über Encoderrad' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='Touch_10_Sub_RequestTouchPressed' description='Subroutine zum Abfragen ob ein Touch Button betätigt wurde. Über Variable ausgegeben wird die Nummer des Touch Buttons. (0x00 = Kein Touch Button betätigt.) 
Variable: _2_TouchMacro_ButtonNrRequest
' >
						<local name='TempData_0' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='TempData_1' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='
********** Subroutine: Serial Request is a Touch Button pressed ? **********

Changeable Values: Values of 3 Error Codes

comes from:
Macro -&gt; Multiple Instances

Programm function detail:
1.) Have Circular Buffer 1 (RXD Memory) Index received 5 bytes (ACK_DC1_len_Data_bcc)
2.) Compare received bytes (&quot;ACK_DC1_len_Data_ not bcc&quot;) and write &quot;Data&quot; Byte to Output Variable
3.) Jump to Touch Command Compare
4.) Reset Variables &amp; Circular Buffer 1 (RXD Memory)

Out Variables:
TouchMacro_ButtonNrRequest ==&gt; Number of the Touch macro wich was pressed (0x00h=No Button pressed)
' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='-------------------- 1.) Have Circular Buffer 1 (RXD Memory) Index received 5 bytes (&quot;ACK_DC1_len_Data_bcc&quot;) --------------------                   ' textarea='36,16,36,16' />
						<command class_type='call' title=' write Index of Circular Buffer 1 (RXD Memory)  in Variable' component='UART0_RXD_Memory' macro='GetNumberBytes' >
							<return exp='.TempData_0' />
						</command>
						<command class_type='decision' title='All Bytes Received ?' exp='.TempData_0 = 5' swap='0' >
							<flowline >
								<command class_type='comment' title='' comment='-------------------- 2.) Compare received bytes (&quot;ACK_DC1_len_Data_ not bcc&quot;) and write &quot;Data&quot; Byte to Output Variable --------------------   
' textarea='36,8,36,8' />
								<command class_type='comment' title='' comment='Read and Compare Touch &quot;ACK&quot; Byte' textarea='12,0,12,0' />
								<command class_type='call' title=' write 1. Byte of Circular Buffer 1 (RXD Memory)  in Variable' textarea='41,5,41,5' component='UART0_RXD_Memory' macro='GetByte' >
									<return exp='.TempData_1' />
								</command>
								<command class_type='decision' title='&quot;ACK&quot; ok ?' exp='.TempData_1 = 0x06' swap='0' >
									<flowline >
										<command class_type='comment' title='' comment='Read &amp; Compare Touch &quot;DC1&quot; Byte' textarea='36,18,36,18' />
										<command class_type='call' title=' write 2. Byte of Circular Buffer 1 (RXD Memory)  in Variable' component='UART0_RXD_Memory' macro='GetByte' >
											<return exp='.TempData_1' />
										</command>
										<command class_type='decision' title='&quot;DC1&quot; ok ?' exp='.TempData_1 = 0x11' swap='0' >
											<flowline >
												<command class_type='comment' title='' comment='Read &amp; Compare Touch &quot;len&quot; Byte' textarea='36,15,36,15' />
												<command class_type='call' title=' write 3. Byte of Circular Buffer 1  (RXD Memory)  in Variable' component='UART0_RXD_Memory' macro='GetByte' >
													<return exp='.TempData_1' />
												</command>
												<command class_type='decision' title='&quot;len&quot; ok ?' exp='.TempData_1 = 0x01' swap='0' >
													<flowline >
														<command class_type='comment' title='' comment='Read &quot;Data&quot; Byte &amp; write to Output Variable' textarea='12,0,12,0' />
														<command class_type='call' title=' write 4. Byte of Circular Buffer 1 (RXD Memory)  in Variable' component='UART0_RXD_Memory' macro='GetByte' >
															<return exp='_2_Touch_ButtonNrRequest' />
														</command>
													</flowline>
													<flowline >
														<command class_type='comment' title='' comment='Error Code &quot;len not OK&quot;' textarea='36,25,36,25' />
														<command class_type='calculation' title='Berechnung' >
															<exp exp='_1_Error_Code = 0x03' />
														</command>
														<command class_type='call' title='Aufruf Komponenten-Makro' component='Error_Code_Memory' macro='PutByte' >
															<argument exp='_1_Error_Code' />
														</command>
													</flowline>
												</command>
											</flowline>
											<flowline >
												<command class_type='comment' title='' comment='Error Code &quot;DC1 not OK&quot;' textarea='46,18,46,18' />
												<command class_type='calculation' title='Berechnung' >
													<exp exp='_1_Error_Code = 0x02' />
												</command>
												<command class_type='call' title='Aufruf Komponenten-Makro' component='Error_Code_Memory' macro='PutByte' >
													<argument exp='_1_Error_Code' />
												</command>
											</flowline>
										</command>
									</flowline>
									<flowline >
										<command class_type='comment' title='' comment='Error Code &quot;ACK not OK&quot;' textarea='36,25,36,25' />
										<command class_type='calculation' title='Berechnung' >
											<exp exp='_1_Error_Code = 0x01' />
										</command>
										<command class_type='call' title='Aufruf Komponenten-Makro' component='Error_Code_Memory' macro='PutByte' >
											<argument exp='_1_Error_Code' />
										</command>
									</flowline>
								</command>
								<command class_type='comment' title='' comment='-------------------- 4.) Reset Variables &amp; Circular Buffer 1 (RXD Memory) --------------------                                                             
' textarea='12,0,12,0' />
								<command class_type='call' title='Reset Circular Buffer 1  (RXD Memory) ' component='UART0_RXD_Memory' macro='FlushBuffer' />
							</flowline>
							<flowline >
								<command class_type='comment' title='' comment='    still not 5
Bytes received' textarea='41,10,41,10' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='COM1_UART1_RXINT_Test' description='' >
						<command class_type='comment' title='' comment='
----- RXINT0 Interrupt in Software = RXD0 / PA21 Pins !!! -----
----- Component RS232 Channel 1 = UART1 Interface !!! -----
.' textarea='12,0,12,0' />
						<command class_type='output' title='Ausgang' mode='1' port='1048578' mask='128' exp='1' />
					</flowline>
				</macro>
				<macro >
					<flowline name='COM3_SPI_TXD_Test' description='' >
						<command class_type='comment' title='' comment='Device Opcode MCP23S17:
0 - 1- 0 - 0 - A2 - A1 - A0 - R/W
R/W=0 --&gt; Write
R/W=1 --&gt; Read' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='GPIO Register (Ad: A=0x12 - B=0x13).

Reset Value: 0000 0000 
Operation: Read/Write

Read from this Register reads Port.
Write to this Register write to OLAT Register

Bit 7 - Bit 0 = I/O 7 - I/O 0
= 1 --&gt; Logic High
= 0 --&gt; Logic Low


Write Value: 0000 0000' textarea='12,0,12,0' />
						<command class_type='output' title='Select SPI Address 1 (CS0)' mode='1' port='1048577' mask='1' exp='0' />
						<command class_type='comment' title='' comment='##################### TX Bytes 1 ##########################' textarea='12,0,12,0' />
						<command class_type='call' title='Send Device Opcode: MCP23S17-1 (Ad.1) - Read Operation ' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x41' />
						</command>
						<command class_type='call' title='Send Adress: GPIO-B (Input)' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x13' />
						</command>
						<command class_type='comment' title='' comment='##################### TX Bytes 2 ##########################' textarea='12,0,12,0' />
						<command class_type='call' title='Send Device Opcode: MCP23S17-1 (Ad.1) - write Operation ' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x40' />
						</command>
						<command class_type='call' title='Send Adress: GPIO-A (Output)' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x12' />
						</command>
						<command class_type='call' title='Send Data GPIO-A = Data' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0xAA' />
						</command>
						<command class_type='delay' title='Warten' disable='1' exp='100' type='1' />
						<command class_type='call' title='Send Device Opcode: MCP23S17-1 (Ad.1) - write Operation ' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x40' />
						</command>
						<command class_type='call' title='Send Adress: GPIO-A (Output)' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x55' />
						</command>
						<command class_type='call' title='Send Data GPIO-A = Data' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x00' />
						</command>
						<command class_type='delay' title='Warten' disable='1' exp='100' type='1' />
						<command class_type='call' title='Send Device Opcode: MCP23S17-1 (Ad.1) - write Operation ' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x40' />
						</command>
						<command class_type='call' title='Send Adress: GPIO-A (Output)' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x12' />
						</command>
						<command class_type='call' title='Send Data GPIO-A = Data' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x0F' />
						</command>
						<command class_type='comment' title='' comment='##################### end TX bytes #################' textarea='51,-30,51,-30' />
						<command class_type='call' title='Send Device Opcode: MCP23S17-1 (Ad.1) - Write Operation ' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x40' />
						</command>
						<command class_type='call' title='Send Adress: GPIO-A (Output)' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x09' />
						</command>
						<command class_type='call' title='Send Data GPIO-A = Data' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0xAA' />
						</command>
						<command class_type='comment' title='' comment='OLAT (Output Latch) Register (AD. 0x0A)

Reset Value: 0000 0000 
Operation: Read/Write

Read from this Register reads OLAT not Port itself.
Write to this Register write to Pins configured as Output

Bit 7 - Bit 0 = I/O 7 - I/O 0
= 1 --&gt; Logic High
= 0 --&gt; Logic Low

Write Value: 0000 0000' textarea='12,0,12,0' />
						<command class_type='call' title='Aufruf Komponenten-Makro' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x55' />
						</command>
						<command class_type='call' title='Aufruf Komponenten-Makro' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0xAA' />
						</command>
						<command class_type='delay' title='Warten' exp='100' type='1' />
						<command class_type='output' title='Deselect SPI Address 1 (CS0)' mode='1' port='1048577' mask='1' exp='1' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Touch_0_RXINT0_ReadTouchData' description='Hardware Interrupt &quot;RXD0&quot; Pin (serial RX Interrupt 0). Beschaltet mit &quot;TXD  Pin&quot; von Touch Display.  Empfängt serielle Daten des Touch Displays und schreibt diese in einen Circularen Speicher.
Variablen: Circular Buffer 1 (Component Macro)
' >
						<local name='Touch_RX_Byte' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='
********** RX Interrupt 0: Receives serial Data from Touch Display and **********
                                       writes to Circular Buffer 1 Memory Storage 


comes from:
Peripheral -&gt; Serial RX Interrupt 0

Programm function detail:
1.) Receive Byte and write to Circular Buffer 1 (RXD Memory)

Out Variables:
Circular Buffer 1 Memory Storage
' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='-------------------- 1.) Receive Byte and write to Circular Buffer 1 (RXD Memory) --------------------                                                            
' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='
----- RXINT1 Interrupt in Software = RXD0 / PA5 Pins !!! -----
----- Component RS232 Channel 2 = UART0 Interface !!! -----
.' textarea='12,0,12,0' />
						<command class_type='call' title='write received Byte in Variable' component='UART0_HMI' macro='ReceiveChar' >
							<return exp='.Touch_RX_Byte' />
							<argument exp='0' />
						</command>
						<command class_type='call' title=' write Variable in next Byte of Circular Buffer 1 (RXD Memory)' component='UART0_RXD_Memory' macro='PutByte' >
							<argument exp='.Touch_RX_Byte' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='COM2_I2C_TXD_Test' description='' >
						<param name='DeviceAddress' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='InternalAddress' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='Data' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Start I²C Transaction' component='I2C_Master1_COM2' macro='Start' />
						<command class_type='call' title='Aufruf Komponenten-Makro' component='I2C_Master1_COM2' macro='TransmitByte' >
							<argument exp='0xAA' />
						</command>
						<command class_type='call' title='Aufruf Komponenten-Makro' component='I2C_Master1_COM2' macro='TransmitByte' >
							<argument exp='0x55' />
						</command>
						<command class_type='call' title='Aufruf Komponenten-Makro' component='I2C_Master1_COM2' macro='TransmitByte' >
							<argument exp='0xAA' />
						</command>
						<command class_type='call' title='Aufruf Komponenten-Makro' component='I2C_Master1_COM2' macro='Stop' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Error_Code_Request' description='' >
						<local name='TempData_0' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='TempBit_0' type='b1' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='
********** Subroutine: Request is an Error Code available **********

Changeable Values:
Bit of Error Status LED. Pin= Port A1
Switch for display Error Code Data. Pin= Port D6
Port for display Error Code Data. Pin= Port D0-D7 (8 Byte)

comes from:
Macro -&gt; Main

Programm function detail:
1.) Is Index of Circular Buffer 2 (Error Memory) &gt; 0 ?
          1a.) Yes: Set Error Status LED
                          Is Button on Port D6 pressed ?
                                        1b.) Yes: Write 1. Error Code for &quot;Time X1&quot; on Port D

In/Out Variables:
Circular Buffer 2 Memory Storage' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='---------- 1.) Is Index of Circular Buffer 2 (Error Memory) &gt; 0 ? ----------' textarea='12,0,12,0' />
						<command class_type='call' title=' write Index of Circular Buffer 2 (Error Memory) in Variable' component='Error_Code_Memory' macro='GetNumberBytes' >
							<return exp='.TempData_0' />
						</command>
						<command class_type='decision' title='Bytes in Buffer ?' exp='.TempData_0 &gt; 0' swap='0' >
							<flowline >
								<command class_type='output' title='Set Error Status LED' mode='1' port='1048576' mask='2' exp='1' />
								<command class_type='comment' title='' comment='----------  1a.) Yes: Button on Port D6 pressed ? ----------' textarea='12,0,12,0' />
								<command class_type='input' title='Eingang' mode='1' port='1048579' mask='64' exp='.TempBit_0' />
								<command class_type='decision' title='Button Port D6 pressed ?' exp='.TempBit_0 = 1' swap='0' >
									<flowline >
										<command class_type='comment' title='' comment='1b.) Yes: Write 1. Error Code for &quot;Time X1&quot; on Port D' textarea='12,0,12,0' />
										<command class_type='call' title='Write 1. Byte of Circular Buffer 2 (Error Memory) in Variable' component='Error_Code_Memory' macro='GetByte' >
											<return exp='_1_Error_Code' />
										</command>
										<command class_type='output' title='Write Error Code to Port D' mode='0' port='1048579' mask='0' exp='_1_Error_Code' />
										<command class_type='delay' title='Time X1' exp='10' type='2' />
										<command class_type='output' title='Clear Port D' mode='0' port='1048579' mask='0' exp='0' />
									</flowline>
									<flowline />
								</command>
								<command class_type='calculation' title='Set Error Code Bit' >
									<exp exp='_1_Error_Code_Bit = 1' />
								</command>
							</flowline>
							<flowline >
								<command class_type='comment' title='' comment='no Error Code in Circular Buffer 2' textarea='12,0,12,0' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='_X10_Main_Program_Start' description='' >
						<command class_type='comment' title='' comment='
********** Programm Structure Distributor **********

!!!!! Testfunction integrated !!!!!

comes from:
Macro -&gt; Main

Programm function detail:
1.) Request is a Touch Button is pressed ?
2.) Manual Encoder PWM Control
3.) Set PWM Frequency
4.) !!!!! Testfunction !!!!!

In/Out Variables:
no
' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='-------------------- 1. Request is a Touch Button pressed ? --------------------                                              ' textarea='12,0,12,0' />
						<command class_type='call' title='Is a Touch Button pressed ?' macro='Touch_0_InitialiseReadTouch' />
						<command class_type='call' title='Get Data of Touch Display' macro='Touch_10_Sub_RequestTouchPressed' />
						<command class_type='decision' title='Is Variable with Touch Data &gt; 0' exp='_2_Touch_ButtonNrRequest &gt; 0' swap='0' >
							<flowline >
								<command class_type='call' title='Touch Command Compare' macro='Touch_50_Sub_TouchCommandCompare' />
							</flowline>
							<flowline />
						</command>
						<command class_type='comment' title='' comment='-------------------- 2.) Manual Encoder PWM Control --------------------                                                          ' textarea='12,0,12,0' />
						<command class_type='call' title='Manual Drive ?' macro='_X11_Encoder_ManualDrive' />
						<command class_type='comment' title='' comment='-------------------- 3.) Set PWM Frequency --------------------                                                                        ' textarea='12,0,12,0' />
						<command class_type='call' title='Set PWM Frequency ?' macro='_X12_PWM_Set_Frequency' />
						<command class_type='comment' title='' comment='-------------------- 4.) !!!!! Testfunction !!!!! --------------------                                                                              ' textarea='12,0,12,0' />
						<command class_type='input' title='Eingang' mode='1' port='1048579' mask='128' exp='Bit_PortD_7' />
						<command class_type='decision' title='Entscheidung' exp='Bit_PortD_7 = 1' swap='0' >
							<flowline >
								<command class_type='comment' title='' comment='Switch Bit 7' textarea='12,0,12,0' />
								<command class_type='call' title='Makro-Aufruf' disable='1' macro='COM1_UART1_TXD_Test' />
								<command class_type='call' title='Get I/O Status' disable='1' macro='COM2_I2C_TXD_Test' >
									<argument exp='0x55' />
									<argument exp='0x11' />
									<argument exp='0x32' />
								</command>
								<command class_type='call' title='Makro-Aufruf' macro='COM3_SPI_TXD_Test' />
								<command class_type='comment' title='' comment='---------- Open Touch Macro with Number &quot;Variable&quot; ----------' textarea='12,0,12,0' />
								<command class_type='calculation' title='Write Number of Touch Macro in Variable' disable='1' >
									<exp exp='_2_Touch_OpenTouchMacroNr = 0x3E' />
								</command>
								<command class_type='call' title='Call - Open Touch Macro' disable='1' macro='Touch_11_Sub_OpenTouchMacro' />
								<command class_type='delay' title='Warten' disable='1' exp='150' type='1' />
								<command class_type='comment' title='' comment='Testfunktion' textarea='46,15,46,15' />
								<command class_type='loop' title='Schleife' disable='1' type='1' exp='Bit_PortD_7 = 0' >
									<flowline >
										<command class_type='delay' title='Warten' exp='100' type='1' />
									</flowline>
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='comment' title='' comment='-------------------- x.) Software Taster Entprellung --------------------                                                                           ' textarea='12,0,12,0' />
						<command class_type='loop' title='Schleife' disable='1' type='1' exp='PortD_Data = 0' >
							<flowline >
								<command class_type='input' title='Eingang' mode='0' port='1048579' mask='0' exp='PortD_Data' />
								<command class_type='delay' title='Warten' exp='100' type='1' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='SYS_Initialise_Peripheral' description='Subroutine zum Initialisieren der Hardware Komponenten' >
						<command class_type='comment' title='' comment='
********** Subroutine: Initialise different Types of Ports and Interrupts **********


comes from:
Macro -&gt; Main

Programm function detail:
1.) Initialise Ports
2.) Initialise Circular Buffer 2 (Error Memory)
3.) Touch Display: Initialise UART0 &amp; Circular Buffer 1 (UART0 RXD Memory)
4.) COM#1: Initialise UART1 &amp; Circular Buffer 4 (UART1 RXD Memory)
5.) COM#2: Initialise I2C Master Interface &amp; Circular Buffer 3 (I2C RXD Memory)
6.) COM#3: Initialise SPI-Master Interface &amp; Circular Buffer 5 (SPI-Bus RXD Memory)
7.) Reset 74HCT154 Adress Decoder
                                  

In/Out Variables:
no' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='-------------------- 1.) Initialise Ports --------------------                                                                                                
' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='***** Don´t write 0 to Ports A,B,C !!!!! (Perihperals) *****' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='PortD used: parallel I/O Ports 0-7' textarea='66,7,66,7' />
						<command class_type='output' title='Clear Data Port D' textarea='36,0,511,300' disable='1' mode='0' port='1048579' mask='0' exp='0' />
						<command class_type='comment' title='' comment='-------------------- 2.) Initialise Circular Buffer 2 (Error Memory) --------------------                                                             
' textarea='12,0,12,0' />
						<command class_type='call' title='Reset Circular Buffer 2 (Error Memory)' component='Error_Code_Memory' macro='FlushBuffer' />
						<command class_type='comment' title='' comment='-------------------- 3.) Touch Display: Initialise UART0 &amp; Circular Buffer 1 (UART0 RXD Memory) --------------------       

Edip Touch Display Pin &quot;TXD&quot; &amp; &quot;SBUF&quot; = 5V Level
CPU Pin: PA20 connected to Display &quot;SBUF&quot; Pin' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='
----- RXINT1 Interrupt in Software = RXD0 / PA5 Pins !!! -----
----- Component RS232 Channel 2 = UART0 Interface !!! -----
.' textarea='12,0,12,0' />
						<command class_type='call' title='Initialise UART0' component='UART0_HMI' macro='Initialise' />
						<command class_type='interrupt' title='Activate UART0' enable='1' name='RXINT1' call='Touch_0_RXINT0_ReadTouchData' >
							<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' />
							</settings>
						</command>
						<command class_type='call' title='Reset Circular Buffer 1 (UART0 RXD Memory)' component='UART0_RXD_Memory' macro='FlushBuffer' />
						<command class_type='comment' title='' comment='-------------------- 4.) COM#1: Initialise UART1 &amp; Circular Buffer 4 (UART1 RXD Memory) --------------------               
' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='
----- RXINT0 Interrupt in Software = RXD0 / PA21 Pins !!! -----
----- Component RS232 Channel 1 = UART1 Interface !!! -----
.' textarea='12,0,12,0' />
						<command class_type='call' title='Initialise UART1' component='UART1_COM1' macro='Initialise' />
						<command class_type='interrupt' title='Activate UART1' enable='1' name='RXINT0' call='COM1_UART1_RXINT_Test' >
							<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' />
							</settings>
						</command>
						<command class_type='call' title='Reset Circular Buffer 4 (UART1 RXD Memory)' component='UART1_RXD_Memory' macro='FlushBuffer' />
						<command class_type='comment' title='' comment='-------------------- 5.) COM#2: Initialise I2C Master Interface &amp; Circular Buffer 3 (I2C RXD Memory) --------------------   
' textarea='12,0,12,0' />
						<command class_type='call' title='Initialise I2C Master' textshow='0' component='I2C_Master1_COM2' macro='Initialise' />
						<command class_type='call' title='Reset Circular Buffer 3 (I2C RXD Memory)' component='I2C_RXD_Memory' macro='FlushBuffer' />
						<command class_type='comment' title='' comment='-------------------- 6.) COM#3: Initialise SPI-Master Interface &amp; Circular Buffer 5 (SPI-Bus RXD Memory) --------------------
' textarea='12,0,12,0' />
						<command class_type='call' title='Initialise SPI Master' component='SPI_Master1_COM3' macro='Initialise' />
						<command class_type='call' title='Reset Circular Buffer 5 (SPI RXD Memory)' component='SPI_RXD_Memory' macro='FlushBuffer' />
						<command class_type='comment' title='' comment='-------------------- 7.) Reset 74HCT154 Adress Decoder --------------------                                                                        
' textarea='12,0,12,0' />
						<command class_type='output' title='Ausgang' mode='1' port='1048577' mask='1' exp='1' />
						<command class_type='output' title='Ausgang' mode='1' port='1048577' mask='2' exp='1' />
						<command class_type='output' title='Ausgang' mode='1' port='1048577' mask='4' exp='1' />
						<command class_type='output' title='Ausgang' mode='1' port='1048577' mask='8' exp='1' />
						<command class_type='calculation' title='Berechnung' disable='1' />
					</flowline>
				</macro>
				<macro >
					<flowline name='COM1_UART1_TXD_Test' description='' >
						<command class_type='call' title='Aufruf Komponenten-Makro' component='UART1_COM1' macro='SendChar' >
							<argument exp='0x55' />
						</command>
						<command class_type='call' title='Aufruf Komponenten-Makro' component='UART1_COM1' macro='SendChar' >
							<argument exp='0xAA' />
						</command>
						<command class_type='call' title='Aufruf Komponenten-Makro' component='UART1_COM1' macro='SendChar' >
							<argument exp='0x0F' />
						</command>
						<command class_type='call' title='Aufruf Komponenten-Makro' component='UART1_COM1' macro='SendChar' >
							<argument exp='0xF0' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='_X11_Encoder_ManualDrive' description='Turns PWM0 Enable Signal on/off. When PWM0 is Enable it reads the Encoder Counter and write it to Variable and jump to Macro for Value scalation. Further there is a Programoption for reset Encoder Counter over Button. ' >
						<local name='TempData_0' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='Encoder_Value' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='PWM0_Cycle' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='Bit_PortD_6' type='b1' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='Bit_PortD_5' type='b1' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='Bit_PortD_0' type='b1' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='
********** Subroutine: Driving PWM manually over Encoder **********

Changeable Values:
Switch for Reset hand wheel Encoder Counter. Pin = Port D5

comes from:
Macro -&gt; _X1_Main_Program_Start

Programm function detail:
1.) Switch Port xx for Enable &quot;Manual Drive&quot; pressed ?
              1.a) Yes: Turn on/off &quot;Enable&quot; Pin of PWM Board
2.) Is PWM0 Enable Active?
              2.a) Yes: Has Encoder Counter Register changed since last time ?
                       No: Reset Variables
                              2.b) Yes: write Encoder Counter Value in Output Variable
                                            Jump to Macro for Value scalation
                              2.c) No: Encoder Counter register Overflow ?
                              2.d) Is Switch Port xx for Reset Encoder Counter pressed ?
                                        2.e) Yes: Reset all Variables

Input Variables:
_4_Encoder_Value: Actual Value of the Encoder Counter Register

Output Variables:
_3_PWM_Frequency' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='---------- 1.) Switch Port D6 for Enable Manual Drive pressed ? ----------' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='----- HMI Touch Button -----' textarea='12,0,12,0' />
						<command class_type='input' title='Eingang' disable='1' mode='1' port='1048579' mask='64' exp='.Bit_PortD_6' />
						<command class_type='decision' title='Is Switch Port D6 Enable' disable='1' exp='_0_Cycle_Timer1 = 0' swap='0' >
							<flowline >
								<command class_type='decision' title='Switch Port D6 pressed ?' exp='.Bit_PortD_6 = 1' swap='0' >
									<flowline >
										<command class_type='comment' title='' comment='---------- 1.a) Turn on/off &quot;Enable&quot; Pin for PWM0 Board ----------' textarea='12,0,12,0' />
										<command class_type='calculation' title='Decrement Bool Variable' >
											<exp exp='_3_PWM_EN_Bit = _3_PWM_EN_Bit - 1' />
										</command>
										<command class_type='output' title='Set/Clear PWM0 Enable Port' mode='1' port='1048579' mask='1' exp='_3_PWM_EN_Bit' />
										<command class_type='comment' title='' comment='Testfunktion Durchgangstimer' textarea='12,0,12,0' />
										<command class_type='calculation' title='Disable Port D6 fox &quot;X&quot; Cycles' >
											<exp exp='_0_Cycle_Timer1 = 25000' />
										</command>
										<command class_type='delay' title='wait' disable='1' exp='300' type='1' />
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline >
								<command class_type='comment' title='' comment='Port D6 is for &quot;X&quot; Cycles disabled after pressing Button' textarea='12,0,12,0' />
								<command class_type='calculation' title='Port Disable Counter -1' >
									<exp exp='_0_Cycle_Timer1 = _0_Cycle_Timer1 - 1' />
								</command>
							</flowline>
						</command>
						<command class_type='comment' title='' comment='---------- 2.) Is PWM0 Enable Active? ----------' textarea='12,0,12,0' />
						<command class_type='decision' title='Is PWM0 Enable ?' exp='_3_PWM_EN_Bit = 1' swap='0' >
							<flowline >
								<command class_type='comment' title='' comment='----------  2.a) Yes: Has Encoder Counter Register changed since last time ? ----------' textarea='12,0,12,0' />
								<command class_type='call' title='Enable PWM0' component='PWM' macro='Enable' />
								<command class_type='call' title='Enable Encoder' component='QuadEncoder1' macro='Enable' />
								<command class_type='call' title='Check for changes &amp; write to Var.' component='QuadEncoder1' macro='CheckForChanges' >
									<return exp='.TempData_0' />
								</command>
								<command class_type='decision' title='Encoder wheel changed sinse last time' exp='.TempData_0 = 1' swap='0' >
									<flowline >
										<command class_type='comment' title='' comment='---------- 2.b) Yes: write Encoder Counter Value in Output Variable ----------' textarea='12,0,12,0' />
										<command class_type='call' title='Read Counter Value and write to Output Variable' component='QuadEncoder1' macro='ReadCounter' >
											<return exp='_4_Encoder_Value' />
										</command>
										<command class_type='comment' title='' comment='---------- Encoder Value Scalation ----------' textarea='12,0,12,0' />
										<command class_type='call' title='Open Macro Output Variable Scalation' macro='_X11a_Encoder_ValueScalation' />
									</flowline>
									<flowline >
										<command class_type='comment' title='' comment='---------- 2.c) No: Encoder Counter register Overflow ? ----------' textarea='12,0,12,0' />
										<command class_type='decision' title='Overflow in Encoder Counter Register ?' exp='.TempData_0 = 255' swap='0' >
											<flowline >
												<command class_type='call' title='Reset Counter' component='QuadEncoder1' macro='ResetCounter' />
											</flowline>
											<flowline />
										</command>
									</flowline>
								</command>
								<command class_type='comment' title='' comment='---------- 2.d) Is Switch Port xx for Reset Encoder Counter pressed ? ----------' textarea='12,0,12,0' />
								<command class_type='input' title='Eingang' mode='1' port='1048579' mask='32' exp='.Bit_PortD_5' />
								<command class_type='comment' title='' comment='----- HMI Touch Button -----' textarea='12,0,12,0' />
								<command class_type='decision' title='Port D5 pressed ?' exp='.Bit_PortD_5 = 1' swap='0' >
									<flowline >
										<command class_type='comment' title='' comment='---------- 2.e) Yes: Reset all Variables ----------' textarea='12,0,12,0' />
										<command class_type='call' title='Reset Encoder Counter' component='QuadEncoder1' macro='ResetCounter' />
										<command class_type='calculation' title='Reset Encoder &amp; PWM Variable' >
											<exp exp='_4_Encoder_Value = 0' />
											<exp exp='_3_PWM_Frequency = 0' />
										</command>
										<command class_type='delay' title='Warten' exp='300' type='1' />
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline >
								<command class_type='comment' title='' comment='Reset all Encoder Variables' textarea='12,0,12,0' />
								<command class_type='call' title='Reset Encoder Counter' component='QuadEncoder1' macro='ResetCounter' />
								<command class_type='call' title='Disable Encoder' component='QuadEncoder1' macro='Disable' />
								<command class_type='calculation' title='Reset Input/Output Variables' >
									<exp exp='_4_Encoder_Value = 0' />
									<exp exp='_3_PWM_Frequency = 0' />
								</command>
								<command class_type='comment' title='' comment='!!!!!!!!!! Disable PWM !!!!!!!!!!' textarea='12,0,12,0' />
								<command class_type='call' title='Disable PWM' component='PWM' macro='Disable' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='_X11a_Encoder_ValueScalation' description='Value Scalation for Encoder hand wheel in &quot;Manual Drive&quot; Mode.' >
						<command class_type='comment' title='' comment='
********** Scaltes the Encoder Counter Value for Handwheel use **********

!!!!! Testfunction integrated !!!!!

comes from:
Subroutine -&gt; _X2_Encoder_ManualDrive

Changeable Values:
Hand wheel Encoder Counts to Start and Stop Speed 1-x &amp; logarithmic drive (Values: X1R/X1L/X2R/X2L/XR/XL)
(X1R/X1L/X2R/X2L/XR/XL)

Programm function detail:
1.) Stop or Left/Right Direction (changeable Values)
2.) Speed 1 or Speed 2 Left/Right Direction (changeable Values)
3.) Speed 2 or Logarithmic Curve Left/Right Direction


Input/Output Variables:
_4_Encoder_Value: Value of the actual Encoder Counter Register

Output Variables:
_3_PWM_Frequency: Frequency Value for driving PWM0 Port' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='---------- 1.) Stop or Left/Right Direction (changeable Values) ----------                                                                               ' textarea='71,-20,71,-20' />
						<command class_type='comment' title='' comment='Value how many Encoder Pulses to Start Speed 1 in Right Direction

_0_______right_____X1R
    &lt;------ Stop Area ------&gt;' textarea='12,0,12,0' />
						<command class_type='decision' title='Stop or Right Direction ? (Value X1R)' exp='_4_Encoder_Value &gt; 20' swap='0' >
							<flowline >
								<command class_type='output' title='Set Direction Right' mode='1' port='1048579' mask='2' exp='0' />
								<command class_type='comment' title='' comment='---------- 2.) Speed 1 or Speed 2 Right Direction (changeable Values) ----------' textarea='71,-20,71,-20' />
								<command class_type='comment' title='' comment='Value how many Encoder Pulses for Speed 1 or Speed 2 in Right Direction

_0___right___X1R____Speed 1____X2R____Speed 2____XR
                             &lt;---Speed 1 Area---&gt;    &lt;---Speed 2 Area---&gt;' textarea='12,0,12,0' />
								<command class_type='decision' title='Right Direction: Speed 1 or Speed 2 ? (Value X2R)' exp='_4_Encoder_Value &gt; 30' swap='0' >
									<flowline >
										<command class_type='comment' title='' comment='---------- 3.) Speed 2 or Logarithmic Curve Right Direction (changeable Values) ----------' textarea='12,0,12,0' />
										<command class_type='decision' title='Right Direction: Speed 2 or Logarithmic Curve (Value XR)' exp='_4_Encoder_Value &gt; 40' swap='0' >
											<flowline >
												<command class_type='comment' title='' comment='Logarithmic Curve Right' textarea='12,0,12,0' />
												<command class_type='comment' title='' comment='!!!!!!!!!! Testfunction !!!!!!!!!!!' textarea='12,0,12,0' />
												<command class_type='output' title='Ausgang' disable='1' mode='1' port='1048576' mask='8' exp='1' />
												<command class_type='calculation' title='Write Speed 2 Var. to PWM Variable' textarea='36,0,1036,0' >
													<exp exp='_3_PWM_Frequency = _4_Encoder_Value' />
												</command>
												<command class_type='call' title='Aufruf Komponenten-Makro' disable='1' component='PWM' macro='Disable' />
												<command class_type='call' title='Aufruf Komponenten-Makro' disable='1' component='PWM' macro='ChangePeriod' >
													<argument exp='8' />
													<argument exp='256' />
												</command>
												<command class_type='call' title='Aufruf Komponenten-Makro' disable='1' component='PWM' macro='Enable' />
											</flowline>
											<flowline >
												<command class_type='comment' title='' comment='2. Speed Right' textarea='12,0,12,0' />
												<command class_type='comment' title='' comment='!!!!!!!!!! Testfunction !!!!!!!!!!!' textarea='12,0,12,0' />
												<command class_type='output' title='Ausgang' disable='1' mode='1' port='1048576' mask='8' exp='0' />
												<command class_type='output' title='Ausgang' disable='1' mode='1' port='1048576' mask='4' exp='1' />
												<command class_type='calculation' title='Write Speed 2 Var. to PWM Variable' >
													<exp exp='_3_PWM_Frequency = 3' />
												</command>
												<command class_type='call' title='Aufruf Komponenten-Makro' disable='1' component='PWM' macro='Disable' />
												<command class_type='call' title='Aufruf Komponenten-Makro' disable='1' component='PWM' macro='ChangePeriod' >
													<argument exp='255' />
													<argument exp='256' />
												</command>
												<command class_type='call' title='Aufruf Komponenten-Makro' disable='1' component='PWM' macro='Enable' />
											</flowline>
										</command>
										<command class_type='comment' title='' comment='2. Speed Right' textarea='12,0,12,0' />
									</flowline>
									<flowline >
										<command class_type='comment' title='' comment='1. Speed Right' textarea='12,0,12,0' />
										<command class_type='comment' title='' comment='!!!!!!!!!! Testfunction !!!!!!!!!!!' textarea='12,0,12,0' />
										<command class_type='output' title='Ausgang' disable='1' mode='1' port='1048576' mask='4' exp='0' />
										<command class_type='calculation' title='Write Speed 2 Var. to PWM Variable' >
											<exp exp='_3_PWM_Frequency = 2' />
										</command>
										<command class_type='call' title='Aufruf Komponenten-Makro' disable='1' component='PWM' macro='ChangePeriod' >
											<argument exp='255' />
											<argument exp='512' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='comment' title='' comment='Stop' textarea='12,0,12,0' />
								<command class_type='comment' title='' comment='Value how many Encoder Pulses to Start Speed 1 in Left Direction

X1L______left______0_
   &lt;------ Stop Area ------&gt;' textarea='12,0,12,0' />
								<command class_type='decision' title='Stop or Left Direction ? (Value X1L)' exp='_4_Encoder_Value &lt; -20' swap='0' >
									<flowline >
										<command class_type='output' title='Set Direction Left' mode='1' port='1048579' mask='2' exp='1' />
										<command class_type='comment' title='' comment='---------- 2.) Speed 1 or Speed 2 Left Direction (changeable Values) ----------    ' textarea='71,-20,71,-20' />
										<command class_type='comment' title='' comment='Value how many Encoder Pulses for Speed 1 or Speed 2 in Left Direction

_XL____Speed 2____X2L____Speed 1____X1L___left___0_
    &lt;---Speed 2 Area---&gt;  &lt;---Speed 1 Area---&gt;' textarea='12,0,12,0' />
										<command class_type='decision' title='Left Direction: Speed 1 or Speed 2 ? (Value X2L)' exp='_4_Encoder_Value &lt; -30' swap='0' >
											<flowline >
												<command class_type='comment' title='' comment='---------- 3.) Speed 2 or Logarithmic Curve Left Direction ----------' textarea='12,0,12,0' />
												<command class_type='decision' title='Left Direction: Speed 2 or Logarithmic Curve (Value XL)' exp='_4_Encoder_Value &lt; -40' swap='0' >
													<flowline >
														<command class_type='comment' title='' comment='Logarithmic Curve Left' textarea='12,0,512,0' />
														<command class_type='comment' title='' comment='!!!!!!!!!! Testfunction !!!!!!!!!!!' textarea='12,0,12,0' />
														<command class_type='output' title='Ausgang' disable='1' mode='1' port='1048576' mask='8' exp='1' />
													</flowline>
													<flowline >
														<command class_type='comment' title='' comment='2. Speed Left' textarea='12,0,12,0' />
														<command class_type='comment' title='' comment='!!!!!!!!!! Testfunction !!!!!!!!!!!' textarea='12,0,12,0' />
														<command class_type='output' title='Ausgang' disable='1' mode='1' port='1048576' mask='8' exp='0' />
														<command class_type='output' title='Ausgang' disable='1' mode='1' port='1048576' mask='4' exp='1' />
														<command class_type='calculation' title='Write Speed 2 Var. to PWM Variable' textarea='36,0,786,0' >
															<exp exp='_3_PWM_Frequency = _3_PWM_Speed2_Frequency' />
														</command>
													</flowline>
												</command>
											</flowline>
											<flowline >
												<command class_type='comment' title='' comment='1. Speed Left' textarea='12,0,12,0' />
												<command class_type='comment' title='' comment='!!!!!!!!!! Testfunction !!!!!!!!!!!' textarea='12,0,12,0' />
												<command class_type='output' title='Ausgang' disable='1' mode='1' port='1048576' mask='4' exp='0' />
												<command class_type='calculation' title='Write Speed 2 Var. to PWM Variable' textarea='36,-5,780,-5' >
													<exp exp='_3_PWM_Frequency = _3_PWM_Speed1_Frequency' />
												</command>
											</flowline>
										</command>
									</flowline>
									<flowline >
										<command class_type='comment' title='' comment='Stop' textarea='12,0,12,0' />
										<command class_type='comment' title='' comment='PWM0 Stop' textarea='12,0,12,0' />
										<command class_type='calculation' title='Reset PWM Variable' >
											<exp exp='_3_PWM_Frequency = 0' />
										</command>
									</flowline>
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Touch_50_Sub_TouchCommandCompare' description='Subroutine zum Abfragen der HMI Steuerbefehle nach gedrücktem Touch Button.' >
						<command class_type='comment' title='' comment='
********** Subroutine: Compare received Touch Data with Control Commands **********

!!!!! Testfunction integrated !!!!!

comes from:
Macro -&gt; Multiple Instances

Programm function detail:
1.) Compare received Bytes
2.) Reset Input Variable

Input Variables:
TouchMacro_ButtonNrRequest ==&gt; Number of the Touch macro wich was pressed
' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='-------------------- 1.) Compare received Bytes --------------------                                            ' textarea='12,0,12,0' />
						<command class_type='switch' title='Command Compare 1-9' textarea='36,170,36,170' exp='_2_Touch_ButtonNrRequest' >
							<case >
								<flowline />
							</case>
							<case exp='1' >
								<flowline />
							</case>
							<case exp='2' >
								<flowline />
							</case>
							<case exp='3' >
								<flowline />
							</case>
							<case exp='4' >
								<flowline />
							</case>
							<case exp='5' >
								<flowline />
							</case>
							<case exp='6' >
								<flowline />
							</case>
							<case exp='7' >
								<flowline />
							</case>
							<case exp='8' >
								<flowline />
							</case>
							<case exp='9' >
								<flowline />
							</case>
						</command>
						<command class_type='switch' title='Command Compare 10-19' textarea='36,170,36,170' exp='_2_Touch_ButtonNrRequest' >
							<case >
								<flowline />
							</case>
							<case exp='10' >
								<flowline />
							</case>
							<case exp='11' >
								<flowline />
							</case>
							<case exp='12' >
								<flowline />
							</case>
							<case exp='13' >
								<flowline />
							</case>
							<case exp='14' >
								<flowline />
							</case>
							<case exp='15' >
								<flowline />
							</case>
							<case exp='16' >
								<flowline />
							</case>
							<case exp='17' >
								<flowline />
							</case>
							<case exp='18' >
								<flowline />
							</case>
							<case exp='19' >
								<flowline />
							</case>
						</command>
						<command class_type='switch' title='Command Compare 20-29' textarea='36,170,36,170' exp='_2_Touch_ButtonNrRequest' >
							<case >
								<flowline />
							</case>
							<case exp='20' >
								<flowline />
							</case>
							<case exp='21' >
								<flowline />
							</case>
							<case exp='22' >
								<flowline />
							</case>
							<case exp='23' >
								<flowline />
							</case>
							<case exp='24' >
								<flowline />
							</case>
							<case exp='25' >
								<flowline />
							</case>
							<case exp='26' >
								<flowline />
							</case>
							<case exp='27' >
								<flowline />
							</case>
							<case exp='28' >
								<flowline />
							</case>
							<case exp='29' >
								<flowline />
							</case>
						</command>
						<command class_type='switch' title='Command Compare 30-39' textarea='41,155,1041,155' exp='_2_Touch_ButtonNrRequest' >
							<case >
								<flowline />
							</case>
							<case exp='30' >
								<flowline >
									<command class_type='comment' title='' comment='Drive Axis Enable/Disable' textarea='12,0,12,0' />
									<command class_type='calculation' title='Decrement Bool Variable' textarea='36,0,511,0' >
										<exp exp='_3_PWM_EN_Bit = _3_PWM_EN_Bit - 1' />
									</command>
									<command class_type='output' title='Set/Clear PWM0 Enable Port' mode='1' port='1048579' mask='1' exp='_3_PWM_EN_Bit' />
								</flowline>
							</case>
							<case exp='31' >
								<flowline >
									<command class_type='comment' title='' comment='Reset Handwheel Counter' textarea='12,0,12,0' />
									<command class_type='call' title='Reset Encoder Counter' component='QuadEncoder1' macro='ResetCounter' />
									<command class_type='calculation' title='Reset Encoder &amp; PWM Variable' >
										<exp exp='_4_Encoder_Value = 0' />
										<exp exp='_3_PWM_Frequency = 0' />
									</command>
								</flowline>
							</case>
							<case exp='32' >
								<flowline >
									<command class_type='comment' title='' comment='PWM0 Drive Enable' textarea='12,0,12,0' />
									<command class_type='calculation' title='Decrement Bool Variable' textarea='36,0,461,0' >
										<exp exp='_3_PWM0_ManualDriveEN = _3_PWM0_ManualDriveEN - 1' />
										<exp exp='' />
									</command>
									<command class_type='calculation' title='Reset PWM1 &amp; PWM2' textarea='36,0,471,0' >
										<exp exp='_3_PWM1_ManualDriveEN = 0' />
										<exp exp='_3_PWM2_ManualDriveEN = 0' />
									</command>
								</flowline>
							</case>
							<case exp='33' >
								<flowline >
									<command class_type='comment' title='' comment='PWM1 Drive  Enable' textarea='12,0,12,0' />
									<command class_type='calculation' title='Decrement Bool Variable' textarea='36,0,486,0' >
										<exp exp='_3_PWM1_ManualDriveEN = _3_PWM1_ManualDriveEN - 1' />
										<exp exp='' />
									</command>
									<command class_type='calculation' title='Reset PWM0 &amp; PWM2' textarea='36,0,491,0' >
										<exp exp='_3_PWM0_ManualDriveEN = 0' />
										<exp exp='_3_PWM2_ManualDriveEN = 0' />
									</command>
								</flowline>
							</case>
							<case exp='34' >
								<flowline >
									<command class_type='comment' title='' comment='PWM2 Drive  Enable' textarea='12,0,12,0' />
									<command class_type='calculation' title='Decrement Bool Variable' textarea='36,0,506,198' >
										<exp exp='_3_PWM2_ManualDriveEN = _3_PWM2_ManualDriveEN - 1' />
										<exp exp='' />
									</command>
									<command class_type='calculation' title='Reset PWM0 &amp; PWM1' textarea='36,0,531,0' >
										<exp exp='_3_PWM0_ManualDriveEN = 0' />
										<exp exp='_3_PWM1_ManualDriveEN = 0' />
									</command>
								</flowline>
							</case>
							<case exp='35' >
								<flowline />
							</case>
							<case exp='36' >
								<flowline />
							</case>
							<case exp='37' >
								<flowline />
							</case>
							<case exp='38' >
								<flowline />
							</case>
							<case exp='39' >
								<flowline />
							</case>
						</command>
						<command class_type='switch' title='Command Compare 40-49' textarea='36,170,36,170' exp='_2_Touch_ButtonNrRequest' >
							<case >
								<flowline />
							</case>
							<case exp='40' >
								<flowline />
							</case>
							<case exp='41' >
								<flowline />
							</case>
							<case exp='42' >
								<flowline />
							</case>
							<case exp='43' >
								<flowline />
							</case>
							<case exp='44' >
								<flowline />
							</case>
							<case exp='45' >
								<flowline />
							</case>
							<case exp='46' >
								<flowline />
							</case>
							<case exp='47' >
								<flowline />
							</case>
							<case exp='48' >
								<flowline />
							</case>
							<case exp='49' >
								<flowline />
							</case>
						</command>
						<command class_type='switch' title='Command Compare 50-59' textarea='36,170,36,170' exp='_2_Touch_ButtonNrRequest' >
							<case >
								<flowline />
							</case>
							<case exp='50' >
								<flowline />
							</case>
							<case exp='51' >
								<flowline />
							</case>
							<case exp='52' >
								<flowline />
							</case>
							<case exp='53' >
								<flowline />
							</case>
							<case exp='54' >
								<flowline />
							</case>
							<case exp='55' >
								<flowline />
							</case>
							<case exp='56' >
								<flowline />
							</case>
							<case exp='57' >
								<flowline />
							</case>
							<case exp='58' >
								<flowline />
							</case>
							<case exp='59' >
								<flowline />
							</case>
						</command>
						<command class_type='comment' title='' comment='-------------------- 2.) Reset Input Variable --------------------                                            ' textarea='12,0,12,0' />
						<command class_type='calculation' title='Berechnung' >
							<exp exp='_2_Touch_ButtonNrRequest = 0' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='COM2_I2C_RXD_Test' description='' >
						<return name='Return' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='DeviceAddress' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='InternalAddress' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Start I²C Transaction' component='I2C_Master1_COM2' macro='Start' />
						<command class_type='call' title='Device Address + Write bit' component='I2C_Master1_COM2' macro='TransmitByte' >
							<argument exp='0xAA' />
						</command>
						<command class_type='call' title='Device Address + Write bit' component='I2C_Master1_COM2' macro='TransmitByte' >
							<argument exp='0xAA' />
						</command>
						<command class_type='call' title='Device Address + Write bit' component='I2C_Master1_COM2' macro='TransmitByte' >
							<argument exp='0xAA' />
						</command>
						<command class_type='call' title='Restart I2C' component='I2C_Master1_COM2' macro='Restart' />
						<command class_type='call' title='Device Address + Read bit' component='I2C_Master1_COM2' macro='TransmitByte' >
							<argument exp='0x55' />
						</command>
						<command class_type='call' title='Receive Data' ccode='// Aufruf Komponenten-Makro
// Aufruf Komponenten-Makro: I2C_Master1::ReceiveByte(1)
FCD_005f1_I2C_Master1__ReceiveByte(1);
' component='I2C_Master1_COM2' macro='ReceiveByte' >
							<return exp='.Return' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Stop I²C Transaction' component='I2C_Master1_COM2' macro='Stop' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Touch_0_InitialiseReadTouch' description='Initialisiert Touch Display zum seriellen senden der Daten welcher Touch Button betätigt wurde. Aufruf per Hardware CPU Pin. Beschaltet mit &quot;SBUF&quot; Pin von Touch Display. Einstellbarer Task Zyklus
Variablen: Keine ' >
						<local name='Touch_bcc_Calc' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0x00' />
						<command class_type='comment' title='' comment='
********** Initialise Display to Send Data of pressed Touch Buttons **********
                                             


comes from:
Macro -&gt; _X10_Main_Program_Start

Changeable Values:
Bit of Display &quot;SBUF&quot; Signal. Pin= Port A7

Program function detail:
1.) Task Cycle: Is a Touch Button pressed (SBUF Pin=0)
2.) Send serial command to display: &quot;Inhalt des Sendepuffers anfordern&quot;

In/Out Variables:
no' textarea='12,0,12,0' />
						<command class_type='decision' title='Task Cyclic Activation ?' exp='_2_Touch___Task_Cycle_Counter = 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Task Cycle reload' >
									<exp exp='_2_Touch___Task_Cycle_Counter = _2_Touch___Task_Cycle' />
								</command>
								<command class_type='comment' title='' comment='-------------------- 1.) Task Cycle: Is a Touch Button pressed (SBUF Pin=0) --------------------                 
' textarea='12,0,12,0' />
								<command class_type='input' title='write Status of Touch Display SBUF Pin in Variable' mode='1' port='1048576' mask='128' exp='_2_Touch_Bit_SBUFpin' />
								<command class_type='decision' title='SBUF Pin =0 ?' exp='_2_Touch_Bit_SBUFpin = 0' swap='0' >
									<flowline >
										<command class_type='comment' title='' comment='-------------------- 2.) Send serial command to display: &quot;Inhalt des Sendepuffers anfordern&quot; --------------------                 
' textarea='12,0,12,0' />
										<command class_type='comment' title='' comment='Transmit Data:

&quot;DC2&quot; = 0x12
&quot;1&quot;      = 0x01
&quot;S&quot;      = 0x53
&quot;bcc&quot;   = calculation' textarea='12,0,12,0' />
										<command class_type='calculation' title='Berechnung Prüfsumme aus allen Bytes' >
											<exp exp='.Touch_bcc_Calc = 0x00' />
											<exp exp='.Touch_bcc_Calc = 0x12 + 0x01 + 0x53' />
											<exp exp='' />
										</command>
										<command class_type='call' title='Testfunction' disable='1' component='UART0_HMI' macro='SendString' >
											<argument exp='&quot;cannot TX Array @Reg&quot;' />
										</command>
										<command class_type='call' title='TXD &quot;DC2&quot; to Touch Display' component='UART0_HMI' macro='SendChar' >
											<argument exp='0x12' />
										</command>
										<command class_type='call' title='TXD &quot;1&quot; to Touch Display' component='UART0_HMI' macro='SendChar' >
											<argument exp='0x01' />
										</command>
										<command class_type='call' title='TXD &quot;S&quot; to Touch Display' component='UART0_HMI' macro='SendChar' >
											<argument exp='0x53' />
										</command>
										<command class_type='call' title='TXD &quot;bcc&quot; to Touch Display' component='UART0_HMI' macro='SendChar' >
											<argument exp='.Touch_bcc_Calc' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Task Cycle Counter -1' textarea='36,0,798,0' >
									<exp exp='_2_Touch___Task_Cycle_Counter = _2_Touch___Task_Cycle_Counter - 1' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='SYS_TaskCycleSynchronisation' description='Synchronisierung der seriellen Datenabfragen bei Pollingbetrieb von COM#1.' >
						<command class_type='comment' title='' comment='
********** Subroutine: Task Synchronisation if COM#1 is polled **********


comes from:
Macro -&gt; Main

Programm function detail:
1.) 
2.) 

In/Out Variables:
no' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='Task synchronisation UART1 - Universal Data Communication (COM#1)' textarea='39,1,39,1' />
						<command class_type='comment' title='' comment='Task synchronisation UART0 - HMI COM' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='Task synchronisation I2C Master 1 - Peripheral I/O (COM#2)' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='Task synchronisation SPI Master 1 - Peripheral I/O (COM#3)' textarea='12,0,12,0' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Touch_11_Sub_OpenTouchMacro' description='Subroutine zum Öffnen eines Touch Macros. Über Variable eingegeben wird die Nummer des zu öffnenden Touch Macros. 
Variable: _2_TouchMacro_OpenTouchMacroNr' >
						<local name='Touch_bcc_Calc' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='TempData_0' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='TempData_1' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='comment' title='' comment='
********** Subroutine: Open Touch Macro with Number &quot;x&quot; **********


comes from:
Macro -&gt; Multiple Instances

Programm function detail:
1.) Send serial command to display &quot;Touch Makro mit Nummer &quot;n1&quot; öffnen&quot;
2.) clear Circular Buffer 1 Memory and Checkout Acknowledge 
3.) Reset Variables and clear Circular Buffer 1 Memory

In Variables:
TouchMacro_OpenTouchMacroNr ==&gt; Number of the Touch macro for open (0x00h)
' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='-------------------- 1.) Send serial command to display &quot;Touch Makro mit Nummer &quot;n1&quot; öffnen&quot; --------------------                   
' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='Transmit Data:

&quot;DC1&quot; = 0x11
&quot;len&quot;   = 0x04
&quot;ESC&quot; = 0x1B
&quot;M&quot;     = 0x4D
&quot;T&quot;      = 0x54
&quot;n1&quot;    = Global Var: TouchMacro_OpenTouchMacroNr
&quot;bcc&quot;   = calculation' textarea='12,0,12,0' />
						<command class_type='calculation' title='Berechnung Prüfsumme aus allen Bytes' >
							<exp exp='.Touch_bcc_Calc = 0x00' />
							<exp exp='.Touch_bcc_Calc = 0x11 + 0x04 + 0x1B + 0x4D + 0x54 + _2_Touch_OpenTouchMacroNr' />
							<exp exp='' />
						</command>
						<command class_type='call' title='Aufruf Komponenten-Makro' disable='1' component='UART0_HMI' macro='SendString' >
							<argument exp='&quot;MTb3&quot;' />
						</command>
						<command class_type='call' title='TXD &quot;DC1&quot; to Touch Display' component='UART0_HMI' macro='SendChar' >
							<argument exp='0x11' />
						</command>
						<command class_type='call' title='TXD &quot;len&quot; to Touch Display' component='UART0_HMI' macro='SendChar' >
							<argument exp='0x04' />
						</command>
						<command class_type='call' title='TXD &quot;Esc&quot; to Touch Display' component='UART0_HMI' macro='SendChar' >
							<argument exp='0x1B' />
						</command>
						<command class_type='call' title='TXD &quot;M&quot; to Touch Display' component='UART0_HMI' macro='SendChar' >
							<argument exp='0x4D' />
						</command>
						<command class_type='call' title='TXD &quot;T&quot; to Touch Display' component='UART0_HMI' macro='SendChar' >
							<argument exp='0x54' />
						</command>
						<command class_type='call' title='TXD Var. &quot;TouchMacro_OpenTouchMacroNr&quot; to Touch Display' component='UART0_HMI' macro='SendChar' >
							<argument exp='_2_Touch_OpenTouchMacroNr' />
						</command>
						<command class_type='call' title='TXD &quot;bcc&quot; to Touch Display' component='UART0_HMI' macro='SendChar' >
							<argument exp='.Touch_bcc_Calc' />
						</command>
						<command class_type='comment' title='' comment='-------------------- 2.) clear Circular Buffer 1 Memory and Checkout Acknowledge  --------------------                                  
' textarea='12,0,12,0' />
						<command class_type='call' title='Reset Circular Buffer 1 (RXD Memory) ' component='UART0_RXD_Memory' macro='FlushBuffer' />
						<command class_type='comment' title='' comment='Wait Times for 1 received Byte:
min. 275µS --&gt; 115200 Baud --&gt; 47923200Mhz PLL Frequency --&gt; Xtal 18,432MHz' textarea='12,0,12,0' />
						<command class_type='delay' title='Wait for Byte &quot;ACK&quot;' exp='300' type='0' />
						<command class_type='call' title=' write Index Byte of Circular Buffer 1 (RXD Memory)  in Variable' component='UART0_RXD_Memory' macro='GetNumberBytes' >
							<return exp='.TempData_0' />
						</command>
						<command class_type='decision' title='Byte received - Index Circular Buffer 1 (RXD Memory) &gt;0 ?' exp='.TempData_0 &gt; 0' swap='0' >
							<flowline >
								<command class_type='call' title=' write 1. Byte of Circular Buffer 1 (RXD Memory) in Variable' component='UART0_RXD_Memory' macro='GetByte' >
									<return exp='.TempData_1' />
								</command>
								<command class_type='decision' title='&quot;ACK&quot; ok ?' exp='.TempData_1 = 0x06' swap='0' >
									<flowline />
									<flowline >
										<command class_type='comment' title='' comment='Error Code &quot;ACK not OK&quot;' textarea='36,25,36,25' />
										<command class_type='calculation' title='Berechnung' >
											<exp exp='_1_Error_Code = 0x05' />
										</command>
										<command class_type='call' title='Aufruf Komponenten-Makro' component='Error_Code_Memory' macro='PutByte' >
											<argument exp='_1_Error_Code' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='comment' title='' comment='Error Code &quot;no Byte received&quot;' textarea='41,10,41,10' />
								<command class_type='calculation' title='Berechnung' >
									<exp exp='_1_Error_Code = 0x04' />
								</command>
								<command class_type='call' title='Aufruf Komponenten-Makro' component='Error_Code_Memory' macro='PutByte' >
									<argument exp='_1_Error_Code' />
								</command>
							</flowline>
						</command>
						<command class_type='comment' title='' comment='-------------------- 3.) Reset Variables and clear Circular Buffer 1 Memory --------------------                                  ' textarea='12,0,12,0' />
						<command class_type='calculation' title='Reset Variables' >
							<exp exp='_2_Touch_OpenTouchMacroNr = 0x00' />
							<exp exp='' />
						</command>
						<command class_type='call' title='Reset Circular Buffer 1 (RXD Memory) ' component='UART0_RXD_Memory' macro='FlushBuffer' />
					</flowline>
				</macro>
				<macro >
					<flowline name='SYS_Initialise_MCP23S17_1' description='' >
						<command class_type='comment' title='' comment='
********** Subroutine: Initialise SPI I/O Expander MCP23S17 (16Bit Digital I/O) **********
--&gt; Compatible with Codesys Bus Coupler V1.0

Changeable Values:
Attention when changing Values. Codesys Bus Coupler V1.0 doesn´t run!!!!

comes from:
Macro -&gt; Main

Programm function detail:
1.) Initialise MCP23S17 (Digital I/O 16bit)
2.) Initialise MCP3208 (ADC 8Channel 12bit)
3.) Initialise MCPxxxx (DAC 2Channel 12bit)


In/Out Variables:
no' textarea='12,0,12,0' />
						<command class_type='output' title='Select SPI Address 1 (CS0)' mode='1' port='1048577' mask='1' exp='0' />
						<command class_type='comment' title='' comment='Device Opcode MCP23S17:
0 - 1- 0 - 0 - A2 - A1 - A0 - R/W
R/W=0 --&gt; Write
R/W=1 --&gt; Read' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='IODIR (I/O Direction Register) write Data (Ad: A=0x00 - B=0x01).

Reset Value: 1111 1111 
Operation: Read/Write

Bit 7 - Bit 0 = I/O 7 - I/O 0
= 1 --&gt; Pin becomes Input
= 0 --&gt; Pin becomes Output

Write Value: 0000 0000' textarea='12,0,12,0' />
						<command class_type='call' title='Send Device Opcode: MCP23S17-1 (Ad.1) - write Operation ' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x40' />
						</command>
						<command class_type='call' title='Send Adress: IODIR-A' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x00' />
						</command>
						<command class_type='call' title='Send Data IODIR-A =  8x Digital Output' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x00' />
						</command>
						<command class_type='comment' title='' comment='IPOL (Inverted Polarity Register) write Data (Ad: A=0x02 - B=0x03).

Reset Value: 0000 0000 
Operation: Read/Write

Bit 7 - Bit 0 = I/O 7 - I/O 0
= 1 --&gt; Pin Level = Inverted GPIO Level
= 0 --&gt; Pin Level = GPIO Level

Write Value: 0000 0000' textarea='12,0,12,0' />
						<command class_type='call' title='Send Device Opcode: MCP23S17-1 (Ad.1) - write Operation ' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x40' />
						</command>
						<command class_type='call' title='Send Adress: IPOL-B (Input)' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x03' />
						</command>
						<command class_type='call' title='Send Data IPOL-B = Pin Level -&gt; Inverted GPIO Level' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0xFF' />
						</command>
						<command class_type='comment' title='' comment='GPPU (GPIO Pull Up Register) write Data (Ad: A=0x0C - B=0x0D).

Reset Value: 0000 0000 
Operation: Read/Write

Bit 7 - Bit 0 = I/O 7 - I/O 0
= 1 --&gt; Pull-up enabled
= 0 --&gt; Pull-up disbled

Write Value: 0000 0000' textarea='12,0,12,0' />
						<command class_type='call' title='Send Device Opcode: MCP23S17-1 (Ad.1) - write Operation ' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x40' />
						</command>
						<command class_type='call' title='Send Adress: GPPU-B (Input)' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x0D' />
						</command>
						<command class_type='call' title='Send Data GPPU-B = Pull up Enabled' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0xFF' />
						</command>
						<command class_type='comment' title='' comment='IOCON (I/O Control Register) write Data (Ad: A=0x0A - B=0x0B).

Reset Value: 0000 0000 
Operation: Read/Write

Bit 7: Bank = 1 --&gt; Bank1
                  = 0 --&gt; Bank 0
Bit 6: Mirror = 1 --&gt; INT Pins connected internal
                   = 0 --&gt; INT Pins not connected (INTA=Port A - INTB=PortB)
Bit 5: SEQOP = 1 --&gt; Byte Mode Enabled. Adress Pointer does not increment
                      = 0 --&gt; Sequential Mode Enabled. Adress Pointer increments
Bit 4: DISSLW = 1 --&gt; Slew Rate Disabled
                        = 0 --&gt; Slew Rate Enabled
Bit 3: HAEN = 1 --&gt; Enable Adress Pins
                    = 0 --&gt; Disable Adress Pins
Bit 2: ODR = 1 --&gt; Open-drain Function (overrides INTPOL Bit)
                  = 0 --&gt; Active driver Output (INTPOL Bit sets polarity)
Bit 1: INTPOL = 1 --&gt; INT Pins Active High
                       = 0 --&gt; INT Pins Active Low
Bit 0: Unimplemented = Read as 0


Write Value: 0000 1000' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='MCP23S17_1' textarea='12,0,12,0' />
						<command class_type='call' title='Send Device Opcode: MCP23S17-1 (Ad.1) - write Operation ' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x40' />
						</command>
						<command class_type='call' title='Send Adress: IOCON-A (Output)' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x0A' />
						</command>
						<command class_type='call' title='Send Data ICON-A = HAEN=1 / xxxxx=x' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x08' />
						</command>
						<command class_type='call' title='Send Device Opcode: MCP23S17-1 (Ad.1) - write Operation ' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x40' />
						</command>
						<command class_type='call' title='Send Adress: IOCON-B (Input)' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x0B' />
						</command>
						<command class_type='call' title='Send Data ICON-B = HAEN=1 / xxxxx=x' disable='1' ccode='// Send Data ICON-B = HAEN=1 / xxxxx=x
// Aufruf Komponenten-Makro: SPI_Master1_COM3::SendChar(0x08)
FCD_06c41_SPI_Master1_COM3__SendChar(0x08);
' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x08' />
						</command>
						<command class_type='comment' title='' comment='MCP23S17_2' textarea='12,0,12,0' />
						<command class_type='call' title='Send Device Opcode: MCP23S17-1 (Ad.1) - write Operation ' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x42' />
						</command>
						<command class_type='call' title='Send Adress: IOCON-A (Output)' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x0A' />
						</command>
						<command class_type='call' title='Send Data ICON-A = HAEN=1 / xxxxx=x' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x08' />
						</command>
						<command class_type='call' title='Send Device Opcode: MCP23S17-1 (Ad.1) - write Operation ' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x42' />
						</command>
						<command class_type='call' title='Send Adress: IOCON-B (Input)' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x0B' />
						</command>
						<command class_type='call' title='Send Data ICON-B = HAEN=1 / xxxxx=x' disable='1' component='SPI_Master1_COM3' macro='SendChar' >
							<argument exp='0x08' />
						</command>
						<command class_type='delay' title='Warten' exp='100' type='1' />
						<command class_type='output' title='Deselect SPI Address 1 (CS0)' mode='1' port='1048577' mask='1' exp='1' />
						<command class_type='comment' title='' comment='Initialise MCP23S12_2' textarea='12,0,12,0' />
						<command class_type='output' title='Select SPI Address 2 (CS0)' disable='1' mode='1' port='1048577' mask='2' exp='0' />
						<command class_type='delay' title='Warten' disable='1' exp='100' type='1' />
						<command class_type='output' title='Deselect SPI Address 2 (CS0)' disable='1' mode='1' port='1048577' mask='2' exp='1' />
					</flowline>
				</macro>
				<macro >
					<flowline name='_X12_PWM_Set_Frequency' description='Set PWM0 Frequency' >
						<command class_type='comment' title='' comment='
********** Subroutine: Set the PWM0 Frequency **********


comes from:
Macro -&gt; _X1_Main_Program_Start

Changeable Values:
Values for Encoder Start and Stop Areas
(X1R/X1L/X2R/X2L/XR/XL)

Programm function detail:
1.) When PWM0 is Enable, drive PWM0 Port with PWM Frequency


Input Variables:
Encoder_Value: Actual Value of the Encoder Counter Register' textarea='12,0,12,0' />
						<command class_type='decision' title='Is PWM0 Manual Drive Enable ?' exp='_3_PWM0_ManualDriveEN = 1' swap='0' >
							<flowline >
								<command class_type='decision' title='Is TaskCycle Timer 1 finished' exp='_0_TaskCycle_Timer1 = 0' swap='0' >
									<flowline >
										<command class_type='comment' title='' comment='---------- 1.a) Set PWM Frequency ----------' textarea='12,0,12,0' />
										<command class_type='call' title='Aufruf Komponenten-Makro' component='PWM' macro='SetDutyCycle' >
											<argument exp='_3_PWM_Frequency' />
										</command>
										<command class_type='call' title='Drive PWM0 Port with Variable' disable='1' component='PWM' macro='SetDutyCycle10Bit' >
											<argument exp='_3_PWM_Frequency' />
										</command>
										<command class_type='delay' title='Warten' disable='1' exp='5' type='1' />
										<command class_type='comment' title='' comment='Maschine Cycle Timer' textarea='12,0,12,0' />
										<command class_type='calculation' title='Disable Task fox &quot;X&quot; Machine Cycles' >
											<exp exp='_0_TaskCycle_Timer1 = 1000' />
										</command>
									</flowline>
									<flowline >
										<command class_type='comment' title='' comment='Makro is for &quot;X&quot; Cycles disabled after setting PWM Frequency' textarea='12,0,12,0' />
										<command class_type='calculation' title='Port Disable Counter -1' >
											<exp exp='_0_TaskCycle_Timer1 = _0_TaskCycle_Timer1 - 1' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='Flowcode Mill Control' >
						<command class_type='comment' title='' comment='
Programm function OK:
1.) Serial COM (UARTR0) to EDIP Touch Display
2.) Software quadrature Encoder

Programm function not OK:
3.) Hardware PWM cannot change in running Program Duty Cycle
4.) I2C cannot send Data

Variables:
no Variables' textarea='12,0,12,0' />
						<command class_type='call' title='Initialise CPU Peripheral' macro='SYS_Initialise_Peripheral' />
						<command class_type='comment' title='' comment='-------------------- 2.) Initialise SPI Digital I/O --------------------                                                   
' textarea='12,0,12,0' />
						<command class_type='call' title='Initialise MCP23S17-1 - Digital I/O 16bit' macro='SYS_Initialise_MCP23S17_1' />
						<command class_type='call' title='Initialise MCP23S17-2 - Digital I/O 16bit' disable='1' macro='SYS_Initialise_MCP23S17_1' />
						<command class_type='call' title='Initialise MCP23S17-3 - Digital I/O 16bit' disable='1' macro='SYS_Initialise_MCP23S17_1' />
						<command class_type='call' title='Initialise MCP23S17-4 - Digital I/O 16bit' disable='1' macro='SYS_Initialise_MCP23S17_1' />
						<command class_type='comment' title='' comment='-------------------- 2.) Initialise SPI Analog/Digital Converter --------------------                                   
' textarea='12,0,12,0' />
						<command class_type='call' title='Initialise MCP3208-1 - ADC 8ch. 12bit' disable='1' macro='SYS_Initialise_MCP23S17_1' />
						<command class_type='call' title='Initialise MCP3208-2 - ADC 8ch. 12bit' disable='1' macro='SYS_Initialise_MCP23S17_1' />
						<command class_type='comment' title='' comment='-------------------- 2.) Initialise SPI Digital/Analog Converter --------------------                                  
' textarea='12,0,12,0' />
						<command class_type='call' title='Initialise MCPxxxx-1 - DAC 2ch. 12bit' disable='1' macro='SYS_Initialise_MCP23S17_1' />
						<command class_type='call' title='Initialise MCPxxxx-1 - DAC 2ch. 12bit' disable='1' macro='SYS_Initialise_MCP23S17_1' />
						<command class_type='loop' title='Schleife' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='Serial Task Synchronisation' macro='SYS_TaskCycleSynchronisation' />
								<command class_type='call' title='Error Code Request' macro='Error_Code_Request' />
								<command class_type='decision' title='Is Error Code Bit Set ?' exp='_1_Error_Code_Bit = 1' swap='0' >
									<flowline >
										<command class_type='call' title='Makro-Aufruf' macro='_X10_Main_Program_Start' />
									</flowline>
									<flowline >
										<command class_type='call' title='Makro-Aufruf' macro='_X10_Main_Program_Start' />
									</flowline>
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='c73616d1-7ad0-45d9-aada-69ccfa4c5efc' vmin='3' vmaj='1' codename='UART0_HMI' x='-88' y='48' z='22.055' 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='002' />
					<value target='BAUD_LIST' data='009' />
					<value target='BAUD' data='9600' />
					<value target='DBITS' data='008' />
					<value target='RETURN' data='000' />
					<value target='ToutVal' data='255' />
					<value target='FLOWEN' data='000' />
					<value target='ECHO' data='000' />
					<value target='TX' data='$PORTA.6' />
					<value target='RX' data='$PORTA.5' />
					<value target='CTS' data='$PORTB.1' />
					<value target='RTS' data='$PORTB.2' />
					<value target='TXRemap' data='' />
					<value target='RXRemap' data='' />
					<value target='label' data='RS232' />
					<value target='ScopeTraces' data='0' />
					<value target='ConsoleData' data='1' />
					<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 class_type='ref' guid='c34f9b8a-a915-4f75-ad0c-87f2ad670a8a' vmin='4' vmaj='1' codename='UART0_RXD_Memory' x='-48' y='48' z='0' xsz='20' ysz='20' zsz='20' 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='BufferSize' data='32' />
					<value target='StorageType' data='000' />
					<value target='MemType' data='000' />
					<value target='RETURN' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='3531a68d-7686-44b7-a3a5-67afda8467dc' vmin='3' vmaj='1' codename='QuadEncoder1' x='96' y='-32' 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='1' >
				<resources />
				<properties />
				<values >
					<value target='pin_a' data='$PORTC.0' />
					<value target='pin_b' data='$PORTB.7' />
					<value target='reprate' data='350' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='444fb704-814c-4707-a15c-759ba088505c' vmin='6' vmaj='1' codename='PWM' x='-88' y='-32' z='8.20287' xsz='1.06667' ysz='1.06667' zsz='1.06667' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='0' poslock='1' >
				<resources />
				<properties />
				<values >
					<value target='channel' data='001' />
					<value target='altpin' data='0' />
					<value target='pwm_pin' data='$PORTA.0' />
					<value target='RemapPin' data='' />
					<value target='timer' data='000' />
					<value target='period' data='255' />
					<value target='prescale' data='010' />
					<value target='period_calc' data='5470.085449' />
					<value target='frequency_calc' data='0.182812' />
					<value target='pwm_prescale' data='1024' />
					<value target='SimRep' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c34f9b8a-a915-4f75-ad0c-87f2ad670a8a' vmin='4' vmaj='1' codename='Error_Code_Memory' x='-104' y='-72' z='0' xsz='20' ysz='20' zsz='20' 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='BufferSize' data='16' />
					<value target='StorageType' data='000' />
					<value target='MemType' data='000' />
					<value target='RETURN' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='24219805-113d-4b12-b6bd-e1b0b0c33981' vmin='3' vmaj='1' codename='I2C_Master1_COM2' x='-88' y='16' 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='000' />
					<value target='BAUD_LIST' data='000' />
					<value target='SRC' data='000' />
					<value target='SMB' data='000' />
					<value target='BAUD' data='1000' />
					<value target='SDA' data='$PORTA.3' />
					<value target='SCL' data='$PORTA.4' />
					<value target='label' data='I2C Master' />
					<value target='ScopeTraces' data='0' />
					<value target='ConsoleData' data='' />
					<value target='Injector' data='000' />
					<value target='InjectorHandle' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='444fb704-814c-4707-a15c-759ba088505c' vmin='6' vmaj='1' codename='PWM1' x='-24' y='-32' z='7.94753' xsz='1.06667' ysz='1.06667' zsz='1.06667' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='0' poslock='1' >
				<resources />
				<properties />
				<values >
					<value target='channel' data='001' />
					<value target='altpin' data='0' />
					<value target='pwm_pin' data='$PORTA.0' />
					<value target='RemapPin' data='' />
					<value target='timer' data='2' />
					<value target='period' data='255' />
					<value target='prescale' data='000' />
					<value target='period_calc' data='5.341880' />
					<value target='frequency_calc' data='187.199997' />
					<value target='pwm_prescale' data='1' />
					<value target='SimRep' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='444fb704-814c-4707-a15c-759ba088505c' vmin='6' vmaj='1' codename='PWM2' x='40' y='-32' z='9.96753' xsz='1.06667' ysz='1.06667' zsz='1.06667' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='0' poslock='1' >
				<resources />
				<properties />
				<values >
					<value target='channel' data='001' />
					<value target='altpin' data='0' />
					<value target='pwm_pin' data='$PORTA.0' />
					<value target='RemapPin' data='' />
					<value target='timer' data='2' />
					<value target='period' data='255' />
					<value target='prescale' data='000' />
					<value target='period_calc' data='5.341880' />
					<value target='frequency_calc' data='187.199997' />
					<value target='pwm_prescale' data='1' />
					<value target='SimRep' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c34f9b8a-a915-4f75-ad0c-87f2ad670a8a' vmin='4' vmaj='1' codename='I2C_RXD_Memory' x='-48' y='16' z='0' xsz='20' ysz='20' zsz='20' 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='BufferSize' data='16' />
					<value target='StorageType' data='000' />
					<value target='MemType' data='000' />
					<value target='RETURN' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c73616d1-7ad0-45d9-aada-69ccfa4c5efc' vmin='3' vmaj='1' codename='UART1_COM1' x='8' y='48' 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='001' />
					<value target='BAUD_LIST' data='001' />
					<value target='BAUD' data='9600' />
					<value target='DBITS' data='008' />
					<value target='RETURN' data='000' />
					<value target='ToutVal' data='255' />
					<value target='FLOWEN' data='000' />
					<value target='ECHO' data='000' />
					<value target='TX' data='$PORTC.6' />
					<value target='RX' data='$PORTC.5' />
					<value target='CTS' data='$PORTB.1' />
					<value target='RTS' data='$PORTB.2' />
					<value target='TXRemap' data='' />
					<value target='RXRemap' data='' />
					<value target='label' data='RS232' />
					<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 class_type='ref' guid='c34f9b8a-a915-4f75-ad0c-87f2ad670a8a' vmin='4' vmaj='1' codename='UART1_RXD_Memory' x='56' y='48' z='0' xsz='20' ysz='20' zsz='20' 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='BufferSize' data='32' />
					<value target='StorageType' data='000' />
					<value target='MemType' data='000' />
					<value target='RETURN' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='96862c4d-debc-45fa-9433-74711a4b9a3b' vmin='3' vmaj='1' codename='SPI_Master1_COM3' x='8' y='16' 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='001' />
					<value target='PR_SCALE' data='004' />
					<value target='CKP' data='000' />
					<value target='CKE' data='000' />
					<value target='SMP' data='000' />
					<value target='MOSI' data='$PORTB.5' />
					<value target='MISO' data='$PORTB.4' />
					<value target='CLK' data='$PORTB.6' />
					<value target='MosiRemap' data='' />
					<value target='MisoRemap' data='' />
					<value target='ClkRemap' data='' />
					<value target='label' data='SPI  Master' />
					<value target='ScopeTraces' data='0' />
					<value target='ConsoleData' data='0' />
					<value target='Injector' data='000' />
					<value target='InjectorHandle' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c34f9b8a-a915-4f75-ad0c-87f2ad670a8a' vmin='4' vmaj='1' codename='SPI_RXD_Memory' x='56' y='16' z='0' xsz='20' ysz='20' zsz='20' 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='BufferSize' data='16' />
					<value target='StorageType' data='000' />
					<value target='MemType' data='000' />
					<value target='RETURN' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='9737364' 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='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='25' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel3d>
	<layout >
		<view type='0' name='_X10_Main_Program_Start' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAABwUAAMUDAAA' zoom='50' scrollx='0' scrolly='460' flags='0' />
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAABwUAAMUDAAA' zoom='50' scrollx='0' scrolly='176' flags='0' />
		<view type='0' name='COM3_SPI_TXD_Test' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAABwUAAMUDAAA' zoom='50' scrollx='0' scrolly='492' flags='0' />
		<view type='0' name='SYS_Initialise_MCP23S17_1' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAABwUAAMUDAAA' zoom='50' scrollx='0' scrolly='1050' flags='0' />
	</layout>
</document>
</root>
