<root>
<document scada='0' schema='102' license='1,celebriums,U00Q0U' title='' description='' fcversion='524800' target='AVR.ATMEGA.ATMEGA8TQFP' >
	<config data='!0,e4!8,ff!10,ff%0,24%6,1%7,1' clkspd='8000000' simspd='1' usewdt='1' constif='1' commport='14' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='0' head=' #include &lt;avr/power.h&gt;' body='' />
	<debug />
	<traces />
	<ghost >
		<FK2 >
			<data name='FK2D0' port='4294967295' pin='4294967295' />
			<data name='FK2D1' port='4294967295' pin='4294967295' />
			<data name='FK2D2' port='4294967295' pin='4294967295' />
			<data name='FK2D3' port='4294967295' pin='4294967295' />
			<data name='FK2D4' port='4294967295' pin='4294967295' />
			<data name='FK2D5' port='4294967295' pin='4294967295' />
			<data name='FK2D6' port='4294967295' pin='4294967295' />
			<data name='FK2D7' port='4294967295' pin='4294967295' />
			<data name='FK2D8' port='4294967295' pin='4294967295' />
			<data name='FK2D9' port='4294967295' pin='4294967295' />
			<data name='FK2D10' port='4294967295' pin='4294967295' />
			<data name='FK2D11' port='4294967295' pin='4294967295' />
			<data name='FK2D12' port='4294967295' pin='4294967295' />
			<data name='FK2D13' port='4294967295' pin='4294967295' />
			<data name='FK2D14' port='4294967295' pin='4294967295' />
			<data name='FK2D15' port='4294967295' pin='4294967295' />
			<data name='FK2A0' port='4294967295' pin='4294967295' />
			<data name='FK2A1' port='4294967295' pin='4294967295' />
			<data name='FK2A2' port='4294967295' pin='4294967295' />
			<data name='FK2A3' port='4294967295' pin='4294967295' />
			<data name='FK2A4' port='4294967295' pin='4294967295' />
			<data name='FK2A5' port='4294967295' pin='4294967295' />
		</FK2>
		<ICD >
			<data name='AnalogPrescaleValue' value='19' />
			<data name='DigitalSampleRate' value='100000' />
			<data name='BreakpointCount' value='8' />
			<data name='CallStackDepthCount' value='8' />
			<data name='ClockPort' value='1' />
			<data name='ClockPin' value='6' />
			<data name='DataPort' value='1' />
			<data name='DataPin' value='7' />
			<data name='UseDefaultPins' value='1' />
			<data name='WrapEnabled' value='1' />
			<data name='CommsDelayOverridden' value='0' />
			<data name='CommsDelay' value='21' />
			<data name='CalculatedCommsDelay' value='21' />
			<data name='AnalogEB2PrescaleValue' value='2' />
			<data name='DigitalEB2SampleRate' value='100000' />
		</ICD>
		<pins >
			<digital A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
			<analog A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
		</pins>
	</ghost>
	<components >
		<settings autoimg='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='d00dc8d9-3341-42f9-b534-7fd999d02852' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='1' scadaCompatible='0' embeddedCompatible='1' iconpath='' />
		<component class_type='root' codename='panel' x='0' y='0' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' >
			<resources />
			<properties />
			<values />
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='AuthKeyA' type='u8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='6' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='false' type='b1' description='' isconst='1' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='flag1s' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='toggle' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='retval' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DataBufferIn' type='u8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='18' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='CompCount' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='IDX' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Led_OFF' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DataBufferOut' type='u8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='16' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='CardID' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Cntr2' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DataBufferSize' type='u8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='1' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Cntr1' type='u16' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='UIDBytes' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='cardType' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='TMR' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='calculation' title='' cmdcolor='16760919' cmdcolor_sec='16760832' >
							<exp exp='Cntr2 = Cntr2 + 1' />
						</command>
						<command class_type='decision' title='' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Led_OFF = 1' swap='0' >
							<flowline >
								<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='8' exp='0' />
								<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='16' exp='1' />
								<command class_type='calculation' title='' cmdcolor='16760919' cmdcolor_sec='16760832' >
									<exp exp='Cntr2 = 0' />
									<exp exp='flag1s = 1' />
								</command>
							</flowline>
							<flowline >
								<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Cntr2 &gt;= 29' swap='0' >
									<flowline >
										<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='8' exp='1' />
										<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='16' exp='0' />
									</flowline>
									<flowline />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Cntr2 &gt;= 30' swap='0' >
									<flowline >
										<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='8' exp='0' />
										<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='16' exp='1' />
										<command class_type='calculation' title='' cmdcolor='16760919' cmdcolor_sec='16760832' >
											<exp exp='Cntr2 = 0' />
											<exp exp='flag1s = 1' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='Example program to Read to UID of a MIFARE card and attempt to read and write values to and from the card.
' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='native' title='C Code' ccode='#include &lt;avr/sleep.h&gt;
#include &lt;avr/wdt.h&gt;
#include &lt;stdint.h&gt;
#include &lt;avr/io.h&gt;
#include &lt;avr/power.h&gt;
 
#define WDTO_1S 6
#define wdt_reset() \
__asm__ __volatile__ (&quot;wdr&quot;)' cmdcolor='7687168' cmdcolor_sec='8152576' language='C' />
						<command class_type='native' title='C Code' disable='1' ccode='#include &lt;avr/wdt.h&gt;
#define WDTO_1S 6 
#define wdt_reset() \
__asm__ __volatile__ (&quot;wdr&quot;)' cmdcolor='7687168' cmdcolor_sec='8152576' language='C' />
						<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='8' exp='0' />
						<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='16' exp='0' />
						<command class_type='delay' title='Delay' cmdcolor='12632064' cmdcolor_sec='16769676' exp='2' type='2' />
						<command class_type='loop' title='Loop' cmdcolor='12615680' cmdcolor_sec='15376912' type='0' exp='1' >
							<flowline >
								<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='8' exp='1' />
								<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='16' exp='0' />
								<command class_type='delay' title='Delay' cmdcolor='12632064' cmdcolor_sec='16769676' exp='10' type='1' />
								<command class_type='output' title='Output' disable='1' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='8' exp='0' />
								<command class_type='output' title='Output' disable='1' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='16' exp='0' />
								<command class_type='native' title='C Code' ccode='cli();
MCUCR &amp;= ~((1 &lt;&lt; ISC01) | (1 &lt;&lt; ISC00));
// infinite main loop
// trigger leds for testing
PORTC ^= (1 &lt;&lt; PC1);
delay_ms(2000);
PORTC ^= (1 &lt;&lt; PC1);
// enable external interrupt
GICR |= (1 &lt;&lt; INT0);
// set sleep mode
PPR0 = 0xDF;
PPR1 = 0x3F;
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
// sleep_mode() has a possible race condition


sleep_enable();
sei();
sleep_cpu();
sleep_disable();

// waking up...
// disable external interrupt here, in case the external low pulse is too long
GICR &amp;= ~(1 &lt;&lt; INT0);
// disable all interrupts
cli();' cmdcolor='7687168' cmdcolor_sec='8152576' language='C' />
							</flowline>
						</command>
						<command class_type='native' title='C Code' disable='1' ccode='MCUCR &amp;= ~((1 &lt;&lt; ISC01) | (1 &lt;&lt; ISC00));
// infinite main loop
// trigger leds for testing
PORTC ^= (1 &lt;&lt; PC1);
delay_ms(2000);
PORTC ^= (1 &lt;&lt; PC1);
// enable external interrupt
GICR |= (1 &lt;&lt; INT0);
// set sleep mode
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
// sleep_mode() has a possible race condition
sleep_enable();
sei();
sleep_cpu();
sleep_disable();

// waking up...
// disable external interrupt here, in case the external low pulse is too long
GICR &amp;= ~(1 &lt;&lt; INT0);
// disable all interrupts
cli();' cmdcolor='7687168' cmdcolor_sec='8152576' language='C' />
						<command class_type='native' title='C Code' ccode='wdt_reset();' cmdcolor='7687168' cmdcolor_sec='8152576' language='C' />
						<command class_type='native' title='C Code' ccode='set_sleep_mode(SLEEP_MODE_PWR_SAVE);
