LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Copy and Select case structure programmatically?

It sounds like you need a sequence of "tests" which is slightly different from a set of states. One test might require multiple states. For example a test might require one state to configure the device being tested, another state to measure the output, a state to analyze the results and determine pass/fail, a state to save the results, a state to restore the device to a safe or off condition, and a state to handle errors. Some of these states, like the save state, might be used on all devices, while the configuration states might be unique or shared by only a few devices.

 

The test would not so much define the sequence of states but would specify data that certain states would use to determine the next state. Consider Device I to be a logic inverter and Device F to be a D-type flip flop. The states are Excite, Measure, and Analyze. For device I only one input needs to be excited or driven. Only one output needs to be measured. The analysis classifies that one output as correct or incorrect. If correct, then repeat the three states with the input driven to the opposite logic level.  For the flip flop the Excite state must drive the Set, Reset, Data, and Clock lines. Measure must get the levels of Q and not-Q. Analyze will compare them to the logic diagram (or truth table) for a D-type flip flop. With 4 input lines there are 16 possible static combinations but because a flip flop is a memory device, its output also depends on its previous condition, so more than 16 passes through the three states may be required. It is also likely that Analysis will only be required after several Excite, Measure combinations.

 

My point is that the states, Excite, Measure, and Analyze, are the same regardless of the device. The type of device determines the parameters which will be loaded from a file or database, but the states determine the order of execution and the number of times each state is called.

 

This is only slightly more complicated to set up, but it results in an extremely versatile test system.

 

Lynn

0 Kudos
Message 11 of 15
(519 Views)

You understood this correctly.

 

However, the state machine already exist for years. I am looking for a way to simplify things.

0 Kudos
Message 12 of 15
(492 Views)

Hi LesElec,

 

I'm not sure what you mean by finding a way to simplify things. The application you are describing is complex and so you would need some sort of architecture that ensures reliability and functionality. The state machine has been around for years so we know that it functions well. I'm not sure of the question you are asking, are you trying to ask for a new way of doing something even though we already have something which you can base your system on? The flow of logic may be more complicated than a normal state machine, but it should be able to do what you want it to do. Maybe this example might help as it can diferrentiate states based on the inputs.

Paolo F.
National Instruments
Applications Engineer
0 Kudos
Message 13 of 15
(461 Views)

I meant the state machine in the program that I have exist for years.

 

I thought there may be something simpler that I overlooked or is more handy. I wanted to ask before I start working on a complicated structure.

 

Thanks.

 

 

 

 

0 Kudos
Message 14 of 15
(439 Views)
Buy TestStand.
0 Kudos
Message 15 of 15
(432 Views)