07-27-2011 02:25 AM
I created some user events, I wonder if its possible to have outputs inside the Event structure for dynamic events.
Like the application event below.
If yes, how can i accomplish this?
Many thanks!
07-27-2011 02:50 AM
07-27-2011 03:00 AM - edited 07-27-2011 03:02 AM
Thanks Mike, but i din't think thats what i wanted. Basically, the link just illustrate how events are used (which i think i already knew). However to go deeper, which i wanted to have an "output" (or filter, or whatever u named it) in the Event Structure for my Dynamic User Event. I guess thats impossible as i have trying it whole day and searching the web & forum for an answer.
ANYWAY, MANY THANKS!! 😄
07-27-2011 03:05 AM - edited 07-27-2011 03:07 AM
Hi,
sorry, i didn't realized that you mean output.
Why is it necessary to filter a user event. If you don't want it, then simply don't send it. Can you explain what you like to do?
Mike
07-27-2011 03:12 AM
I have an event (say Event A) which is trigger perodically. In the event structure (for the case ,Event A), some data is being passed back to the VI which triggers that event.
If you know C program, its similar concept as a callback function.
int GetData(int *_val) { if (_val) _val = 9898; } //// main code void main(void) { int success = 0; int myData = 0; while (1) { success = GetData(&myData); } }
07-27-2011 03:55 AM
Hi,
why do you want to use the Event Structure? You can realize it with a queue or a notifier or you can use a sub vi which you call by reference.
Can you show what you try to to in LabVIEW. With a specific example it would be much easier to find a solution for you.
Mike
07-27-2011 04:00 AM
I know there are many ways to go about it. I just wanted my program to be event-driven rather than polling.
Never mind, since its not impossible. I'll go with queue then.
Many Thanks!!
07-27-2011 04:05 AM
Hi,
why do you think it's not event driven if you use a queue?
Mike
07-27-2011 04:33 AM
Event-driven, as it speaks, are triggered by events.
From my opinon, for queue, you need to keep polling it to get data.
Maybe you can help me by showing an "event driven" queue.
07-27-2011 04:38 AM
Hi,
if you use the "Dequeue Element" with a timeout value "-1", then you wait til a new elment is available in the queue.
Mike