sleep_enable();
sei();
sleep_cpu();
sleep_disable();' cmdcolor='7687168' cmdcolor_sec='8152576' language='C' />
						<command class_type='native' title='C Code' ccode='#include &lt;avr/sleep.h&gt;
#include &lt;avr/wdt.h&gt;' cmdcolor='7687168' cmdcolor_sec='8152576' language='C' />
						<command class_type='native' title='C Code' disable='1' ccode='#define WDTO_500MS 5 
#define wdt_reset() \
__asm__ __volatile__ (&quot;wdr&quot;)

set_sleep_mode(SLEEP_MODE_PWR_SAVE);' cmdcolor='7687168' cmdcolor_sec='8152576' language='C' />
						<command class_type='native' title='C Code' disable='1' ccode='//6.22.1 Detailed Description
//#include &lt;avr/sleep.h&gt;
//Use of the SLEEP instruction can allow an application to reduce its power comsumption considerably. AVR devices can be put into different sleep modes. Refer to the
//datasheet for the details relating to the device you are using.
//There are several macros provided in this header file to actually put the device into
//sleep mode. The simplest way is to optionally set the desired sleep mode using set_-
//sleep_mode() (it usually defaults to idle mode where the CPU is put on sleep but
//all peripheral clocks are still running), and then call sleep_mode(). Unless it is the
//purpose to lock the CPU hard (until a hardware reset), interrupts need to be enabled at
//this point. This macro automatically takes care to enable the sleep mode in the CPU
//before going to sleep, and disable it again afterwards.
//As this combined macro might cause race conditions in some situations, the individual
//steps of manipulating the sleep enable (SE) bit, and actually issuing the SLEEP instruction are provided in the macros sleep_enable(), sleep_disable(), and
//sleep_cpu(). This also allows for test-and-sleep scenarios that take care of not
//missing the interrupt that will awake the device from sleep.
//Example:}
#include &lt;avr/interrupt.h&gt;
#include &lt;avr/sleep.h&gt;
...
cli();
if (some_condition) {
sleep_enable();
sei();
sleep_cpu();
sleep_disable();
}
sei();
//This sequence ensures an atomic test of some_condition with interrupts being disabled. If the condition is met, sleep mode will be prepared, and the SLEEP instruction
//will be scheduled immediately after an SEI instruction. As the intruction right after
//the SEI is guaranteed to be executed before an interrupt could trigger, it is sure the
//device will really be put to sleep.
//Sleep Functions
//• void set_sleep_mode (uint8_t mode)
//• void sleep_mode (void)' cmdcolor='7687168' cmdcolor_sec='8152576' language='C' />
						<command class_type='calculation' title='0x9dc1 e göre' cmdcolor='16760919' cmdcolor_sec='16760832' />
						<command class_type='loop' title='Loop' cmdcolor='12615680' cmdcolor_sec='15376912' type='2' exp='5' >
							<flowline >
								<command class_type='delay' title='Delay' cmdcolor='12632064' cmdcolor_sec='16769676' exp='100' type='1' />
								<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='8' exp='1' />
								<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='16' exp='0' />
								<command class_type='delay' title='Delay' cmdcolor='12632064' cmdcolor_sec='16769676' exp='100' type='1' />
								<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='8' exp='0' />
								<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='16' exp='0' />
								<command class_type='delay' title='Delay' cmdcolor='12632064' cmdcolor_sec='16769676' exp='100' type='1' />
							</flowline>
						</command>
						<command class_type='native' title='C Code' disable='1' ccode='#asm
MCUCR = _MCUCR | 0x80; / [MCUCR = _MCUCR | 0x80; /]
GICR = 0x40; // [GICR = 0x40; //]
sei(); [Be ();]
asm(&quot;sleep&quot;);
#endasm' cmdcolor='7687168' cmdcolor_sec='8152576' language='C' />
						<command class_type='native' title='C Code' ccode='sleep_enable();
sei();
sleep_cpu();' cmdcolor='7687168' cmdcolor_sec='8152576' language='C' />
						<command class_type='native' title='C Code' ccode='set_sleep_mode(SLEEP_MODE_PWR_SAVE);
