06-14-2013 10:24 AM
I am new to using Databases with Labview.
I am trying to write some data to the table I made in database of SQL server express 2012 using Labview. I am using the "DB tools Insert Data.vi" to insert some random data to the table. But when I try to enter some data through the front panel, it doesn't let me write anything.
To keeps things simple for now, I am just using 1 column in the table and just writing any to that column. Could anyone point out what I am doing wrong or how I can solve this issue?
I have also attached the sample VI I made for this.
Thanks
06-14-2013 11:22 AM
You haven't connected data type connector on DB tools Insert Data.vi... what type of data are you trying to write to the table? You will need to specify that first. I can't tell if you mean that you see a "broken arrow" prohibiting you from running the vi or if there is some other issue. If you are familiar with database calls, communicating from LabVIEW isn't any different - those built-in functions are simply making such calls to the database on a lower-level (in fact there are even freeware toolkits for database connectivity that you can find on this site through search or on Lavag.org and look inside such toolkit functions to understand what is being done.) Mind you - data type you use must match what you have specified for that field in your database table.
-DP
06-14-2013 11:22 PM
Can you attach 2011 format of your VI.
06-17-2013 10:11 AM
Thanks Guys,
I was able to find the solution.
08-27-2014 12:36 PM - edited 08-27-2014 12:47 PM
What was your solution? I'm having the same issue.
I'm trying to create a table of accelerometer data using the Database Logging example VI. I've attached the VI I'm working with so you can help me step through this... If you look under the "Acquire Data" heading, you'll see a while loop that contains the database logging code I'm having trouble with. I've created a .udl file that successfully connects to the SQL server I want to write my data to, but I can't seem to get it to create a table and write my data to it. I've used my number of samples as the input for the number of rows in the table, and my sample clock timing as an input to the Wait function for the while loop iterations.
Any ideas? I'm stuck...
08-27-2014 02:16 PM
@dzehner2 wrote:
What was your solution? I'm having the same issue.
I'm trying to create a table of accelerometer data using the Database Logging example VI. I've attached the VI I'm working with so you can help me step through this... If you look under the "Acquire Data" heading, you'll see a while loop that contains the database logging code I'm having trouble with. I've created a .udl file that successfully connects to the SQL server I want to write my data to, but I can't seem to get it to create a table and write my data to it. I've used my number of samples as the input for the number of rows in the table, and my sample clock timing as an input to the Wait function for the while loop iterations.
Any ideas? I'm stuck...
No clue. Don't have LabVIEW 2014.
08-27-2014 03:23 PM
08-27-2014 03:47 PM
Sorry. I don't have Labview 2014, so can't open your VI
08-27-2014 04:00 PM
Here's the portion of the VI that handles the data exchange with the SQL server. I can post other areas of the VI if that will help. The wait function is using my sample rate and total number of samples to determine when to send the data to the server. The integer input into the table comes from the total number of samples (so it will create 1 table row for each sample).
08-27-2014 04:06 PM
Right now, your code has boolean set to False for creating a table.
Yet in your first post, you write that you want to create a table.