08-01-2008 05:08 PM
08-01-2008 05:32 PM
08-01-2008 05:37 PM
This is one of those situations where the code would be better than an image.
Some questions: What is "Source"? Is it to select from Thor's TX or some other Tx? And why is it a property node? (instead of the actual control).
Can you explain this a bit further? "Is there a way to iplement this data transition from outside SM to inside SM? The UDP RX sends only false or true type of data several tymes a second and I pretty much need to wait untill UDP RX will receiv a true."
From what I read, within the Measure state, you have the case statement which selects the source. "Thor's Tx" in this example. Where does "UDP RX " come into play? I see it outside the while loop.
Where I'm confuse is that you say: "The UDP RX sends only false or true type of data", and then it continues to say "wait untill UDP RX will receiv a true".
I think it's a typo.. But your case has a comment saying that "Thor's TX" waits until UDP RX responds back.
So does THor's TX send a boolean (T / F) to the UDP RX and then UDP RX sends an acknowledgement back to Thor's TX which waits for it before the sub-vi ends and returns control to the state machine? If that's the case, are you trying to send these transactions between the sub-vi(s)? or does Thor's TX run, and returns a boolean which is what you want to send to UDP RX? --- looks like I'm even more confused -- 😉
Can you provide more description?
The short answer is yes... you can send data from within a state machine to outside it, but depending on what you want to do, the approach may vary..
R
08-01-2008 06:17 PM - edited 08-01-2008 06:24 PM
08-02-2008 08:12 PM - edited 08-02-2008 08:22 PM
I will start with some questions about the UDP_RX code...
Items 1, 2 & 3 seem to be tied together. It appears that you stop the top left loop by causing an error at 1. The error at 1 is caused by stopping the bottom left loop or if it has an error (at item 2), thus resulting in closing the queue reference (item 3) which innevitably causes a queue error and stops the top left loop at 1. This is a strange way of implementing a solution.. We'll get to that later.
Item 4 will never stop the outer right loop. It is not recommended to code in this fashion.
Is item 5 the boolean that you wish to send to the state machine from your original post?
What I would do is the following. Convert your UDP_RX to a dynamic VI (daemon). You call the dynamic vi from your other code (from original post). Your dynamic VI could contain an Action Engine (or more specifically a Functional Global Variable) whose task is to provide a status on a timely basis. You could even create your dynamic VI to contain a timed loop which will update the status at regular intervals.
When you end (stop) your program, you would also kill the dynamic VI. A dynamic VI can have a continuously running loop, since the intent is to spawn and kill the VI from the calling program.
Below are the items I refer to in the top portion of this reply.
R
EDIT REASON: Shrank image (it was much bigger)
08-02-2008 08:24 PM
*** went beyond the 10 minutes with all the edits ***