sleep_enable();
sei();
sleep_cpu();
sleep_disable();' cmdcolor='7687168' cmdcolor_sec='8152576' language='C' />
						<command class_type='loop' title='Loop' cmdcolor='12615680' cmdcolor_sec='15376912' type='0' exp='1' >
							<flowline />
						</command>
						<command class_type='interrupt' title='' cmdcolor='17151' cmdcolor_sec='355583' enable='1' name='TMR0' call='TMR' >
							<settings timer='1' prescale='1024' postscale='-1' rollover='-1' bitcount='-1' trigger='3' maskhi='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' masklo='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' >
								<option value='5' />
								<option value='-1' />
								<option value='-1' />
								<option value='-1' />
								<option value='-1' />
								<option value='-1' />
								<option value='-1' />
								<option value='-1' />
							</settings>
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='RFID' macro='Initialise' />
						<command class_type='call' title='Call Component Macro' disable='1' cmdcolor='1879295' cmdcolor_sec='5751039' component='RFID' macro='AntennaOn' />
						<command class_type='delay' title='Delay' cmdcolor='12632064' cmdcolor_sec='16769676' exp='100' type='1' />
						<command class_type='loop' title='Loop' cmdcolor='12615680' cmdcolor_sec='15376912' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='Call Component Macro' disable='1' cmdcolor='1879295' cmdcolor_sec='5751039' component='RFID' macro='AntennaOn' />
								<command class_type='delay' title='Delay' cmdcolor='12632064' cmdcolor_sec='16769676' exp='10' type='1' />
								<command class_type='call' title='Check for a new RFID tag' cmdcolor='1879295' cmdcolor_sec='5751039' component='RFID' macro='IsNewCardPresent' >
									<return exp='retval' />
								</command>
								<command class_type='decision' title='New Card Present?' cmdcolor='12615680' cmdcolor_sec='15376912' exp='retval' swap='0' >
									<flowline >
										<command class_type='output' title='RelayON' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048578' mask='1' exp='1' />
										<command class_type='calculation' title='' cmdcolor='16760919' cmdcolor_sec='16760832' >
											<exp exp='Cntr1 = 0' />
											<exp exp='Led_OFF = 1' />
										</command>
										<command class_type='comment' title='' comment='Comment' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
										<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='8' exp='0' />
										<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='16' exp='1' />
										<command class_type='call' title='Read UID' cmdcolor='1879295' cmdcolor_sec='5751039' component='RFID' macro='ReadCardSerial' >
											<return exp='retval' />
										</command>
										<command class_type='call' title='Read Number Of Bytes in UID' cmdcolor='1879295' cmdcolor_sec='5751039' component='RFID' macro='ReadUIDByte' >
											<return exp='UIDbytes' />
											<argument exp='10' />
										</command>
										<command class_type='loop' title='Display UID' cmdcolor='12615680' cmdcolor_sec='15376912' type='2' forvar='IDX' exp='UIDBytes' >
											<flowline >
												<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='RFID' macro='ReadUIDByte' >
													<return exp='cardID' />
													<argument exp='IDX' />
												</command>
												<command class_type='decision' title='Don&apos;t add a final &apos;,&apos;' cmdcolor='12615680' cmdcolor_sec='15376912' exp='IDX &lt; (UIDBytes - 1)' swap='0' >
													<flowline />
													<flowline />
												</command>
											</flowline>
										</command>
									</flowline>
									<flowline >
										<command class_type='comment' title='' comment='Comment' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
										<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' >
											<exp exp='Led_OFF = 0' />
										</command>
										<command class_type='calculation' title='' cmdcolor='16760919' cmdcolor_sec='16760832' >
											<exp exp='Cntr1 = Cntr1 + 1' />
										</command>
										<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='Cntr1 &gt;= 20' swap='0' >
											<flowline >
												<command class_type='output' title='Output' disable='1' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='8' exp='1' />
												<command class_type='output' title='Output' disable='1' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='16' exp='0' />
												<command class_type='calculation' title='' cmdcolor='16760919' cmdcolor_sec='16760832' >
													<exp exp='Cntr1 = 0' />
												</command>
												<command class_type='output' title='RelayOFF' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048578' mask='1' exp='0' />
											</flowline>
											<flowline />
										</command>
									</flowline>
								</command>
								<command class_type='label' title='Connection Point' cmdcolor='12615680' cmdcolor_sec='15376912' labelid='0' labelname='A' />
								<command class_type='call' title='Halt Active MIFARE card' cmdcolor='1879295' cmdcolor_sec='5751039' component='RFID' macro='HaltA' />
								<command class_type='call' title='Switch Off Authenitcation' cmdcolor='1879295' cmdcolor_sec='5751039' component='RFID' macro='StopCrypto' />
								<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='RFID' macro='AntennaOff' />
								<command class_type='delay' title='Delay' cmdcolor='12632064' cmdcolor_sec='16769676' exp='500' type='1' />
							</flowline>
						</command>
						<command class_type='decision' title='Card Selected?' disable='1' cmdcolor='12615680' cmdcolor_sec='15376912' totalfolded='1' exp='retval' swap='0' >
							<flowline folded='1' totalfolded='1' >
								<command class_type='call' title='Read Card Type From UID SAK' cmdcolor='1879295' cmdcolor_sec='5751039' hiddenFromFold='1' component='RFID' macro='ReadUIDByte' >
									<return exp='cardType' />
									<argument exp='11' />
								</command>
								<command class_type='call' title='Convert to meaningful value' cmdcolor='1879295' cmdcolor_sec='5751039' hiddenFromFold='1' component='RFID' macro='GetType' >
									<return exp='cardType' />
									<argument exp='cardType' />
								</command>
								<command class_type='decision' title='Check for MIFARE MINII, 1K, 4K' cmdcolor='12615680' cmdcolor_sec='15376912' hiddenFromFold='1' exp='(CardType = RFID :: PICC_TYPE_MIFARE_MINI) || (CardType = RFID :: PICC_TYPE_MIFARE_1K) || (CardType = RFID :: PICC_TYPE_MIFARE_4K)' swap='0' >
									<flowline >
										<command class_type='calculation' title='Default Factory Auth Key' cmdcolor='16760919' cmdcolor_sec='16760832' hiddenFromFold='1' >
											<exp exp='AuthKeyA[0] = 0xFF' />
											<exp exp='AuthKeyA[1] = 0xFF' />
											<exp exp='AuthKeyA[2] = 0xFF' />
											<exp exp='AuthKeyA[3] = 0xFF' />
											<exp exp='AuthKeyA[4] = 0xFF' />
											<exp exp='AuthKeyA[5] = 0xFF' />
										</command>
										<command class_type='call' title='Enable Mifare Auth Mode' cmdcolor='1879295' cmdcolor_sec='5751039' hiddenFromFold='1' component='RFID' macro='Authenticate' >
											<return exp='retval' />
											<argument exp='RFID :: PICC_CMD_MF_AUTH_KEY_A' />
											<argument exp='4' />
											<argument exp='AuthKeyA' />
										</command>
										<command class_type='decision' title='Error?' cmdcolor='12615680' cmdcolor_sec='15376912' hiddenFromFold='1' exp='retval' swap='0' >
											<flowline >
												<command class_type='goto' title='Goto Connection Point' cmdcolor='12615680' cmdcolor_sec='15376912' hiddenFromFold='1' labelid='0' labelname='' />
											</flowline>
											<flowline />
										</command>
										<command class_type='calculation' title='Data to Write to Card' cmdcolor='16760919' cmdcolor_sec='16760832' hiddenFromFold='1' >
											<exp exp='DataBufferSize[0] = 16' />
											<exp exp='DataBufferOut[0] = 10' />
											<exp exp='DataBufferOut[1] = 28' />
											<exp exp='DataBufferOut[2] = 33' />
											<exp exp='DataBufferOut[3] = 46' />
											<exp exp='DataBufferOut[4] = 5' />
											<exp exp='DataBufferOut[5] = 6' />
											<exp exp='DataBufferOut[6] = 7' />
											<exp exp='DataBufferOut[7] = 8' />
											<exp exp='DataBufferOut[8] = 9' />
											<exp exp='DataBufferOut[9] = 10' />
											<exp exp='DataBufferOut[10] = 11' />
											<exp exp='DataBufferOut[11] = 12' />
											<exp exp='DataBufferOut[12] = 13' />
											<exp exp='DataBufferOut[13] = 14' />
											<exp exp='DataBufferOut[14] = 15' />
											<exp exp='DataBufferOut[15] = 16' />
										</command>
										<command class_type='call' title='Write To Block 4' cmdcolor='1879295' cmdcolor_sec='5751039' hiddenFromFold='1' component='RFID' macro='MifareWrite' >
											<return exp='retval' />
											<argument exp='4' />
											<argument exp='DataBufferOut' />
											<argument exp='DataBufferSize' />
										</command>
										<command class_type='decision' title='Error?' cmdcolor='12615680' cmdcolor_sec='15376912' hiddenFromFold='1' exp='retval' swap='0' >
											<flowline >
												<command class_type='goto' title='Goto Connection Point' cmdcolor='12615680' cmdcolor_sec='15376912' hiddenFromFold='1' labelid='0' labelname='' />
											</flowline>
											<flowline />
										</command>
										<command class_type='calculation' title='Reset Readback Data to ensure no cheating' cmdcolor='16760919' cmdcolor_sec='16760832' hiddenFromFold='1' >
											<exp exp='DataBufferSize[0] = 18' />
											<exp exp='DataBufferIn[0] = 0' />
											<exp exp='DataBufferIn[1] = 0' />
											<exp exp='DataBufferIn[2] = 0' />
											<exp exp='DataBufferIn[3] = 0' />
											<exp exp='DataBufferIn[4] = 0' />
											<exp exp='DataBufferIn[5] = 0' />
											<exp exp='DataBufferIn[6] = 0' />
											<exp exp='DataBufferIn[7] = 0' />
											<exp exp='DataBufferIn[8] = 0' />
											<exp exp='DataBufferIn[9] = 0' />
											<exp exp='DataBufferIn[10] = 0' />
											<exp exp='DataBufferIn[11] = 0' />
											<exp exp='DataBufferIn[12] = 0' />
											<exp exp='DataBufferIn[13] = 0' />
											<exp exp='DataBufferIn[14] = 0' />
											<exp exp='DataBufferIn[15] = 0' />
										</command>
										<command class_type='call' title='Read Back From Card' cmdcolor='1879295' cmdcolor_sec='5751039' hiddenFromFold='1' component='RFID' macro='MifareRead' >
											<return exp='retval' />
											<argument exp='4' />
											<argument exp='DataBufferIn' />
											<argument exp='DataBufferSize' />
										</command>
										<command class_type='decision' title='Error?' cmdcolor='12615680' cmdcolor_sec='15376912' hiddenFromFold='1' exp='retval' swap='0' >
											<flowline >
												<command class_type='goto' title='Goto Connection Point' cmdcolor='12615680' cmdcolor_sec='15376912' hiddenFromFold='1' labelid='0' labelname='' />
											</flowline>
											<flowline />
										</command>
										<command class_type='calculation' title='Reset Counter' cmdcolor='16760919' cmdcolor_sec='16760832' hiddenFromFold='1' >
											<exp exp='CompCount = 0' />
										</command>
										<command class_type='loop' title='Compare In data with Out Data' cmdcolor='12615680' cmdcolor_sec='15376912' hiddenFromFold='1' type='2' forvar='IDX' exp='16' >
											<flowline >
												<command class_type='decision' title='If data bytes match' cmdcolor='12615680' cmdcolor_sec='15376912' hiddenFromFold='1' exp='DataBufferIn[IDX] = DataBufferOut[IDX]' swap='0' >
													<flowline >
														<command class_type='calculation' title='Increment Counter' cmdcolor='16760919' cmdcolor_sec='16760832' hiddenFromFold='1' >
															<exp exp='CompCount = CompCount + 1' />
														</command>
													</flowline>
													<flowline />
												</command>
											</flowline>
										</command>
										<command class_type='decision' title='All Data Bytes Match?' cmdcolor='12615680' cmdcolor_sec='15376912' hiddenFromFold='1' exp='CompCount = 16' swap='0' >
											<flowline >
												<command class_type='comment' title='' comment='Read Write OK' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' hiddenFromFold='1' />
											</flowline>
											<flowline >
												<command class_type='comment' title='' comment='Read Write FAIL' textarea='36,21,36,21' cmdcolor='10944511' cmdcolor_sec='11465458' hiddenFromFold='1' />
											</flowline>
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline folded='1' totalfolded='1' />
						</command>
						<command class_type='decision' title='' disable='1' cmdcolor='12615680' cmdcolor_sec='15376912' exp='toggle = 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='' cmdcolor='16760919' cmdcolor_sec='16760832' >
									<exp exp='toggle = 1' />
								</command>
								<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='8' exp='1' />
								<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='16' exp='0' />
							</flowline>
							<flowline >
								<command class_type='calculation' title='' cmdcolor='16760919' cmdcolor_sec='16760832' >
									<exp exp='toggle = 0' />
								</command>
								<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='8' exp='0' />
								<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='16' exp='1' />
							</flowline>
						</command>
						<command class_type='loop' title='Loop' disable='1' cmdcolor='12615680' cmdcolor_sec='15376912' type='0' exp='1' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='16760919' cmdcolor_sec='16760832' />
								<command class_type='decision' title='' cmdcolor='12615680' cmdcolor_sec='15376912' exp='flag1s = 1' swap='0' >
									<flowline >
										<command class_type='calculation' title='' cmdcolor='16760919' cmdcolor_sec='16760832' >
											<exp exp='flag1s = 0' />
										</command>
										<command class_type='decision' title='' cmdcolor='12615680' cmdcolor_sec='15376912' exp='toggle = 0' swap='0' >
											<flowline >
												<command class_type='calculation' title='' cmdcolor='16760919' cmdcolor_sec='16760832' >
													<exp exp='toggle = 1' />
												</command>
												<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='8' exp='1' />
												<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='16' exp='0' />
											</flowline>
											<flowline >
												<command class_type='calculation' title='' cmdcolor='16760919' cmdcolor_sec='16760832' >
													<exp exp='toggle = 0' />
												</command>
												<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='8' exp='0' />
												<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048579' mask='16' exp='1' />
											</flowline>
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='3f8d29a6-40a6-4d5e-a254-190c86d9ebb7' vmin='0' vmaj='3' codename='RFID' x='0' y='0' z='0.755' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='cal_spi::CHANNEL' data='000' />
					<value target='cal_spi::PR_SCALE' data='128' />
					<value target='cal_spi::MOSI' data='$PORTD.7' />
					<value target='cal_spi::MOSIPins' data='008' />
					<value target='cal_spi::MISO' data='$PORTD.6' />
					<value target='cal_spi::MISOPins' data='013' />
					<value target='cal_spi::CLK' data='$PORTB.0' />
					<value target='cal_spi::CLKPins' data='004' />
					<value target='cal_spi::SS' data='$PORTB.1' />
					<value target='reset' data='$PORTC.5' />
					<value target='label' data='MFRC522' />
					<value target='cal_spi::ScopeTraces' data='1' />
					<value target='cal_spi::ConsoleData' data='1' />
					<value target='cal_spi::Injector' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='14803425' 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='1' >
		<background rgb='8404224' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='0' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey0 xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey1 xe='-3.67394e-14' ye='0' ze='-300' xt='0' yt='0' zt='0' xquat='0' yquat='1' zquat='0' wquat='6.12323e-17' />
		<camerakey2 xe='0' ye='-300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.707107' yquat='0' zquat='0' wquat='0.707107' />
		<camerakey3 xe='-3.67394e-14' ye='300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-4.32978e-17' yquat='0.707107' zquat='0.707107' wquat='4.32978e-17' />
		<camerakey4 xe='-300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='0.5' zquat='0.5' wquat='0.5' />
		<camerakey5 xe='300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='-0.5' zquat='-0.5' wquat='0.5' />
		<camerakey6 xe='-173.205' ye='-173.205' ze='173.205' xt='0' yt='0' zt='0' xquat='-0.424708' yquat='0.17592' zquat='0.339851' wquat='0.820473' />
	</panel3d>
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA8QUAAMkCAAA' zoom='85' scrollx='0' scrolly='936' flags='0' />
		<view type='0' name='Main' mode='1' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA8QUAAMkCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Main' mode='2' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA8QUAAMkCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='TMR' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAA8QUAAMkCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
