LabVIEW Channel Wires

cancel
Showing results for 
Search instead for 
Did you mean: 

VI which works on a channel input will freeze if writer goes idle

Here's the pattern I propose:

From: AristosQueue <web.community@ni.com>

To: jkodosky <jeff.kodosky@ni.com>,

Date: 08/14/2015 09:47 AM

Subject: - Re: VI which works on a channel

input will freeze if writer goes idle

Community

Re: VI which works on a channel input will freeze if writer goes idle

created by AristosQueue in LabVIEW Channel Wires - View the full

discussion

JeffK is putting together a picture of the other way of doing a

consumer-side stop. That'll be posted soon.

Reply to this message by replying to this email -or- go to the message on

Community

Start a new discussion in LabVIEW Channel Wires by email or at Community

0 Kudos
Message 11 of 16
(839 Views)

A variation of the Pipe Write and Read endpoints have abort in and out terminals.  Sending abort in will cause it to appear on the output of every endpoint.

Screen Shot 2015-08-14 at 2.09.33 PM.png

0 Kudos
Message 12 of 16
(839 Views)

Jeff and I have gone back and forth over the two patterns of expressing "consumer says stop now." Mine has decidedly more moving parts than his, no question. What I like is that mine avoids the extra iteration which

a) I find a bit hard to think about and

b) Messes up indexing output tunnels and last value tunnels, forcing me to use more shift registers.

Allowing a fork of the channel wire to a second "abort" node would be viable except that it doesn't work for the wires that we want to explicitly be typed as point-to-point operations (disallow forks).

Anyone have a better (or at least different) stopping pattern for the channel wires?

0 Kudos
Message 13 of 16
(839 Views)

AristosQueue wrote:

Mads: Try this channel that does not ship with LV 2015:

https://decibel.ni.com/content/docs/DOC-42942

See what you think.

Not bad. I like the timeout and abort functionality (obviously).

One thing that queues lack is an in-built mechanism to signal the consumer that the producer has stopped, *without* having to force destroy the queue (and similarily, tell the producer that there are no consumers anymore (access to the internal number of obtained and open references could be a solution there; a number of subscribers...). That means that if you want the queue to be emptied by the consumer before it is terminated you have to make the producer monitor the queue state after its final insert, and only force destroy the queue once it sees that the queue has been emptied.That is not a big obstacle (so it could be a viable solutionf or channels too), but it does mean that there is no in-built (in other words - standardized and "free") solution to the issue.

So you could add functionality to give the consumer(s) in-sight into the state of the producer *without* cutting access to the elements remaining in the queue. In other words; instead of a force destroy that cuts access to those elements, you have a separate output (or a warning on the error state) that tells the consumer(s) that the producer side has finished.

I cannot see a picture in the proposition post from Jeff (was it lost, or is it somewhere else?), but from the following comments about extra iterations etc. I guess the issue you are discussing is how do you combine/disciminate between the event of an abort signal with a new value event(?).


Let's say that the producer has set the queue up for destruction, but there is no new value. The consumer side will then execute, but they might have more values to process still... How do you differentiate between an "abort only" trigger, and a value *and* abort? -
If a consumer is still processing data from a producer that has destroyed the queue they could get a warning flag while reading the elements they have queued up (the warning/node could indicate the number of elements left as well perhaps), and then when they reach the end the warning turns into an error / termination complete on each iteration. If it is a goal that the consumer does not need to iterate a last time to figure out that the queue/channel is now fully terminated, it would need to use/get the number of elements and warning output.

I'm rambling a bit here so I'll let you clarify before I continue

0 Kudos
Message 14 of 16
(839 Views)

Mads: Jeff's post now has a picture that should be visibile. I want to make sure you can see that before I comment further. It's the post right before your long one.

0 Kudos
Message 15 of 16
(839 Views)

Ok. Jeff's solution is simple, that's good. But overall I like your Favourite Channel better. I'll see if I have any suggestions.

By the way, I just saw this text from you here:

"

The key mantra to keep in mind when writing parallel While Loops: do not communicate data between the loops in one communications channel and comminicate the stop signal in a separate communications channel. In my experience and that of other architects that I have talked to, separating these comms channels is a recipie for weird race conditions or hangs.

GIven that, the use cases for Channels without an embedded stop signal are, for me, minimal."

That kind of sums up my sentiment as well (I had not seen it when I started this thread).

0 Kudos
Message 16 of 16
(839 Views)