LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

saving the latest value in Shift Register

Solved!
Go to solution

Hi Alex,

 

get the greatest ID value from your DB and increment it in LabVIEW…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 11 of 17
(1,404 Views)

If you are using Microsoft SQL, the auto increment column is called an identity.  If you want to know the identity value after inserting a row, there is an internal SQL function called SCOPE_IDENTITY().  I use this function in my stored procedures to return the identity.

Capture.PNG

aputman
Message 12 of 17
(1,390 Views)

I am not so good at DB and working with it throught Labview, also I tried GerdW´s solution with write and load from file but it didnt work as I expected.

Maybe I do something wrong as Im not so experienced in Labview.

Can anybody give there a Vi with the simpliest way for me?

Thank you for your answers anyway 🙂

0 Kudos
Message 13 of 17
(1,388 Views)

Yes I use MS SQL and i have the same setup for autoincrementing, but that doesnt work when i am loading data to the table

0 Kudos
Message 14 of 17
(1,385 Views)

Show your table design.  I assume you are using Server Management Studio, what happens when you right click the table, Edit Top 200 Rows, and type new data into the table?  Do not type in a value for the identity column.  Does the identity column increment?

aputman
0 Kudos
Message 15 of 17
(1,374 Views)

The ID column increments if I type the values excepting ID number into the table through management studio, but through labview it doesnt work as well. Its still a mystery why there are differences between inserting values through Management studio and Labview but fortunately after a little modification GerdW´s code work 🙂

0 Kudos
Message 16 of 17
(1,346 Views)

Many SQL based databases support different ways of writing data to it. For instance PUT and INSERT are different in the internal functionality.

Are you sure that you use the same function in LV as the manager tool uses internally?

 

However, glad to hear that you managed to implement a solution for your task.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 17 of 17
(1,335 Views)