06-18-2020 02:27 AM
Hi, i am selecting some data from mysql and putting them into a 2d string array. For my diploma project, i am trying to extract from that array just the first value because i am refreshing the array always ( deleting them at the end of the application, pressing a button and it's refreshed). I have tried everything, using a duplicate, using the reference of the table and it's not working.
here you can find some screenshots . could you guys help me because i m kind of blocked here and i need to present my project xD
just the first column is populated. i have no experience with labview, but i need to simulate something using labview and codesys, the connection been made using OPC. thanks guys
Solved! Go to Solution.
06-18-2020 02:34 AM
Hi mihai,
@mihai_badea wrote:
i am trying to extract from that array just the first value because i am refreshing the array always ( deleting them at the end of the application, pressing a button and it's refreshed). I have tried everything, using a duplicate, using the reference of the table and it's not working.
just the first column is populated. i have no experience with labview,
Simple basic LabVIEW: to index an element from an array you should use the IndexArray function…
When you want/need to use LabVIEW you should learn the basics first: there is a "Training resources" section right in the header of the LabVIEW board. And NI also offers the online self-paced courses for free right now, so you could immediatly start with "LabVIEW Core 1" training!
06-18-2020 02:38 AM
Hi, i have tried using the indexarray, but it's not working when it comes to the reference. after duplicating the array, it was working, but i need to use it as a reference so that it updates while running the app.
also, i have watched the tutorials
06-18-2020 02:42 AM - edited 06-18-2020 02:44 AM
Hi mihai,
@mihai_badea wrote:
Hi, i have tried using the indexarray, but it's not working when it comes to the reference. after duplicating the array, it was working, but i need to use it as a reference so that it updates while running the app.
???
Why do you need any references to "update it while running the app"?
(To update an indicator you just need to use a loop and write more than once to that indicator…)
Why do you need to "duplicate" an array indicator when you just need to use a wire?
Simple like that:
06-18-2020 03:00 AM
hi, thanks a lot of the replies and the pieces of advice provided,
i need to use the reference because i am extracting data from my database ( SQL ) using select, and in my main program, I call the sql function everytime i press a button. Long story short, but i am trying to accomplish here is to simulate the returning of a book automatically using codesys and i need to extract a code ( ISBN CODE for the book) in order to update my sql using delete, insert update etc.
As you can see in the screenshot below, i dont know why, but it's not working, as you can see bellow
trying to replicate my array :
that s what i have done before posting
trying to use the reference ;
06-18-2020 03:19 AM
Hi mihai,
@mihai_badea wrote:
i need to use the reference because i am extracting data from my database ( SQL ) using select, and in my main program, I call the sql function everytime i press a button. Long story short, but i am trying to accomplish here is to simulate the returning of a book automatically using codesys and i need to extract a code ( ISBN CODE for the book) in order to update my sql using delete, insert update etc.
I still don't see a use case for using references here.
You read data from SQL database: use the data you got and apply IndexArray on it!
@mihai_badea wrote:
As you can see in the screenshot below, i dont know why, but it's not working
trying to use the reference ;
As you already took some courses (did you?) you know the purpose of control references. A reference is like a pointer to a control, but it is NOT the value of that control!
LabVIEW comes with a huge example library, and there are examples explaining how to use references!
06-18-2020 03:38 AM
thank you very much, using the property worked perfectly for me, appreciate your efforts trying to help me 🙂 thank you again