LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering an event struture with a timer

Hello,

I'm having some problems with the Event Structure (LabView v8.2). I'm writing a program which makes calls to a vb.NET class library based on user input on the front panel. I've used an event structure to generate the appropriate "invoke node" commands based on the front panel input.

The Problem is that, in addition to all the front pannel input, I also want a repeated timed call to the library (i.e. every 5 seconds), but I have no idea how to get the event structure to trigger off of a timer. I would use a timed loop, but this leads to opening a double instance of the dll (which in turn leads to a double instance of opening the serial port on my computer since that is what the dll is doing) which doesn't work.

Any suggestions appreciated, thank you.

EDF.
0 Kudos
Message 1 of 6
(7,176 Views)
You could try using the timeout function of the event structure itself if the timing is not critical. All you have to do is wire the timeout and set it to 5000 (5 Sec)



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 2 of 6
(7,173 Views)

You can have a hidden control that exists solely to trigger an event, and wire a 5 second wait into a while loop with a Value (SGN) property node.  The Value (SGN) node changes the value of a control as though it was a user created event, which will trigger any value change event cases based on that control.

 

Message 3 of 6
(7,168 Views)
Thanks for the quick reply.

I'd rather leave that solution as a last resort. The reason being that I actually want 2 or 3 timed events, all with independent frequencies. Ideally I was hoping there was a way to get a timer, set its period and tiger the event structure whenever the period elapses, but I'm beginning to suspect no such feature exists sadly...

Cheers,
EDF.
0 Kudos
Message 4 of 6
(7,167 Views)
Looks like I spoke too soon! Thanks Jeff, I'll give that a go, looks promising!

Cheers,
EDF.
0 Kudos
Message 5 of 6
(7,163 Views)

There are many different ways to do this. You can use Queues and notifiers and dynamic events but the easiest is to set up a signaling event. I have attached a VI that uses value signaling and timed loops. Have a look at it and if you have any questions let me know. This way workd great if everything is contained on the same block diagram.

Message Edited by Jhoskins on 01-29-2008 12:50 PM

Attached for 8.2



Message Edited by Jhoskins on 01-29-2008 12:51 PM



Joe.
"NOTHING IS EVER EASY"
Download All
0 Kudos
Message 6 of 6
(7,154 Views)