LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case statements in parallel

Hi

For an application I am developing Labview, I have an outer while loop and a
number of True/False statements within.
The true/false statements are activated based on the state of the push
buttons in the front panel. At any point, as the while loop executes, only
one or else none of the case statements will be true. All the case
statements are independant.

The code within one of the case statements is time-critical. Should I be
concerned that the processing of this time-critical case statement will be
affected by the other case statements running in parallel (though these will
be false and exit immediately).
Is there a way to determine the execution sequence and timing of different
sections?

Thanks,

Ajay
0 Kudos
Message 1 of 3
(2,749 Views)
Ajay Anand wrote:

> Hi
>
> For an application I am developing Labview, I have an outer while loop and a
> number of True/False statements within.
> The true/false statements are activated based on the state of the push
> buttons in the front panel. At any point, as the while loop executes, only
> one or else none of the case statements will be true. All the case
> statements are independant.
>
> The code within one of the case statements is time-critical. Should I be
> concerned that the processing of this time-critical case statement will be
> affected by the other case statements running in parallel (though these will
> be false and exit immediately).
> Is there a way to determine the execution sequence and timing of different
> sections?
>
> Thanks,
>
> Ajay

I
f I understand correctly, this could well be a job for a "State Machine".
This will should ensure that your Case structures don't have to be in parallel .
Just search www.ni.com for "State Machine" for some good info on using this
technique.

Dave.
0 Kudos
Message 2 of 3
(2,749 Views)
Ajay,

The first answer is very good, you may want to learn about the "state machine" arquitecture. One other suggestion I wanted to add is to use a sequence type flow, if you really want to have this case structure in which you have your time critical operation been checked the first. That is, wire a dummy variable, or if you have an error flow wire is better, and be passing this data from case to case, in which the first one to be wired is the critical case structure... and then pass this data to the other cases... in this way you are going to control that the first case is checked first, it doesn't matter if it is true or false it will go on, so the dummy variable wire will control a flow... try this or even better use sequence structures...

Good luck!...

N
estor Sanchez
Applications Engineer
National Instruments
Nestor
0 Kudos
Message 3 of 3
(2,749 Views)