LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

connect sql using matlab script

hi i want to connect to sql database and populate coloum values in dropdown menu

for this i am using ring 

 

how to take the coloum values as output

 

i tried is as string but it throws error

 

addpath('C:\mym');
myopen('localhost','root','demo');
mym('use first');
menu_list=mym('select * from menu');
Test = unique(menu_list.Test_Type);

 

i want test as output which has 4 values

 

pls help me to sort it out

Download All
0 Kudos
Message 1 of 5
(2,650 Views)

what is the error?  

http://www.medicollector.com
0 Kudos
Message 2 of 5
(2,604 Views)

Regarding your Ring question, I am unsure what you are asking.  You select different values for the Ring as shown in: http://zone.ni.com/reference/en-XX/help/371361K-01/glang/ring_constant/ (Follow the "add or remove" link there, too.)  I didn't see any SQL code there.  Can you define the question a little better?

 

The "unique" function is suppsoed to return an array of numerics: http://www.mathworks.com/help/matlab/ref/unique.html Thus, in your code, Test should be output (on the right side of the MATLAB script node) as such.  See: http://zone.ni.com/reference/en-XX/help/371361K-01/gmath/matlab_script_node/ (Follow the "set its data type" link there, too.)

 

Please try to use the LabVIEW Help to find out more about the functions you are using in LabVIEW.

 

Best,

 

 

Ryan C.
Applications Engineer
National Instruments
0 Kudos
Message 3 of 5
(2,593 Views)

Hi

 

I have a ring structure in which i am loading a string array of four variables and its property is strings[]

 

but while i run the code it is showing only first value 

on mouse down nothing is getting changed

 

 

0 Kudos
Message 4 of 5
(2,560 Views)

So, is the result of your MATLAB Script Node correct?  Is the result of the Spreadsheet String to Array function correct?  If you are trying to programmatically choose the iteams you can select in your Ring, the property node you are using works correctly for me.

Ryan C.
Applications Engineer
National Instruments
0 Kudos
Message 5 of 5
(2,537 Views)