02-03-2016 04:07 AM
I have 1 state machine controlling a number of pressure transducers and balances.
The pressure transducers and balance is used to analyze a soil sample
I need another state machine of exact same type as the other. The only difference is that the new state machine shall control another set of pressure transducers and balances.
The 2 state machines will have to run parallel, so I will be able to analyze 2 soil samples at the same time.
The state machines do not need to execute in the same speed. It is alright the one state machine is ahead of the other.
Is there a smart way in LabVIEW to get over this, or do I simply need to copy the first state machine and change the id for pressure transducers and balances?
Solved! Go to Solution.
02-03-2016 04:15 AM
02-03-2016 04:31 AM
Reentrancy is the key here. I recommend using the Preallocated Clone reentrancy for speed and memory management reasons. So you just make a a high level VI that just calls this state machine twice, in parallel. Pass in the ID to the state machine and you have both running.
02-03-2016 05:46 AM
I will try you suggestions. Might return for more help. Newer tried this - I'm relatively new in LabVIEW. Thank you for help
02-03-2016 07:33 AM
The state machine have to be in subvi's. Correct ?
02-03-2016 07:35 AM - edited 02-03-2016 07:36 AM
@Michael.Koppelgaard wrote:
The state machine have to be in subvi's. Correct ?
No, the state machine is implemented only ONCE in ONE subVI. You simply CALL that subVI TWICE in parallel by another VI.
EDIT: That's why Gerd and Tim recommend using IDs for identification of which instance you work in (e.g. for selecting instruments)
Norbert
02-03-2016 08:02 AM
Okay. That was also what I meant.
But how to get the front panel from the subvi ?
I need output from both call of subvi. I need to see what is happening. The VI is going to run for several hours.
Is it possible to use:
http://forums.ni.com/t5/LabVIEW/Combine-VI-into-one-VI/m-p/1923479#M643430
to get the front panel from the subvi (the state machine)?
02-03-2016 08:08 AM
Best solution is to use subpanels for this.
Other option is to use property nodes to modify values/appearance of controls/indicators on the top level (calling) VI.
Norbert
02-03-2016 08:20 AM
Oh I feel so stubit
I really don’t know what you mean. I’m new an trying to learn.
So if the weight in 1 instance of subvi shows 1655 g, how to get this value shown in an indicator in front panel of the top level?
Using subpanel as shown below will not distinguish between the different instances of the subvi - will it ?
02-03-2016 08:30 AM - edited 02-03-2016 08:32 AM
Hi Michael,
there are several ways to send data from subVIs to a main VI (or more general: between parallel running loops).
There are queues, notifier, FGVa aka AEs, shared variables, network stuff, control references, and some other. I recommend queues/notifier…
To show the FP of a subVI you only need to edit the (subVIs) FP settings - or you simply show all values in your main VI.
Oh I feel so stubit
When you feel stupid (:D) I recommend to take all those free (!) online resources offered by NI for LabVIEW beginners…