LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Where to place Sequence Locals in a Sequence Frame? up, down, left right?

Solved!
Go to solution

Hi,

I have a sequence with several frames and I need to overgive some values from frame to frame via Sequence Locals.

 Where should I place the Sequence Local? On the top or on the bottom of the frame? Maybe on the right?

 

If I place them on the right side of the frame the wiring looks good in the one frame but it is ugly in the other frame.

 

How do you do it?

 

Greetings 

Johannes

Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 1 of 26
(3,665 Views)

Hi Johannes,

 

A good practise instead of using a sequence would be to create a statmachine.

You might have future changes in you code which could be done easier then when using a statemachine.

 

There you can pass data between the states with a cluster, which elements you save once in a typedef.

There should be some examples for statemachin or a short paper online, just do a search under ni.com

 

 

Thanks,

Christian

Message 2 of 26
(3,660 Views)

Thanks for the answer Christian!

 I don't think that a state machine is necessary in my case. I use the sequence only, because the VI becomes too large otherwise. The VI prepares data for displaying in a chart and there is a lot of preparation (sorting data, filtering, calculating tolerances, managing chart properties, etc.). The order is always the same, so no really need for a statemachine. I could put all that data preparation in a sub VI, but that will make it just more complicate if it is possible at all (I can't put property nodes of my chart in a sub VI).   If you want, I can attach a part of my VI or screenshots.
Greetings Johannes
Using LabVIEW 7.1 and 2009 recently
0 Kudos
Message 3 of 26
(3,639 Views)

Johannes,

 

the decision to use a sequence structure above a proper statemachine is the worst thing you can do. Honestly, i would have the stacked sequence structure to be removed from LV at all, the flat sequence structures for all targets except FPGA. OK, a single sequence frame comes handy at time, but usage of sequence structures has several sever backdrafts:

a) Exit?????

b) Readability

c) Scalability

d) Maintainability

 

So the sequence structure lacks in all parts necessary to create professional software. So: Please do not use it.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 4 of 26
(3,618 Views)
Solution
Accepted by topic author johanneshoer

Hi Johannes,

 

Even when its not necessary, it's better programming practice.

 

You might need to implement some changes in the future, or to use the code in another, similar project, then its way easier to implement when you used a state-machine before. And it's not much work changing from a sequence to a statemachine, except you have hundreds of frames/states.

 

Back to your first question, it depends on your taste where you place the tunnels in the sequence.

 

 

Christian

Message 5 of 26
(3,617 Views)

johanneshoer wrote:

Hi,

I have a sequence with several frames and I need to overgive some values from frame to frame via Sequence Locals.

 Where should I place the Sequence Local? On the top or on the bottom of the frame? Maybe on the right?

 

If I place them on the right side of the frame the wiring looks good in the one frame but it is ugly in the other frame.

 

How do you do it?

 

Greetings 

Johannes


Wize-crack answer:

 

In the bit-bucket along with the stacked seq structure.

 

Serious Answer:

To the best of my knowlege, there is no standard established since Stacked Sequences are shunned.

 

The suggestions above about using a state machine with Shift Registers is good and I hope that you will reconcider.

 

Thank you,

 

Ben 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 26
(3,543 Views)
Or use a case statement in a for loop. Tie the loop counter to the case input. Populate each case with the code you want. Then you can use shift registers to pass the data to the next state.
0 Kudos
Message 7 of 26
(3,523 Views)

ErnieH wrote:
Or use a case statement in a for loop. Tie the loop counter to the case input. [...]

Which would reduce scalability and maintanability to nearly zero again. So there is only one valid way: introduce a proper architecture for the software which would be a statemachine at least....

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 8 of 26
(3,519 Views)

johanneshoer wrote:
(I can't put property nodes of my chart in a sub VI).   If you want, I can attach a part of my VI or screenshots.

Yes, you can put property nodes of your chart in a subVI. You just need to create a reference to the chart and pass that into the subVI

 

 

Message Edited by for(imstuck) on 05-19-2010 09:33 AM
0 Kudos
Message 9 of 26
(3,508 Views)

for(imstuck) wrote:

johanneshoer wrote:
(I can't put property nodes of my chart in a sub VI).   If you want, I can attach a part of my VI or screenshots.

Yes, you can put property nodes of your chart in a subVI. You just need to create a reference to the chart and pass that into the subVI


 

In fact, there's an example that ships with LabVIEW that shows exactly this. Search for "properties" and open the "Property Nodes" example.

0 Kudos
Message 10 of 26
(3,498 Views)