Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/07/2011 in all areas

  1. Here's another quick test I did illustrating the global-ish nature of Event Registration Refnums: Refnum 3 and Refnum 4 match the value of Refnum 2, even though there's no reason -- according to ordinary data flow rules -- for that to occur. Now that I think about it I understand why this is happening. My guess is that it's an unintended consequence of making it easier to use dynamic event registration. When we have an event structure with a dynamic events terminal, we don't have to propogate the event reg refnum wire through all the event cases. We only need to wire it up when dynamically registering/unregistering an event. For that to work the event reg refnum wire *has* to violate normal data flow rules. In essence, the refnum has to behave like a global, at least on any single block diagram. I vaguely recall someone mentioning that event reg refnums are intended to be used only on block diagrams that service the event. That's part of the reason I gave up on them in my frameworks.
    1 point
  2. For some reason the event reg refnum control is being treated as a global. That's why the constant doesn't appear to be constant. I ran this block diagram with Retain Wire Values turned on. After execution finished, I removed and reprobed one of the class constant wires. The refnum value changed to the value output by the Reg Events prim. This is definitely a case of a downstream operation changing an upstream value. (FWIW I had all sorts of problems a while back when I was exploring using user events as an integral part of application architectures. Eventually I gave up and switched to using queues almost exclusively.)
    1 point
  3. I see what you're seeing as well. You can also see this if you probe inside the VI (you might have to make it non-reentrant) - the second and third iteration will get the new refnum value BEFORE the reg node, even though the numeric value was different before going into the loop. I think this has to do specifically with the event reg refnum, which behave somewhat differently from other refnums in general, but it should be noted that this happens ONLY in a class. If the class is converted to a cluster, this doesn't happen.
    1 point
  4. Self-indexing for loops. Beats ANY other language hands down as they don't have an equivalent.and have to put length checks all over the place and usually get it wrong .
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.