<root>
<document schema='101' license='1,jordy101091,B55ZN2' title='' description='' target='PIC.16F.16F877A' >
	<config data='!0,3f3a%0,2%2,0%3,1%6,0%7,0%9,3%b,1%8,1%d,1' clkspd='19660800' 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='1000' />
			<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='monitor' value='1' />
			<data name='ictloop' value='1' />
			<data name='ictrate' value='1000' />
			<data name='ictmask' value='-1' />
		</dll_dbg_icd>
		<dll_models enabled='1' />
		<dll_upgrader enabled='1' />
		<dll_webhelp enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug />
	<components >
		<settings autoimg='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='a602ef58-2333-457b-8641-8ad4a1827800' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='' catenable='1' author='' 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='false' type='b1' description='' isconst='1' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DS1820_Calc' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SW1' type='b1' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='SW0' type='b1' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DS1820_Hi' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='StartLogging' type='b1' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DS1820_Raw' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DS1820_TempStr' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DS1820_Lo' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Datapoints' type='u32' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='DS1820_Log' type='T8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='20' />
					</def>
				</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='Main' description='This example shows how easy it is to build a simple datalogging application with the vinculum 1 and a USB pen drive.
This example logs the temperature from a DS1820 and saves the value to a .csv file.' >
						<command class_type='comment' title='' comment='The vinculum 1 can only work with BOMS device that meet the following requirements:

The BOMS needs to supoort the SCSI or AT command set.
These device can be identified by their USB class, subclass and protocol value of:

0x08,
0x06,
0x50 respectively

Disk which do not have a sector size of 512 bytes are not supported
Devices suchs as cardreaders which implement multiple LUNs only support the primary LUN.
The vinculum 1 can only acces the primary partition of a disk.' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='For the creating this example file and such.
The following BOMS (Bulk Only Mass Storage) device is used.

Brand: Apacher
Size: 4GB
Cluster Size: 64kb
FileFormat: FAT' textarea='12,0,12,0' />
						<command class_type='comment' title='' comment='Initialise LCD and Vinculum 1' textarea='12,0,12,0' />
						<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Start' />
						<command class_type='call' title='Call Component Macro' component='Vinculum1' macro='Initialise' />
						<command class_type='comment' title='' comment='Print Welcome Message to LCD:

--StartLogging--
----Press SW0----' textarea='12,0,12,0' />
						<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Cursor' >
							<argument exp='0' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='PrintString' >
							<argument exp='&quot;--StartLogging--&quot;' />
						</command>
						<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Cursor' >
							<argument exp='0' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='PrintString' >
							<argument exp='&quot;----PressSW0----&quot;' />
						</command>
						<command class_type='loop' title='Loop' exp='1' type='0' start='1' count='1' breakend='0' >
							<flowline >
								<command class_type='comment' title='' comment='Waiting for user input to start logging' textarea='12,0,12,0' />
								<command class_type='call' title='Call Component Macro' component='SW0_Start' macro='ReadState' >
									<return exp='SW0' />
								</command>
								<command class_type='decision' title='Decision' exp='SW0 = 1' swap='0' >
									<flowline >
										<command class_type='comment' title='' comment='Start logging button is pressed
' textarea='12,0,12,0' />
										<command class_type='calculation' title='Calculation' >
											<exp exp='StartLogging = 1' />
											<exp exp='' />
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='decision' title='Decision' exp='StartLogging = 1' swap='0' >
									<flowline >
										<command class_type='comment' title='' comment='Enter the Datalogging loop
' textarea='12,0,12,0' />
										<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Clear' />
										<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Cursor' >
											<argument exp='0' />
											<argument exp='0' />
										</command>
										<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='PrintString' >
											<argument exp='&quot;--CreatingFile--&quot;' />
										</command>
										<command class_type='comment' title='' comment='Here we create the log file called &quot;log1.csv&quot;
' textarea='12,0,12,0' />
										<command class_type='call' title='Call Component Macro' component='Vinculum1' macro='CreateFile' >
											<argument exp='&quot;log1.csv&quot;' />
										</command>
										<command class_type='comment' title='' comment='Before you can continue you need to close the file that you have created.
