LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DSC user events

Hi all.

 

I am using LV 2010 and have just downloaded the latest DSC module.

 

What I want to do is send user-defined events between two processes. I've managed to get this to work using boolean shared variables as flags, and using the DSC "Request Value Change Notifications.vi" to create an event that detects changes to any of the shared variables.  The only slight problem is that it seems you cannot have an event for each shared variable. Instead you have one event which detects changes to any shared variable registered. So, the application handling the events has to unpack the shared variable event from a variant structure and then use a case (such as switching on the variable name) to take action appropriate to that particular variable.

 

What I would like to know is:

  1. Can I have separate notification events for different shared variables? I tried this, but I couldn't get it to work.
  2. Can I have the equivalent of user events that work across the network? (So the event gets generated in one program and received in another.) Is this what "Set User Defined Event.vi" is supposed to do? I can't figure out exactly what this VI is for is for or how to use it. I have read the manual and I'm none the wiser. Are there any examples for this?

Thanks,

Zola

0 Kudos
Message 1 of 3
(2,863 Views)

I have not tried this out but it may work.

I use these DSC user events to signal from a cRIO to a PC HMI so I suppose anything with an IP address should work.

 

User Events.PNG

Message 2 of 3
(2,849 Views)

Thank you for your response! I tried this and it compiles fine. But it brings up a different problem. I seem to be getting bogus shared variable change value events created. (I was also getting these before when I registered for changes to all of the shared variables in one event.)

 

This is obviously a known problem,  See the LV example Toolkits and Modules\Datalogging and Supervisory Control\Fundamentals\DSC Event Structure Demo.lvproj. In DSC Events Demo.vi, the code checks to see if the variant value of the shared variable is NULL (see below).

null_value_check.jpg

 

 

 

Now that I'm catching each shared variable event individually , and casting to the appropriate type, I can't check for NULL values. I could use individual shared variable events with variant data, but this is not an optimal solution for me.

 

Is there any way to stop or filter out the bogus events?

 

Thanks again!

0 Kudos
Message 3 of 3
(2,799 Views)