<root>
<document scada='0' schema='102' license='1,Danny van Neijenhoff,N91TKC' title='' description='' fcversion='524802' target='PIC.16F.16F886' >
	<config data='!0,23f2!10,3fff%0,2%3,0%4,1%5,1%6,1%7,1%8,3%a,0%b,0%c,0%d,1%19,3%18,1' clkspd='20000000' simspd='5' usewdt='1' constif='0' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug >
		<watch expr='var_array' />
		<watch expr='ID_nummer' />
		<watch expr='raw_RX_antw_master' />
		<watch expr='raw_reg_100' />
	</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='9' />
			<data name='CalculatedCommsDelay' value='9' />
			<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='' vstate='30' vmin='0' vmaj='1' srcleaf='' visiblename='HT 485 Cam' description='' category='Misc' catenable='1' author='Danny van Neijenhoff' manuname='HEFTRONIC' manucode='' sysinfo='0' keywords='' dynamic='0' scadaCompatible='0' embeddedCompatible='1' iconpath='' />
		<component class_type='root' codename='panel' x='0' y='0' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' >
			<resources />
			<properties >
				<property name='Connections' hidden='0' >
					<property name='Connection' target='pin' typeid='5' hidden='0' locked='0' info='Chip pin to which this switch is connected.' />
					<property name='Polarity' target='polarity' typeid='16' hidden='0' locked='0' info='Sets whether the pin should go high or low when the switch is activated.' filter='000Active high
001Active low' />
					<property name='Debounce (ms)' target='debounce' typeid='14' hidden='0' locked='0' info='Time in milliseconds allowed for the pin to stabilise following a change of state.

NB)  Debouncing is only used when reading the switch state with the component macros.
       Chip pin is NOT debounced.' />
				</property>
				<property name='Simulation' folder='property_1' hidden='0' >
					<property name='Operation' target='operation' typeid='16' hidden='0' locked='0' info='Latching - click the switch to turn it on, click again to turn it off.
Momentary - click the switch to turn it on, release the mouse to turn it off.' filter='001Latching
000Momentary' />
				</property>
			</properties>
			<values >
				<value target='pin' data='$PORTB.3' />
				<value target='polarity' data='000' />
				<value target='debounce' data='0' />
				<value target='operation' data='1' />
			</values>
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='Coil_1' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='var_array' type='u8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='1' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='rawinput_e3' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='raw_reg_100' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='raw_inputB' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='raw_coilstate' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ID_nummer' type='u8' description='' isconst='0' isinit='1' usrinit='7' setinit='7' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='var_teller_lcdclear' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='raw_RX_antw_master' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Coil_8' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Coil_7' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='ID_wissel' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Coil_6' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Coil_5' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='analoginput' type='u16' description='' isconst='0' isinit='1' usrinit='125' setinit='125' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Coil_4' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Coil_3' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Coil_2' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='_1_Initialise' description='Initialiseerd alle variabelen. Als Var_init = 0 wordt cold boot uitgevoerd, bij 1 wordt warm boot uitgevoerd.' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='comment' title='' comment='Low voltage programming UIT!! staat op B3
J1 op B3 naar GND, output C2 en B2 aan/uit dmv reset ed.




' textarea='12,0,12,0' cmdcolor='10944511' cmdcolor_sec='11465458' />
						<command class_type='native' title='' disable='1' ccode='OPTION_REG &amp;= ~(1 &lt;&lt; 7);      
