LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how statechart can access front panel dynamic input

How can I get the value of a control (as set by the user) on a calling VI Front Panel to evaulate/use within a state Exit while loop in of a called StateChart?

0 Kudos
Message 1 of 7
(2,570 Views)

Hi ggeisen,

 

I'm not sure if I completely understand your question.  Could you possibly explain a little more?

 

Thanks,

 

 

 

Justin D.

Applications Engineer
National Instruments
0 Kudos
Message 2 of 7
(2,541 Views)
0 Kudos
Message 3 of 7
(2,519 Views)

Thanks for the explanation.

 

It sounds like you may have your control outside of your loop.  When your loop runs, it will only keep the value of the control when it was first read into the loop.  If you place the control inside the loop, it will read the new value of the control each time the loop executes.

 

Hope this helps,

 

 

Justin D.

Applications Engineer
National Instruments
0 Kudos
Message 4 of 7
(2,495 Views)

I started with the async statechart example -- contains trigger loop and a statechart loop.  Inside the statechart loop there is a Run Statechart.  Also in this loop are my inputs to the Statechart. Everything is good so far. As each state is entered, the correct input is obtained.  Then I added a PID.vi inside a loop to one of the state action tabs.  When that particular state is entered and the PID loop runs, I no longer get updated input values.  I've tried to copy and reference the Inputs onto the action tab diagram to no avail.

 

I've attached my VI and lvsc for some hopeful assistance.

Download All
0 Kudos
Message 5 of 7
(2,487 Views)

Hey ggeisen,

I looked at your VI's, and did not see your PID.VI inside the loop. Did i miss it in the .lvsc?

Try this Knowledge Based Article: How Can I Update the Front Panel of a Calling VI From a SubVI?

This may be able to help since you are dealing with controls and sub VI's

Ricky

National Instruments
Applications Engineer
0 Kudos
Message 6 of 7
(2,456 Views)
I have never used state chart module before but from whay you describe and my limited knowledge I dont think you're using it right.
you probably shouldnt have a while loop inside a state... Rather just make the while loop with the state chart. Go back to the same state with the PID block ober and over again until a different state transition is needed.
Stephen B
0 Kudos
Message 7 of 7
(2,444 Views)