From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading values from out loop inside the loop

Solved!
Go to solution

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
(1,019 Views)

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
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4
(1,005 Views)

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
(995 Views)
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 LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(991 Views)