' textarea='12,0,12,0' />
										<command class_type='call' title='Call Component Macro' component='Vinculum1' macro='CloseFile' >
											<argument exp='&quot;log1.csv&quot;' />
										</command>
										<command class_type='delay' title='Delay' exp='750' type='1' />
										<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Cursor' >
											<argument exp='0' />
											<argument exp='1' />
										</command>
										<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='PrintString' >
											<argument exp='&quot;------Done------&quot;' />
										</command>
										<command class_type='delay' title='Delay' exp='750' type='1' />
										<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Clear' />
										<command class_type='comment' title='' comment='After this step we create a loop where we will begin logging the temperature
data into the newly created file &quot;log1.csv&quot;

Therefore we need to open the file to allow any write actions to happen' textarea='12,0,12,0' />
										<command class_type='call' title='Call Component Macro' component='Vinculum1' macro='OpenFile' >
											<argument exp='&quot;log1.csv&quot;' />
										</command>
										<command class_type='loop' title='Loop' exp='StartLogging = 0' type='1' start='0' count='1' breakend='0' >
											<flowline >
												<command class_type='call' title='Call Component Macro' component='One_Wire1' macro='DS1820_StartConversion' />
												<command class_type='call' title='Call Component Macro' component='One_Wire1' macro='DS1820_ReadScratchpad' />
												<command class_type='call' title='Call Component Macro' component='One_Wire1' macro='DS1820_GetTemp' >
													<return exp='DS1820_Raw' />
												</command>
												<command class_type='calculation' title='Calculation' >
													<exp exp='// Calculating the temperature with one decimal point' />
													<exp exp='DS1820_Calc = (DS1820_Raw * 10) / 16' />
													<exp exp='' />
													<exp exp='// Converting the result into a string variable' />
													<exp exp='// And split this string into a HI and LOW part' />
													<exp exp='DS1820_TempStr = ToString$ (DS1820_Calc)' />
													<exp exp='DS1820_Hi = Left$ (DS1820_TempStr,2)' />
													<exp exp='DS1820_Lo = Right$ (DS1820_TempStr,1)' />
													<exp exp='' />
													<exp exp='// Combine the Hi and Lo strings together' />
													<exp exp='DS1820_TempStr = DS1820_Hi + &quot;,&quot; + DS1820_Lo' />
													<exp exp='' />
												</command>
												<command class_type='comment' title='' comment='Printing the temperature info to the LCD' textarea='12,0,12,0' />
												<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Cursor' >
													<argument exp='0' />
													<argument exp='0' />
												</command>
												<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='PrintString' >
													<argument exp='DS1820_TempStr' />
												</command>
												<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='PrintAscii' >
													<argument exp='223' />
												</command>
												<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='PrintString' >
													<argument exp='&quot;C&quot;' />
												</command>
												<command class_type='call' title='Call Component Macro' component='SW1_Stop' macro='ReadState' >
													<return exp='SW1' />
												</command>
												<command class_type='comment' title='' comment='preparing the temperature data for logging' textarea='12,0,12,0' />
												<command class_type='calculation' title='Calculation' >
													<exp exp='// We must inlcude a seporation charcter ad the and of every' />
													<exp exp='// datapoint so excel can manage the file easy' />
													<exp exp='' />
													<exp exp='DS1820_Log = DS1820_TempStr + &quot; &quot;' />
												</command>
												<command class_type='comment' title='' comment='here we appending the DS1820_log to the opened file &quot;log1.csv&quot;' textarea='12,0,12,0' />
												<command class_type='call' title='Call Component Macro' component='Vinculum1' macro='AppendStringToFile' >
													<argument exp='DS1820_Log' />
												</command>
												<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Cursor' >
													<argument exp='0' />
													<argument exp='1' />
												</command>
												<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='PrintString' >
													<argument exp='&quot;DP:&quot;' />
												</command>
												<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='PrintNumber' >
													<argument exp='Datapoints' />
												</command>
												<command class_type='calculation' title='Calculation' >
													<exp exp='Datapoints = Datapoints + 1' />
												</command>
												<command class_type='call' title='Call Component Macro' component='SW1_Stop' macro='ReadState' >
													<return exp='SW1' />
												</command>
												<command class_type='decision' title='Decision' exp='SW1 = 1' swap='0' >
													<flowline >
														<command class_type='comment' title='' comment='if we are done datalogging close the file
