LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Easier way to insert more than 100 LabVIEW data into database???

Hi all,

 

Currently, I have more than 100 fields of data that LabVIEW generated and insert into the DB using "Insert into DB" VI.  Right now, I am using the cluster bundle to combine all of the data fields into a cluster and then insert that into DB.  This is very cumbersome and not very efficient and not very flexible.  I hope someone can provide me some suggestions of making this more efficient and flexible.  Thank you.

0 Kudos
Message 1 of 3
(3,447 Views)
Yes, it is clunky. The fix has two parts:

1. Kick the database connectivity toolkit to the side of the road. There are free drivers available that are easier to use and improve your support options. Check my blog (the link is in my signature) for some good drivers.

2. Fix the database design. 100 columns in a single table is absurd as it shows no modularity -- or in database speak: normalization. For example, in your code there are 9 iterations of the same 10 item cluster. My intuition tells me that depending upon what they are storing, they should either be 1 record in 9 different tables or 9 records in one table, but certainly not 90 columns in one table.

Honestly if the database design weren't so bad you could probably get by with the DCT.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 3
(3,436 Views)

Wow, that actually looks much nicer than I was expecting! You will at least want to make your clusters into type definitions (I see you have done one already). You could even even make it into a class and create some accessor VIs to set certain parts of it. This will be nice for breaking your code up into smaller modules, and you can use the "Bundle by Name" nodes since you won't be so pressed for space. I always prefer Bundle by Name because I think it is less prone to errors.

 

I don't know what you have in that DAQ Cluster, but I'll call the top cluster coming out of it DAQ Cluster 1. Say you add some data to DAQ Cluster 1, all you would have to do is go back into the VI called "Set DAQ Cluster 1" and expand your unbundle on the input and your bundle on the output by 1. It will be much easier than trying to insert it into that giant node on the right and getting all your wires nice and straight again.

 

Good luck!

Message 3 of 3
(3,433 Views)