03-09-2017 09:02 AM
How can I dynamically insert items (data strings) into a table (Silver) from different cases within a state machine without deleting items already in the table?
Thank You:)
03-09-2017 09:11 AM
Insert into Array ?
The array that holds the data for the table should be held in a shift register ?
If those tips don't help, then please attach a VI so we can see what you are doing now.
03-09-2017 09:16 AM - edited 03-09-2017 09:18 AM
A table is just a String Array with a pretty front panel. Try the "Insert into Array" primitive.
But I am guessing RavensFan is probably right and you need some shift registers to pass the table between iterations.
03-09-2017 01:14 PM
I tried insert into array, however, I'm in a different case and use insert into array, it overrides everything in the table. It's not indexing to the next row or column.
Is there a way to allocate items within the table in real time?
Thanks for the feedback,
03-09-2017 01:24 PM - edited 03-09-2017 01:24 PM
@floresma wrote:
I tried insert into array, however, I'm in a different case and use insert into array, it overrides everything in the table. It's not indexing to the next row or column.
Is there a way to allocate items within the table in real time?
Thanks for the feedback,
You need to post your code, as you must be doing it wrong.
But it really sounds like you do not have any shift registers to maintain the contents of the Array between iterations.
03-09-2017 01:29 PM - edited 03-09-2017 01:32 PM
Here's a picture of a statemachine updating a table using insert into array.
Notice the shift registers on the for-loops.
I forgot to ask if you are keeping track of the row and column you are inserting to?
03-10-2017 09:09 AM
Thanks for the feedback... However, I'm trying to find a way to do the same thing without using a shift register which makes the code messy. I tried creating a sub vi that I can wire into but it also keeps overriding data...
Is there a way to do this without a shift register?
03-10-2017 09:13 AM - edited 03-10-2017 09:16 AM
Hi floresma,
do the same thing without using a shift register
Use a feedback node instead! 😄
which makes the code messy.
I never heard of shift registers making code "messy"!
Why do you think so?
I tried creating a sub vi that I can wire into but it also keeps overriding data...
So the subVI needs to keep track of your data.
Sounds like a typical FGV (functional global variable) aka AE (action engine) approach - which heavily relies on using shift registers…
Did you do the basics course for LabVIEW beginners? Did you take the chapters on data handling in loops? I guess you should (re)take them…
03-10-2017 09:15 AM - edited 03-10-2017 09:20 AM
@floresma wrote:
Thanks for the feedback... However, I'm trying to find a way to do the same thing without using a shift register which makes the code messy. I tried creating a sub vi that I can wire into but it also keeps overriding data...
Is there a way to do this without a shift register?
Do you want pretty code or functional code?
Have you thought about using a "Functional Global" or "Action Engine"?
03-10-2017 09:23 AM
I'm not a fan of messy code, so if possible I prefer clean and functional:)
I'm trying to eliminate the number of tunnels within the code. I would prefer a subvi that can be placed in sections of the code.