11-01-2015 04:00 PM
Hello so i am trying to connect to a database and upload all my information, that is the frequency and amplitude. This VI is sampling a voltage continuously from a microcontroler and the frequency and Amp should be constanstaly uploading these value for as long as i am sampling the voltage. I have the frequency and Amp coming out of one while loop into another one that is connected to the database. I connected the frequency and amp to a cluster, then routed to the data part of the "insert DB" function. I am also creating the table and columns at the same time cause it a empty database. Can somone please let me know if my set up is right. I would like to connect to ACCESS database before i connect to MYSQL. If i can connect to ACCESS im guessing connecting to mysql should be no problem. Thanks
11-01-2015 04:39 PM
It created the table and columns but the values in the columns are like infinity. I did the connection in ACCESS database. See attached picture.
11-01-2015 04:41 PM
11-01-2015 04:44 PM
I did that and nothing when i run it with my code sampling the voltage the numbers dont change they stay infinity.
11-01-2015 04:47 PM
I dont understand you. But anyways i got the same results wont show numbers.
11-01-2015 05:10 PM
Why are you using a database? If you are acquiring sampled data, a Database strikes me as a very poor choice (and much harder to work into LabVIEW code). I tend to use Binary files (with XML headers describing the file format) for speed and simplicity, but another excellent alternative is TDMS.
Bob Schor
11-01-2015 05:20 PM
it part of a project my teacher want to be able to remotely access the data and view through a database in this case mysql. But i am trying to do it in ACCESS so thats why The data gonna be stored in there. If that makes sense.
11-01-2015 05:26 PM
11-01-2015 05:41 PM
Access SQL and MS SQL do have some differences. You are not guaranteed that it will work in both. You might want to look into MS SQL express. It is a free download, and you're better off working with a better database. I'm not certain if Access is still using the JET engine, but this has been deprecated since MDAC 2.7.
https://msdn.microsoft.com/en-us/library/ms810810.aspx
I would suggest putting a diagram disable around everything that has nothing to do with the database. Input constants, and get the database functions working before looking into the rest of it. This will simplify things a great deal. You should put a time delay in the loop to so it doesn't eat up too much processor time.
After getting the database working remove the diagram disable and put one on the database loop. When this code is working the way you want get rid of the diagram disable and tie them together. With both "ends" working if it doesn't work you need to look at the way you are transporting data from working code to working code.
You might want to look at how you are stopping your loops.
Debugging can be tricky, but when you have problems try to isolate small sections of code for testing. It is even better to write small sections of code, prove it, and then add more small sections of code prove it, etc...
Sometimes it is fun to make larger sections all at once, but on code that isn't similar to something you know very well it isn't always the best approach.
11-01-2015 05:49 PM
Hello yes you are right i shouldnt be creatiing the table. So now that i have the table i replaced the function with a "DB update". So it can just update the specified table and columns. But i have attached an image of the code.