Storing data from remote systems

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):

  1. Create a record containing the data you wish to store. Create an array of these records.
  2. Create a filevar-register that uses your array as its datatype
  3. Enter a name in your filevar-register under “USB_filename”
  4. Implement a button in your visualization to save to USB (using the filevar – method)
  5. How you choose to collect data and fill up you array is up to you J

Requirements for the dairy-side database interface component that is located in the COPP PC:

  1. Create a filevar-register with the same array type and the same USB-name as the one you created for the data collection component.
  2. Create a database register (see the tutorial “Exporting data from VIGO6 using ODBC” which also explains the prerequisites for your database/excell).
  3. Implement a button in your PC visualization to load from USB (using the filevar – method), or call this method during start-up.
  4. 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):  

  1. Fetch the following zip file and unpack it to a folder on your PC

http://www.proces-data.com/pub/Test_data_save.zip

  1. 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)

  1. Start the exe_file V6_COPP_DEVICE.exe and follow the instructions on the screen.

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).