11-30-2011 01:05 AM
Good morning,
For my internship I have an assignment to read out, and adjust a database with variables. This SQL server 2005 database contains variables of a controller. These are read and write variables. The assignment is to display the read variables, and to make the user able to adjust the write variables. The first part was "easy" because the forum contained a lot of examples about this subject. The second part is more difficult because the forum contains absolutely no examples about this subject. I can use LabVIEW 2010, and 2011, and also I have downloaded the thirty day trial of the database connection toolkit. If it is useful, I can advise my company to buy this package. The read vi makes use of an UDL (Microsoft data link) connection.
So my question to you guys is: Is it possible to adjust specific variables in a database by using LabVIEW? And maybe you can give me a little advice about how to do this...
Thanks ahead!
Roy
Solved! Go to Solution.
11-30-2011 01:55 AM
You can easily perform a SQL Update query through LabVIEW, which'll adjust data.
/Y
11-30-2011 09:18 AM
Ok, but can you tell me which subvi I should use for that? Am I also able to adjust specific data?
Thanks for the reaction!
Roy
11-30-2011 09:42 AM
In SQL the specific data is always selected with the WHERE keyword. In the Update VI there's a connection for options, you can e.g. add a constant "WHERE id=1457 and measurement > 0.54"
You can ofc. also build that string through controls, parameters and other ways.
If you prefer you can use the Execute query (under advanced sub-tab i think) to which you can send the complete query e.g. "Update TestTable set name='Zeus' where id> 14 and id < 57"
/Y
12-01-2011 12:36 AM
Thanks a lot!
I'll give it a try today!
Roy
12-01-2011 02:30 AM
It works well!
I can now construct a query with the concatenade string function,
so the user only has to fill in the data-id which has to be changed!
Thanks again,
Roy
12-01-2011 05:57 AM
Great, thanks for the feedback.
/Y