LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Running data continuously in a database

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

0 Kudos
Message 1 of 20
(4,190 Views)

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.

0 Kudos
Message 2 of 20
(4,177 Views)
0 Kudos
Message 3 of 20
(4,175 Views)

I did that and nothing when i run it with my code sampling the voltage the numbers dont change they stay infinity.

0 Kudos
Message 4 of 20
(4,169 Views)

I dont understand you. But anyways i got the same results wont show numbers.

0 Kudos
Message 5 of 20
(4,164 Views)

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

0 Kudos
Message 6 of 20
(4,126 Views)

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.

0 Kudos
Message 7 of 20
(4,115 Views)
I can't open the VI right now but your description sounds just wrong. If you have one loop acquiring, the write to the database should be in the same loop and not passing it to another unless you are passing via a queue as in the producer/consumer design. It is also pretty senseless to create the database or table. Create the table once in it's design environment.

Please attach an image of the block diagram. Create a snippet (look up how in the help).
0 Kudos
Message 8 of 20
(4,104 Views)

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.

 

Glad to answer questions. Thanks for any KUDOS or marked solutions 😉
Message 9 of 20
(4,093 Views)

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.

0 Kudos
Message 10 of 20
(4,083 Views)