From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-27-2014 04:09 PM
08-27-2014 05:22 PM
If you are planning to write a lot of data and really fast into SQL table, You should make the VI in 2 steps.
Step 1: Write the data to a text file
Step 2: Read from text file and write to the SQL table.
The reason being that you cannot write really fast and lot of points from labview to SQL. You will loose half of the points in the process.
When you write to the text file, its way faster and you have all the data secured. Then you can run the other part and it might take like 5 mins approximetly (depending on the number of points you are reading) to send the data to SQL.
08-27-2014 05:30 PM
I have attached an example for reading from text file to SQL. Maybe that helps
08-27-2014 06:01 PM
08-28-2014 07:06 AM
@Dennis_Knutson wrote:
None of that makes any sense. The wait is not required, nor the while loop. If it works at all, it would just keep writing the same data over and over again. What is the actual data type in the cluster? I suspect you need a for loop to write each row.
The actual data type is DBL, it's just acceleration in g. I had the wait and the while loop in there from the example on continuous logging, but I had suscpicions it wasn't really necessary.
08-28-2014 07:07 AM
@manny09 wrote:
I have attached an example for reading from text file to SQL. Maybe that helps
Let me just make sure I understand your VI... You write to a text file, and then call that file name into the loop that connects to your SQL server and insert it into a table? That would work... I'll give it a shot!
08-28-2014 08:19 AM - edited 08-28-2014 08:21 AM
First off, you only have to create the table once -- ever. While you can do that in LV, you will hardly ever want to.
Second, the DCT will make life infinitely more difficult for you. The process for inserting data into a database is really very easy and the DCT does an excellent job of hiding that simplicity beneath a complex, proprietary interface.
Check out this thread for most of what you need to know to use databases easily -- including some free drivers.
Mike...