If you forget to close the file when pulling out the USB device
the data maybe corrupted.' textarea='12,0,12,0' />
														<command class_type='call' title='Call Component Macro' component='Vinculum1' macro='CloseFile' >
															<argument exp='&quot;log1.csv&quot;' />
														</command>
														<command class_type='calculation' title='Calculation' >
															<exp exp='StartLogging = 0' />
														</command>
													</flowline>
													<flowline />
												</command>
											</flowline>
										</command>
										<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Cursor' >
											<argument exp='0' />
											<argument exp='0' />
										</command>
										<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='PrintString' >
											<argument exp='&quot;------Stop------&quot;' />
										</command>
										<command class_type='delay' title='Delay' exp='10' type='2' />
										<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Cursor' >
											<argument exp='0' />
											<argument exp='0' />
										</command>
										<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='PrintString' >
											<argument exp='&quot;--StartLogging--&quot;' />
										</command>
										<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='Cursor' >
											<argument exp='0' />
											<argument exp='1' />
										</command>
										<command class_type='call' title='Call Component Macro' component='lcd_eb005' macro='PrintString' >
											<argument exp='&quot;----PressSW0----&quot;' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='bad48577-412a-4b14-bfa0-5e8bd7337a86' vmin='0' vmaj='1' codename='Vinculum1' x='0' y='40' z='1.005' 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 >
					<value target='Flow_RTS' data='$PORTC.5' />
					<value target='Flow_CTS' data='$PORTC.4' />
					<value target='CHANNEL' data='001' />
					<value target='BAUD_LIST' data='004' />
					<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.7' />
					<value target='CTS' data='$PORTB.1' />
					<value target='RTS_1' data='$PORTB.2' />
					<value target='TXRemap' data='' />
					<value target='RXRemap' data='' />
					<value target='label' data='Vinculum 1' />
					<value target='ConsoleColumns' data='64' />
					<value target='DataSource' data='001' />
					<value target='com_port' data='000' />
					<value target='Injector' data='000' />
					<value target='InjectorHandle' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='d29dda88-17de-4008-991a-c881890d4c57' vmin='1' vmaj='1' codename='lcd_eb005' x='0' y='0' z='5.335' 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 >
					<value target='Pin_Data_0' data='$PORTB.0' />
					<value target='Pin_Data_1' data='$PORTB.1' />
					<value target='Pin_Data_2' data='$PORTB.2' />
					<value target='Pin_Data_3' data='$PORTB.3' />
					<value target='Pin_RS' data='$PORTB.4' />
					<value target='Pin_E' data='$PORTB.5' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='a31b1f0a-4221-490d-ae25-027868688f0b' vmin='0' vmaj='1' codename='SW0_Start' x='-56' y='0' z='3' 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 >
					<value target='pin' data='$PORTA.0' />
					<value target='polarity' data='000' />
					<value target='debounce' data='' />
					<value target='operation' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='a31b1f0a-4221-490d-ae25-027868688f0b' vmin='0' vmaj='1' codename='SW1_Stop' x='56' y='0' z='3' 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 >
					<value target='pin' data='$PORTA.1' />
					<value target='polarity' data='000' />
					<value target='debounce' data='' />
					<value target='operation' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='64b26b13-68cf-4a92-8616-e882b7c71023' vmin='1' vmaj='1' codename='One_Wire1' x='0' y='72' z='1.005' 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='oo_pin' data='$PORTD.0' />
					<value target='crc_en' data='0' />
					<value target='label' data='1-Wire' />
				</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='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAAwQQAAJEDAAA' zoom='70' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
