08-30-2010 07:36 PM
Hi Guys,
I am trying to trigger an event using "Value Signalling" and i hit a little bit of snag.
I am reading logic inputs continuously and i wanted to trigger an event if there is a change on logic signals.
What i did is i read the logic signals initially so to get the default state and re-read again the logic signals inside the timed loop in the event case waiting for the signals to change.
However, the event keep triggering even there is no change in signal.
Any advice?
Regards
Ray
Solved! Go to Solution.
08-30-2010 07:45 PM
08-30-2010 08:23 PM
I was hoping that there could be other solution besides that if i have quite a number of events waiting to be triggered.
Thanks. I dont want to waste time finding any other means.
08-31-2010 10:57 AM
Of course you did not show any actual code (just an image) so we can only guess the overall program architecture and what's in the other cases and events.
Still, you might be over-thinking all this. Since the loop is already spinning it seems overkill to trigger things using signaling events. All you probably need is a small case structure that executes additional code whenever things change. Events are primarily used to handle user interaction from the front panel. You just need to branch depending on the "changed/not_changed" case, which is trivial.
08-31-2010 11:11 AM
Hi,
Thanks for the comments. The main reason i use an event trigger for this application is that the system would be receiving digital inputs (min 15) from another application at random. The application would be a handshaking event from my application and the target application where i received the digital ins and in response i send out a digital out.
I might have phrase my reply poorly, but your initial suggestion was my accepted solution and is working right now.
What i did is put all digital in an array and compare the arrays between loops using a shift register and trigger the value signalling inside a case structure everytime there is a change on array values.
Regards