LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Install and trigger a user defined event in cvi 6.0

Hello Sirs,
In LabWindows/CVI , it is known that there are various events for each control , and we can process them in a fixed mode . But there also exists exceptional situation , for example , in an alarm system , I must measure the value on a real-world I/O point ,and determine if its change has exceeded the deadband ,once the value variety is exceeded the limit ,I need to trigger an event defined by myself ,how to do this ?

David
0 Kudos
Message 1 of 3
(3,226 Views)
Hello

Check out the example ..\CVI\Samples\toolbox\msgdemo.prj. This demonstrates to how handle windows messages from your panel, even custom messages. This is one of the ways to send a message across panels. If you're more interested in sending messages across machines, you can also look into datasocket examples.

Thanks

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 3
(3,226 Views)
I don't know what you want to do with this user-defined event. You can't create an event for a control which will automatically know that the alarm limit has been exceeded. You need to call some code to make your measurement and compare it to your limits. In that code, if the limits were exceeded, you can call another function to set the alarm.
If you want to generate an event for an alarm, you can use QueueUserEvent() and set an event number between 1000 and 10,000. GetUserEvent() will see that event number.
Depending on the structure of your program, in your main() function you may need to call GetUserEvent() in a loop rather than calling RunUserInterface() to see the event generated by QueueUserEvent().
0 Kudos
Message 3 of 3
(3,226 Views)