How to store data collected on SD-card in PD 688 or PD 803, via a USB memory stick and a COPP PC into a database/excel sheet
The below illustration shows a system setup, where a milk truck collects data during the day and these data must go into the dairy, but there is no means of an on-line connection between the dairy and the truck. In this case, you can save data to database/excel by storing the collected data in the filevar-register and transferring these data via an USB memory stick.
Requirements for the truck-side component for the data collection that is located in PD 688 (or PD803/PD 802):
- Create a record containing the data you wish to store. Create an array of these records.
- Create a filevar-register that uses your array as its datatype
- Enter a name in your filevar-register under “USB_filename”
- Implement a button in your visualization to save to USB (using the filevar – method)
- How you choose to collect data and fill up you array is up to you J
- Create a filevar-register with the same array type and the same USB-name as the one you created for the data collection component.
- Create a database register (see the tutorial “Exporting data from VIGO6 using ODBC” which also explains the prerequisites for your database/excell).
- Implement a button in your PC visualization to load from USB (using the filevar – method), or call this method during start-up.
- Implement a routine that reads data record by record, from the filevar-register (which is an internal SD-file on the PC) and store the data into the database register (NB! First you must copy the data from the physical USB memory stick into the COPP PC- folder “USB”).
Try it out (using MID reports.cfv as an example):
- Fetch the following zip file and unpack it to a folder on your PC
- In the folder “COPP PC” open the excel sheet MID_reports.xls”. It should contain only column-headings in row 1 (you must select ‘Enable for editing’ first time it is opened).
Extract: (more columns exist in the spreadsheet)
NB! In screen step 1:
If you do not have a file from a “real life system” use the demo-file provided in the root folder: ‘MID reports.cfv’ as shown below (you must be a little patient when data are loaded into excel, since there are almost 8000 records J).