LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting (Connect a Terminal to a Flat Sequence Structure)

Solved!
Go to solution

(scripting)

 

Is there a way to connect a terminal to a Flat Sequence Structure ?  (in my case, with only one frame)

 

(with the Method "Connect Wire")

0 Kudos
Message 1 of 7
(3,762 Views)

It doesn't look like Connect Wire will work, because it only accepts Terminals or Nodes as the "Wire Source", and the FlatSequence class does not inherit from Node. Here are the workarounds I can think of:

 

1. Drop a node inside the Flat Sequence (like a "To Variant" function), wire to that with Connect Wire, then delete the node and the connected wire within the frame.

2. Replace the Flat Sequence with a Stacked Sequence, wire to it, then replace the Stacked Sequence with a Flat Sequence.

 

There are probably other workarounds, but these are the first two I thought of. Let me know if you have any other qeustions.

Message 2 of 7
(3,740 Views)

Thank you Darren for these workarounds.

but the main question is .. why the flat sequence stucture doesn't inherit from node ?
Why did developers make this choice?
What is the background idea of this choice?

 

(sorry, for my bad english, i try to do my best)

0 Kudos
Message 3 of 7
(3,726 Views)
Solution
Accepted by topic author ouadji

@ouadji wrote:

 

but the main question is .. why the flat sequence stucture doesn't inherit from node ?
Why did developers make this choice?
What is the background idea of this choice?


The Flat Sequence Structure, introduced in LabVIEW 7.0, provides a diagram object semantic that no other object has. It is a multi-frame structure (like a case structure or a stacked sequence structure), but it is the only structure where data can be wired between frames through normal tunnels. It is the only structure that can have tunnels in locations other than its outer borders. It is the only structure that can have subdiagrams of different sizes at different positions. It also introduces strange wiring scenarios which you will not find elsewhere:

 

weirdfss.png

 

At the time the Flat Sequence Structure was introduced, there were enough of these weird scenarios with scripting (which was an NI-internal feature at the time), that it was easier on the developer to make it its own scripting class than to try to figure out how to support it under an existing class. We had no idea that scripting would become a public feature someday, so the burden was relatively light, and limited to within NI's walls. Looking back, there have been enough problems with the FlatSequence class in scripting that most of us agree it would have been better to have included it under the Node class (or more specifically, the MultiFrameStructure class) from the start.

 

 

Message 4 of 7
(3,716 Views)

OK, I understood everything.  Smiley Happy

 

Thank you very much for this explanation.

I understand much better the history and background of this structure.

 

"... most of us agree it would have been better to have included it under the Node class from the start."

 

I agree with this view.

Maybe it's not too late to change this?
And solve this problem once and for all!

why not ?

 

0 Kudos
Message 5 of 7
(3,709 Views)

@ouadji wrote:

 

Maybe it's not too late to change this?
And solve this problem once and for all!

why not ?


It would be a substantial investment for us to rework the VI Server class hierarchy to make the Flat Sequence structure inherit from another class. It would be an even bigger investment to implement the conversion necessary for existing applications to function properly. I'm not saying it's impossible, it's just something we haven't chosen to invest in yet.

0 Kudos
Message 6 of 7
(3,684 Views)