07-31-2013 08:59 AM
I have a VI that communicates with an FPGA over a telnet interface. I have multiple boolean controls on the front panel. When you click on a control, it sends a write command over the telnet i-face to the FPGA. Likewise, if a process within the FPGA itself writes the same register (that the control wrote when I clicked on it), a command is generated within the FPGA and sent back to the VI, and the control (via a local variable) lights or unlights accordingly (based on the value read). In other words, these controls are read-write...
This is all working, except for one important thing. I have code that executes via an event structure whenever the value of the control changes. I can see that this code does indeed execute when I click on the control via the front panel. HOWEVER - when something generated within the FPGA ultimately changes the value of the control, the event structure does not execute, even though I see the value of the control change on my front panel.
As a specific example, I have a control called CLIENT_LB. When I click on CLIENT_LB, I see it light up, and I see the associated event structure code execute. Now, if I cause the FPGA process to set CLIENT_LB back to 0, I see it unlight on my front panel, but the event structure code does not execute. I have probes in place that have verified the local variable associated with CLIENT_LB is indeed changing values. The event structure reads: "CLIENT_LB": Value Change.
Shouldn't a "value change" event structure execute when the value changes, regardless of whether it happened manually (i.e. me clicking on the control) or automatically (i.e. the FPGA writes to the VI and changes the value of the control)??
The VI is large, and you wouldn't be able to test it anyway without connection to hardware, so instead I attached 2 screenshots, which I've described below.
1. This is where the parsing of the string back from the FPGA occurs. The string enters the sub-VI, and then the data portion of the string is masked to determine whether the boolean value of the control is true or false. I put a probe on CLIENT_LB, and I can see that as the FPGA changes the value of the register, CLIENT_LB changes from false to true accordingly. I verified this multiple times.
2. This is the event structure. This code executes when I click on CLIENT_LB on my front panel, but does not execute when the CLIENT_LB local variable from pic #1 changes.
Solved! Go to Solution.
07-31-2013 09:18 AM
Writing to variables never triggers "value change" events. If writing shall trigger that event, use the "Value (Signaling)" property.
Norbert
07-31-2013 09:19 AM
Event structures register front panel events, and in this context the programmatical changing of a value is not considered a front panel activity. However: if you want to fire a value change event programmatically, you can do that by writing the value to the "Value (signaling)" property of a property node of the relevant control.
07-31-2013 09:19 AM
A dynamic event would be a good shout here as well. See the examples, documentation etc etc.
07-31-2013 09:27 AM
Thanks guys! This fixed it right away!
I appreciate the help...