LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with writing data to the table in SQL server express 2012 database using labview

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

0 Kudos
Message 1 of 17
(3,743 Views)

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

 

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


0 Kudos
Message 2 of 17
(3,732 Views)

Can you attach 2011 format of your VI.

 

 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 3 of 17
(3,706 Views)

Thanks Guys,

 

I was able to find the solution. 

0 Kudos
Message 4 of 17
(3,681 Views)

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...

0 Kudos
Message 5 of 17
(3,575 Views)

@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.

0 Kudos
Message 6 of 17
(3,559 Views)

Sorry. I don't have Labview 2014, so can't open your VI

0 Kudos
Message 8 of 17
(3,546 Views)

 

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).

SQL server logging loop.PNG

Message 9 of 17
(3,540 Views)

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.

0 Kudos
Message 10 of 17
(3,534 Views)