LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
altenbach

The "Zero Frame Flat Sequence", aka. "Synchronizer Bar"

Status: Declined

In the G Language, this is what the Flatten Sequence structure is for.  Not going to add a second way to do this.

Sometimes we have a need to do some mild synchronization between otherwise parallel tasks. Typically we would use a flat sequence (but there are also exceedingly fancy tools such as "Rendezvous"). Even a flat sequence is often overkill for the given situation: It is a 2D object with it's own diagram and input and output tunnels. We need to decide what should be inside and what should be outside.

 

I suggest to extend the idea to a 1D object: The "Synchronizer Bar". It is basically a flat sequence with zero frames, condensed to a single vertical line (Maybe we could even allow kinks in it???).

 

The function is very simple and immediately intuitive (as anything in LabVIEW should be!!) and can be described in a single sentence:

 

"No data can leave any of the tunnels until all tunnels in the structure have received data."

 

Ideally, we should be able to "free-hand draw" this structure interactively with the mouse and a tunnel will be automatically generated for each wire we cross.

 

Here is a dumb (but illustrative) example (ignore the code itself). That's how it could look like.

(At the moment I simply merged the edges of a flat sequence, but I am open for prettier suggestions ;))

 

ZFF.png

 

 

Overall, it should be closely related to the flat sequence and include certain right-click actions (e.g. Add frame before/after, which would expand it into a flat sequence).

25 Comments
Manzolli
Active Participant

When I read the description I though: this is a zero frame Flat Sequence Structure (FSS). I think NI can just add this capability to the current FSS. No new structure needed. Also we can add a frame to go to a normal FSS and remove the last one to get this new feature.

I think that LV is a lot left to right! For instance, try to use a FSS entering from right going towards to the left.

May be interesting have also an option to configure it to be an horizontal bar.

Kudos!

 

André Manzolli

Mechanical Engineer
Certified LabVIEW Developer - CLD
LabVIEW Champion
Curitiba - PR - Brazil
JCC_(SK)
Active Participant

What about this solution?

 

Synchronizer node.png

 

 

It is a little bit ugly and data conversion to variant is there every time, but ... 😉

Source code: LabVIEW 8.0 

altenbach
Knight of NI

> What about this solution?

 

This is not an equivalent solution, because the only output is the error wire. In my suggestion all inputs will give an unchanged, but synchronized, output once all inputs have received data.

 

> It is a little bit ugly ...

 

That's an understatement. 😄

QFang
Active Participant

Essentially, what you are really asking is for NI to remove the "arbitrary" minimum width limitation on the flat sequence structure.. I mean, the way I read it, if you could drop a flat sequence structure down and resize it to have a width of 2x the frame width, you have now accomplished the same thing. Of course, if you had something without an input or output that you needed to flow control, you would then simply re-size it like you would any other structure that suddenly is to small, and drop those inside, everything else you just wire through... oh.. I see, so you want this new bar to save you two mouse clicks. (click once on bar instead of once on bar, once inside and once on oposite edge). I suppose thats fair, but I think a FAST to implement compromise is just to adjust the minimum widht property of the flat sequence structure to something smaller.... ? 

QFang
-------------
CLD LabVIEW 7.1 to 2016
gnilsson
Member

What you suggest is basically a flat sequence with zero width.

If we just could shrink the width further

Namnlös.png

to

Namnlös.png

altenbach
Knight of NI

Yes, it is similar. Except you have two tunnels for each wire and an empty inside diagram. My tunnel serves as both input and output, so under the hood it is quite different.

AristosQueue (NI)
NI Employee (retired)

Quote from original idea:

> Ideally, we should be able to "free-hand draw" this structure interactively

> with the mouse and a tunnel will be automatically generated for each wire we cross.

 

I think you are saying that autorouting of wires should ignore this bar when calculating the route and if the route happens to pass through the bar then add a tunnel. Is that correct? Also, I think this implies that if you do click on the bar directly, that would terminate your wiring, thus giving you the ability to wire a wire that just stops at the bar, like the wire coming out of the Wait MS primitive shown in your picture. Is that what you envision?

 

I'm thinking that you'd have popup menu items on this like "Add First Frame", which would convert this bar into a Flat Sequence Structure with wires passing across the frame equivalent to any already wired tunnels. Also, I'm guessing that an existing Flat Sequence would also allow you to remove its last frame, thus reducing it to a bar, as opposed to today where you cannot remove the last frame except by removing the structure entirely. Are there other editor menu items that you would expect to see?

 

The idea to add comment bars to structure nodes is now marked as In Beta... this is kind of like a structure node but kind of like a regular node. Do you have any particular commenting requirements?

rgvdh@rdf
Member

FSS with 0 frames makes perfect sense, and fits into existing paradigm very cleanly.

altenbach
Knight of NI

> I think you are saying that autorouting of wires should ignore this bar when calculating the route and if the route happens to pass through the bar then add a tunnel.

 

No. There are two scenarios depending on what we draw and what's already there:

 

  • If we draw the synchronizer bar across a wire, a tunnel should be created
  • If we draw a wire across a synchronizer bar, no tunnel should be created unless we tack down on the bar.
  • autorouting should never change the wiring logic. The bar is not of infinite height so there are always ways around it!

 

Yes, wires can terminate on the bar, which would simply delay all output with a forced data dependency.

 

> Are there other editor menu items that you would expect to see?

 

Yes, the other standard flat sequence menus ("add frame before", "add frame after") should be re-used in order not to add new language ("add first frame" is new). Both would do the same thing, creating an empty single frame flat sequence with all wires across. I am not sure how to expand the functionality of "delete this frame" to go to a zero frame sequence from a single frame, because there are two borders that can potentially be re-used. It should simply not be greyed out for a single frame sequence and keep the left vertical border when activated. To remove the structure completely, we still have the "remove sequence" menu.


A structure label could be useful, e.g. "wait for the slowest process before continuing", or however we want to document the structure.

 

 

 

 

Hurrok
Member

I think this is a great idea, but i would modify it a little bit, just like this:

 

wait_for_sync.png

 

This function waits (at least) the given amount of milliseconds and continues after all (polymorphic) entries are provided with a value.

Some examples:

- don't wire the inputs and you get the usual wait function

- don't wire the timer (or set it to zero) and you get the synchronizing discussed here

- wire an error cluster to input/output 1 and set a timer value and you get the wired wait function discussed elsewhere