Tomi Maila Posted April 14, 2007 Report Share Posted April 14, 2007 User events are specified by both by datatype and buffer name. The name changes do not propagate correctly in the attached VI. The user event name is specified by a string constant name. When the string constant name is modified, the name change doesn't propagate to the event structure. The event structure still thinks that the old name is used instead. To change the propagated type one needs to change the data type to something else and then back to string again. When data type is change then also type is propagated. But when the constant name is changed only, then type propagation doesn't reach the event structure. http://forums.lavag.org/index.php?act=attach&type=post&id=5492 http://forums.lavag.org/index.php?act=attach&type=post&id=5490 Quote Link to comment
Mellroth Posted April 14, 2007 Report Share Posted April 14, 2007 QUOTE(Tomi Maila @ Apr 13 2007, 12:38 PM) ...When the string constant name is modified, the name change doesn't propagate to the event structure. The event structure still thinks that the old name is used instead. Hi Tomi, I think that this has to do with the unitialized shiftregister retaining the name of the first instance that "named" its wire. The event refnum in your initialize case is then "type-casted" to the older version, since the Event structure outputs a previously named version. Workarounds that I can think of right now 1. If you wire the event refnum from outside the loop everything should be OK, but this might not work depending on what you are trying to do. 2. Bypass the Eventstructure, i.e. don't use the event structure output (OK, as long as you don't change the dynamic events). http://forums.lavag.org/index.php?act=attach&type=post&id=5493''>http://forums.lavag.org/index.php?act=attach&type=post&id=5493'>http://forums.lavag.org/index.php?act=attach&type=post&id=5493 /J Quote Link to comment
Jim Kring Posted April 14, 2007 Report Share Posted April 14, 2007 QUOTE(JFM @ Apr 13 2007, 04:06 AM) 2. Bypass the Eventstructure, i.e. don't use the event structure output (OK, as long as you don't change the dynamic events). http://forums.lavag.org/index.php?act=attach&type=post&id=5493''>http://forums.lavag.org/index.php?act=attach&type=post&id=5493'>http://forums.lavag.org/index.php?act=attach&type=post&id=5493 I've faced this problem, too, and JFM's solution #2 is the one that I use in my applications. Quote Link to comment
Aristos Queue Posted April 14, 2007 Report Share Posted April 14, 2007 QUOTE(Jim Kring @ Apr 13 2007, 09:36 AM) I've faced this problem, too, and JFM's solution #2 is the one that I use in my applications. Does using the Type Cast node help? If you pass in the exact same data type to both inputs of Type Cast, but the top input has the wire name that you want, you might get the desired behavior. It seems odd to suggest type casting to exactly the same data type, but given that the wire name is part of the data type, this strikes me as something I would try. Quote Link to comment
Mellroth Posted April 14, 2007 Report Share Posted April 14, 2007 QUOTE(Aristos Queue @ Apr 13 2007, 04:41 PM) Does using the Type Cast node help? Yes it does. Sometimes I put a type cast node after the case structure, forcing the "correct" name. The "start" case in Tomi's first post, could then output a duplicate reference in an extra tunnel (set to "Use default if unwired"), and use this output to cast the reference passed around in the shift register. /J Quote Link to comment
Jim Kring Posted April 14, 2007 Report Share Posted April 14, 2007 QUOTE(JFM @ Apr 13 2007, 08:02 AM) Yes it does.Sometimes I put a type cast node after the case structure, forcing the "correct" name. The "start" case in Tomi's first post, could then output a duplicate reference in an extra tunnel (set to "Use default if unwired"), and use this output to cast the reference passed around in the shift register. /J I don't understand typecasting would be used as a solution. Both wires would have the same data (the Event Registration Reference) -- just use the wire that has the correct type information (not the one that flows out of the right-side dynamic events terminal). Quote Link to comment
Mellroth Posted April 14, 2007 Report Share Posted April 14, 2007 QUOTE(Jim Kring @ Apr 13 2007, 05:53 PM) I don't understand how typecasting would be used as a solution. Both wires would have the same data (the Event Registration Reference) -- just use the wire that has the correct type information (not the one that flows out of the right-side dynamic events terminal). I didn't mean to say that typecasting was the solution. I replied to Stephen's question if a typecast node would work, and it does. Anyway, in this case I would use solution #2 from my first reply. /J Quote Link to comment
Anders Björk Posted April 15, 2007 Report Share Posted April 15, 2007 I had a similar problem when working on a customers software.. I found no other solution then to uppdate the event name twice..checking the counter in the while loop.. Quote Link to comment
Jim Kring Posted April 15, 2007 Report Share Posted April 15, 2007 QUOTE(AndersBjork @ Apr 13 2007, 04:20 PM) I had a similar problem when working on a customers software.. I found no other solution then to uppdate the event name twice..checking the counter in the while loop.. Anders: I'm not sure that I understand the problem you're describing, and how your solution helped. Can you explain more? Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.