LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subvi's in State Machine

 


@VeeJay wrote:

Hmmmmm..... Now, to send the next state value to the SM? Can we just send that value from one subvi (the faster vi) to  the shift register of the SM since both loops are stopped now? That was my original question.


I don't know what you mean by the "faster" VI, but it's actually irrelevant which one is faster. Once both subVIs are stopped they generate their outputs. You decide what state to go to in the main VI, as you do now. This would likely be based on the values the subVIs generated, and whether or not the "error" flag was set.

 

0 Kudos
Message 11 of 19
(1,044 Views)

@VeeJay wrote:

Hmmmmm..... Now, to send the next state value to the SM? Can we just send that value from one subvi (the faster vi) to  the shift register of the SM since both loops are stopped now? That was my original question.

 


VeeJay.  Does it matter as to which subvi the next state definition comes from?  If not, then send it from the faster one.  As long as that subvi will always end before the other one will.  What is the next state anyway?  Can you describe a little more detail on what you expect from the subvi's with respect to choosing the next state in the main?

- tbob

Inventor of the WORM Global
0 Kudos
Message 12 of 19
(1,035 Views)

Ok.. i will be verbose here... 🙂

 

The wait state is where we wait for the user to choose one of the states ("pretest" or "start protocol")

Pretest is straight forward. Once that completes, it goes back to wait state. "wait" state has the icons to press a.k.a PRETEST, START PROTOCOL.

 

Once in "START PROTOCOL" case/state, two loops run in parallel "Speed" and "elevation" as mentioned before.

Now, if both run normally, both have to stop when the user wants them to.

When either one of the exceeds a safety limit, both have to stop; And then go to "WAit" case/state. So, that was what I was asking about, does it matter if the next state output from either subvi can update the shift register?

 

The next state after "START PROTOCOL" is "WAIT" Hope this is clear.

 

One the sidelines, I will shoot another question. 🙂 Wow, I am on a roll here asking so many questions.

How do you "reinitialize values to default" of subvi front panel from main and also clearing waveform charts using property nodes? And go.........

 

 

V

I may not be perfect, but I'm all I got!
0 Kudos
Message 13 of 19
(1,028 Views)

@VeeJay wrote:

Ok.. i will be verbose here... 🙂

 

 So, that was what I was asking about, does it matter if the next state output from either subvi can update the shift register?

 


Since both subvi's have to end before the main will go to the next state, it really doesn't matter which one sends the next state definition.  Choose as you please.

 


@VeeJay wrote:

How do you "reinitialize values to default" of subvi front panel from main and also clearing waveform charts using property nodes? And go.........

 


Don't try to reinit subvi values to default from the main.  Just put that method call as the first step in the subvi.  Use the error wire to ensure it will execute before any other code.  There is no need to reinit to default until the subvi is actually called.

If the waveform default is a clear chart, the reinit to default should take care of it.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 14 of 19
(1,020 Views)

By Method call, do you mean using a "property node" and "this vi" and link it to "reinitialize to default" and place it on the first frame of sequence and second frame would be the code. right?

 

V

I may not be perfect, but I'm all I got!
0 Kudos
Message 15 of 19
(1,016 Views)

Reinitialize to Default is called using an Invoke Node, not a Property Node. See How Do I Programmatically Reinitialize All My Front Panel Values to Default?

0 Kudos
Message 16 of 19
(1,011 Views)

@smercurio_fc wrote:

Reinitialize to Default is called using an Invoke Node


Symantics!  The knowledge base calls it a property node, which is wrong, I call it a method because you select Create - Method...   but the real name is Invoke Node as Smerc correctly pointed out.

- tbob

Inventor of the WORM Global
0 Kudos
Message 17 of 19
(1,003 Views)

 


@tbob wrote:

@smercurio_fc wrote:

Reinitialize to Default is called using an Invoke Node


Symantics!  The knowledge base calls it a property node, which is wrong, I call it a method because you select Create - Method...   but the real name is Invoke Node as Smerc correctly pointed out.


Semantics is what it's all about ... Smiley Wink  The KB article is actually using the incorrect terminology. I submitted feedback on the article, which needed it anyway since it has a picture in it with the URL pointing to ae.natinst.com, an internal-only server. 

 

0 Kudos
Message 18 of 19
(997 Views)

@smercurio_fc wrote:

 

I submitted feedback on the article, which needed it anyway since it has a picture in it with the URL pointing to ae.natinst.com, an internal-only server. 

 


I've said it before, and perhaps it's time to say it again.

 

It shouldn't be that hard for NI search through all of the KB articles and webpages to find all the instances where ae.natinst.com is used and correct them!  I bet a LabVIEW VI could be written to do the job. Smiley Wink

0 Kudos
Message 19 of 19
(975 Views)