07-03-2018 05:17 AM - last edited on 07-03-2018 10:32 AM by Kristi_Martinez
07-03-2018 05:36 AM
Hi Aleix,
I can not write with the keyboard to the table control when the program is running.
Because that "Control table" is NOT a control, but an indicator!
Please rework your VI to use NO local variables, but a shift register to hold your table data. Then switch the table to be a control…
07-03-2018 06:06 AM
Ok, thanks, what a fail! Why i can't work with local variables? Isn't good?
The first doubt i explain(implement a loop with "goto"), you have any idea how to do it? Thank you so much for you help!
07-03-2018 06:12 AM
Hi Aleix,
Why i can't work with local variables? Isn't good?
As long as your VI runs without errors it's "good"…
That being said two reasons why you should avoid them when possible:
Local variables make it easier to create race conditions.
Local variables enforce data copies in memory.
(implement a loop with "goto"), you have any idea how to do it?
What is a "goto" (in LabVIEW context)?
Idea: Maybe you need to learn about using state machines…
07-03-2018 08:28 AM
I have a case that is called goto, this function should be to create a loop between the row where you add it and the number that you put in "Number". If you open the vi, you'll see that it's a case, inside of an event structure, for the run-time menu. I don't know how to implement this, because i need to link the number in "Number" with the row with the same number. For example, if i select "goto" in run-time menu and write 1 in "Number", this action make a loop between 1 and the row you place goto, in "Value" you write the number of loops you want to do. After that, i read through serial port, that's why i want a loop, to read the table control X times sequentially, and when it finish the loop, it still reading sequentially.
Thank you.
07-03-2018 09:46 AM
Hi Aleix,
For example, if i select "goto" in run-time menu and write 1 in "Number", this action make a loop between 1 and the row you place goto, in "Value" you write the number of loops you want to do.
So you want to implement a "FOR loop" instead of a "GOTO feature"!
A "FOR loop" needs (atleast) two parameters: the number of iterations and the position of the related "NEXT" as in text based programming like BASIC:
10 FOR x = 0 TO 9 20 do something 30 NEXT x