08-20-2009 11:48 AM
Appreciate for the detailed explanation. I completely got what you suggest to do. I think firstly I need to create a sensorid table to describe all 200 sensors and assign ID to each one. Now, my question is, still no clue at this point, how to WRITE such a vi to record the 3-column data.
Let's use your example, 2 sensors, 2 fieldpoint read.vi. Let's forget about shared variables and do everything in one loop. Could you please make a simple vi to achieve this? I guess we need to call the sensorid table at some point? How can I specify the sensor to the ID in the table (or vice versa) in the vi program?
08-20-2009 02:07 PM
Unfortunately, I can't create such a VI because (a) I don't have Fieldpoint, and (b) I don't have the Database Toolkit. As far as the database stuff is concerned, if you choose to use a sensor table you can get the sensor ID by a SQL query via the "DB Tools Execute Query" VI. Your select statement would be something like this: "SELECT sensor_id FROM tblSensors WHERE ...". The WHERE clause would be where you would put in the conditions for a match (like module, channel, etc). I would get all the sensor IDs at the start of the program so you don't have to keep hammering the database asking for a sensor ID. Alternatively, you can simply fetch the entire table using "SELECT * FROM tblSensors" and use LabVIEW code to search for the IDs.
With respect to adding entries you would use "DB Tools Insert Data". The Database Toolkit ships with examples. Your best bet is to stufy these examples along with a test database and tables so you see how it works.
08-20-2009 03:02 PM