WPUB=0b00011000;' cmdcolor='7687168' cmdcolor_sec='8152576' language='C' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='ModbusSlave1' macro='Initialise' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='Main loop. De delay dient om programma te vertragen tot 100x/sec.' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='INITIALISeren' cmdcolor='1879295' cmdcolor_sec='5751039' macro='_1_Initialise' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='ModbusSlave1' macro='SetSlaveAddress' >
							<argument exp='12' />
						</command>
						<command class_type='loop' title='Loop' cmdcolor='12615680' cmdcolor_sec='15376912' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM1' macro='Enable' />
								<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='ModbusSlave1' macro='CheckForIncoming' >
									<return exp='raw_RX_antw_master' />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='raw_RX_antw_master = 1' swap='0' >
									<flowline >
										<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='ModbusSlave1' macro='ReadCoilStates' >
											<return exp='raw_coilstate' />
											<argument exp='0' />
											<argument exp='8' />
										</command>
										<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='0' port='1048577' mask='0' exp='raw_coilstate' />
										<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM1' macro='SetDutyCycle' >
											<argument exp='255' />
										</command>
									</flowline>
									<flowline >
										<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='0' port='1048577' mask='0' exp='0' />
										<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='PWM1' macro='SetDutyCycle' >
											<argument exp='10' />
										</command>
									</flowline>
								</command>
								<command class_type='decision' title='Decision' cmdcolor='12615680' cmdcolor_sec='15376912' exp='raw_RX_antw_master = 255' swap='0' >
									<flowline >
										<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048578' mask='8' exp='1' />
									</flowline>
									<flowline >
										<command class_type='output' title='Output' cmdcolor='16762795' cmdcolor_sec='13879979' mode='1' port='1048578' mask='8' exp='0' />
									</flowline>
								</command>
								<command class_type='call' title='Call Component Macro' cmdcolor='1879295' cmdcolor_sec='5751039' component='ModbusSlave1' macro='SetAnalogueInput' >
									<argument exp='0' />
									<argument exp='125' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='687f8ad4-59f2-4079-bb84-7713dcb57a13' vmin='0' vmaj='2' codename='ModbusSlave1' x='180' y='40' z='1.82924' xsz='64' ysz='32' zsz='1.53' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='cal_uart::CHANNEL' data='001' />
					<value target='cal_uart::TX' data='$PORTC.6' />
					<value target='cal_uart::OutputPins' data='007' />
					<value target='cal_uart::TXAlt' data='0' />
					<value target='cal_uart::RX' data='$PORTC.7' />
					<value target='cal_uart::InputPins' data='022' />
					<value target='cal_uart::RXAlt' data='0' />
					<value target='cal_uart::BAUD_LIST' data='004' />
					<value target='cal_uart::BAUD' data='9600' />
					<value target='BusType' data='001' />
					<value target='DDRP' data='$PORTC.1' />
					<value target='ReadDDRState' data='000' />
					<value target='Timeout' data='50' />
					<value target='UARTidx' data='001' />
					<value target='FrameType' data='000' />
					<value target='ReceiveBufferSize' data='20' />
					<value target='AddressBytes' data='1' />
					<value target='SlaveAddress' data='12' />
					<value target='ReplyDelay' data='100' />
					<value target='BaudByteDelay' data='1040' />
					<value target='Stats' data='1' />
					<value target='label' data='Modbus Slave' />
					<value target='cal_uart::ScopeTraces' data='0' />
					<value target='cal_uart::ConsoleData' data='0' />
					<value target='cal_uart::ConsoleColumns' data='64' />
					<value target='cal_uart::DataSource' data='000' />
					<value target='cal_uart::com_port' data='000' />
					<value target='cal_uart::Injector' data='000' />
					<value target='StartAdrCoil' data='0' />
					<value target='NumAdrCoil' data='8' />
					<value target='StartAdrDI' data='0' />
					<value target='NumAdrDI' data='8' />
					<value target='StartAdrAI' data='0' />
					<value target='NumAdrAI' data='1' />
					<value target='StartAdrReg' data='100' />
					<value target='NumAdrReg' data='15' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='63177601-e8e2-4330-89d3-a4c5a7e228f5' vmin='1' vmaj='1' codename='led_array_pcb1' x='210' y='-10' z='3.315' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='1' >
				<resources />
				<properties />
				<values >
					<value target='count' data='8' />
					<value target='port' data='000' />
					<value target='PortByte' data='$PORTA0' />
					<value target='pin0' data='$PORTA0.0' />
					<value target='pin1' data='$PORTA0.1' />
					<value target='pin2' data='$PORTA0.2' />
					<value target='pin3' data='$PORTA0.3' />
					<value target='pin4' data='$PORTA0.4' />
					<value target='pin5' data='$PORTA0.5' />
					<value target='pin6' data='$PORTA0.6' />
					<value target='pin7' data='$PORTA0.7' />
					<value target='polarity' data='001' />
					<value target='full_port' data='$PORTA0' />
					<value target='align' data='000' />
					<value target='spacing' data='12.000000' />
					<value target='reverse' data='0' />
					<value target='led_array1::show_label' data='002' />
					<value target='led_array1::label_property' data='pin' />
					<value target='label_position' data='003' />
					<value target='color_led0' data='65280' />
					<value target='label_color' data='16777215' />
					<value target='bitmask' data='255' />
					<value target='inv_bitmask' data='-256' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='175423b4-b359-4aa7-9bc4-1867301742af' vmin='0' vmaj='2' codename='dash_IO_flasher1' x='180' y='70' 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='1' poslock='1' >
				<resources />
				<properties />
				<values >
					<value target='label' data='Label' />
					<value target='icon_image' data='' />
					<value target='flash_time' data='250' />
					<value target='Tx_on_color' data='65280' />
					<value target='Tx_off_color' data='255' />
					<value target='Rx_on_color' data='65280' />
					<value target='Rx_off_color' data='255' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='444fb704-814c-4707-a15c-759ba088505c' vmin='9' vmaj='1' codename='PWM1' x='180' y='100' z='9.3247' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='1' >
				<resources />
				<properties />
				<values >
					<value target='channel' data='001' />
					<value target='altpin' data='0' />
					<value target='pwm_pin' data='$PORTC.2' />
					<value target='RemapPin' data='000' />
					<value target='timer' data='002' />
					<value target='period' data='255' />
					<value target='prescale' data='000' />
					<value target='period_calc' data='51.200001' />
					<value target='frequency_calc2' data='19531.250000' />
					<value target='frequency_calc' data='19.531250' />
					<value target='pwm_prescale' data='1' />
					<value target='ReqFreq' data='100.000000' />
					<value target='OldReqFreq' data='100.000000' />
					<value target='CalcFreq' data='100.004570' />
					<value target='CalcPeriod' data='10936' />
					<value target='CalcScaler' data='64' />
					<value target='Apply' data='0' />
					<value target='SimRep' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='9737364' img='' style='0' />
		<camera xe='182.13' ye='95.7897' ze='95.277' xt='182.13' yt='95.7897' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='1' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='25' />
		<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---------------------wUAAAAYAAAAiQUAAH4DAAA' zoom='65' scrollx='0' scrolly='55' flags='0' />
		<view type='0' name='_1_Initialise' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAiQUAAH4DAAA' zoom='90' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
