From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

passing error wire - connected to an undirected tunnel

The Delay function works just like the wait except you specify seconds and it has error in/out terminals. For that matter, you can create create your own subVI with the wait in less than a minute. Silly to justify a sequence structure in this case.
0 Kudos
Message 11 of 14
(1,067 Views)

 


@Dennis_Knutson wrote:
The Delay function works just like the wait except you specify seconds and it has error in/out terminals. For that matter, you can create create your own subVI with the wait in less than a minute. Silly to justify a sequence structure in this case.


Thank you, I didn't know that. I usually use the OpenG Wait in my projects, it has error terminals and some more features 🙂

 

0 Kudos
Message 12 of 14
(1,063 Views)

You really need to abandon the stacked sequence structure. If you right click on the stacked frame and select replace with flat sequence you will see where the logic goes wrong.

 Creating a state machine is not that hard.

1. Go to your front panel left click and select controls>>enum.

2. Name this "case selector" or whatever you like.

3. Click on this enum "case selector" control so it is highlighted then on the top tool bar select Edit>>Customize Control

4. Another window is opened up and where the drop down labeled 'Control' (next to the little spanner wrench) change it to 'Type Def'.

5. Left click "Case selector" control and select properties.

6. Use the tabs on this pop-up and go to 'Edit Items'. Select 'Insert' and add a short descriptive name of your first case. Repeat for all cases you might need. (Since this is a type-def we can add cases as needed later). Press 'OK'

7. On the top toolbar select file>>Save and give it a name (usually I just repeat "Case selector" I used earlier).Close the window with the x and it will ask you if you want to replace with your newly created type def control. Say yes.

8. Now your type def "Case selector" control is on your front panel. Go to your block diagram and find that control. (If you double click it from the front panel it will take you to the block diagram with the control highlighted)

9. If you need a for loop create one and wire "Case selector" to the left border. Left click the tunnel where the control intersects the left border and select 'Replace with Shift Register'. (You'll see it's other half appear on the right border of your for loop.)

10.Left click on a blank space and select 'Case Structure', drag and click it inside of your for loop.

11.Wire from the shift register on the left border of your for loop to the case selector (looks like question mark ?) of your case structure.

12 Now left click on the border of your case structure and select 'Add case for every value'.

13 Create a type def constant of your "Case Selector" control. Hold down the CTRL key and select drag and drop the "Case Selector" control which will make a copy of it. Left click this copy and select 'change to constant'.

14 CTRL drag and drop on this constant so that you have enough copies to place in every case of your case structure.

15 Place your constant inside your case structure and wire it through to the shift register on the right border of your for loop. Repeat for every case.

16 These type def constants will determine which is the next case to run. Select accordingly

 

Now if you determine later that you need to add another case to your state machine all you have to do is edit the type def enum "Case Selector" control and add a case to your case structure accordingly.

Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 13 of 14
(1,055 Views)

@abikutn wrote:

How can I pass error cluster wire between stacked sequences ??

 For example in the state machine -  the error cluster wires should pass data from previous stacked sequence CASE 0 to CASE 1.

 

How can I do that ? 


Going back to your original question, you can pass wires (hence their values) through "Add Sequence Local" on stacked structures (right click on a stacked structure border and you'll see it, also attached is a vi to show how to do that.) But as I mentioned a few times in my previous notes, please consider using your existing state-machine design to create more cases instead of stacked structure because it does make things easier down the road. I don't like stacked structures but that's just my personal opinion based on experience, if this gets your work done then I guess that's your final goal anyway.

 

-DP

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


0 Kudos
Message 14 of 14
(1,021 Views)