Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Time-Delayed Send Message Once

Daklu wrote:

That trick wouldn't work with my style because the event loop always dispatches messages to other loops that do the actual work, so the event queue doesn't get backed up.

If you're running a SQL query in a UI loop, what happens if your database is slow or unresponsive?

It's SQLite and very fast.  Probably wouldn't do it this way if the potential delay were too high.  But if the update was a second, say, then the User would see one update a second, always reflecting where the control was a second ago (in practise I've seen no noticable delay yet).

BTW, an alternate trick, more coding but more flexible and would work for your style, is to have the final loop use flags to indicate what needs updating, and do any actual updating in the timeout case.  Use a shift register coming from a "use default if unwired" case-structure output; the timeout case would supply a "-1" timeout, while the other cases would use the default zero timeout.  That way a burst of events can be quickly analysed to see what needs updating, but the updating itself is only done at the end (thus ignoring multiple events that all require the same update).

0 Kudos
Message 11 of 14
(1,124 Views)

onnodb wrote:

Ah, btw, AQ: one quick question about the implementation of "Time-Delayed Send Message": you're opening a reference to the re-entrant Core VI using an options flag of "0xC0". The flag is labeled as "Fire & forget" in the code, but the LabVIEW help doesn't mention this flag. Is there something special about it? Why not use "0x80" (if I recall correctly)?

Just curious; thanks!

It's 0x80 AND 0x40.   It looked wrong to me, from my reading of the doc's, but I'm not experienced with the new Async node.

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

AristosQueue wrote:

drjdpowell: One caution on your trick: the Value Changed will fire even if the same value was written to the indicator. That means that your comparison trick won't filter out the events if you get a long stream of the same value being written to the FPTerminal.

Not usually a problem with UI controls, which only fire Value Changed when the value actually changed.  One could put in additional logic with a feedback node if needed.

0 Kudos
Message 13 of 14
(1,124 Views)

drjdpowell wrote:

It's 0x80 AND 0x40.   It looked wrong to me, from my reading of the doc's, but I'm not experienced with the new Async node.

Ouch, that's embarrassing, I completely missed that. My apologies, and thanks!

Science & Wires — a blog on LabVIEW and scientific programming
http://scienceandwires.com
0 Kudos
Message 14 of 14
(1,124 Views)