LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading values from out loop inside the loop

Solved!
Go to solution
Highlighted

Hello, 

 

The attached vi is part of a code used to control in the Single-axis Stage Controller.

in the second frame of the flat sequence, I read the current position.

But in the third part, I will use this value of the current position in another goal.

Or, I want to show the current position during the while loop works.

As you see now. as the loop start. the update of the current position is stoped. Only the final value will appear after the loop is finished.

And also, if I build all the second part of the sequence (reading current position), inside the loop, the value will not be updated. 

Do you have an idea of how to update the current value inside the loop.!! 

0 Kudos
Message 1 of 4
(190 Views)
Highlighted

A few cosmetic things you really need to fix:

1. Your terminals need to have labels.  As it is now, you have no clue what control is wired up where.  This will bite you hard very soon.

2. You should work on eliminating your local variables.  You can simply wire values through your structures to propagate the value.  I am specifically looking at the Port here.

 

As far as your issue, just copy the code in your second sequence frame into your loop and you can constantly update it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 2 of 4
(176 Views)
Highlighted

Thank you for the advice, 

 

I already try to copy the current statues code inside the loop, but i get nothing 

 

0 Kudos
Message 3 of 4
(166 Views)
Highlighted
Solution
Accepted by topic author BaJa_2020

Hi BaJa,

 

as crossrulz said "no locals, no sequence frames":

Your (missing) subVIs should get the usual 4224-pattern connector and support error IO to allow for easier DATAFLOW programming!

Why did you hide all terminal labels in the block diagram???

(The loop probably needs some wait statements…)

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 4 of 4
(162 Views)