LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[Bug?] DSC - Registering for Server Events

[LV2009, Win 7 Pro]

 

Howdy (Ben S another one for you? :))

 

I am trying to register for alarm events.

This works fine by using the Register for Shared Variable Events method.

Since I have a lot of SVs and a dedicated server, I thought listen to the server would be much easier to implement.

 

The LabVIEW Help implies that using the Request System Event Notifications.vi will do the trick:

 

22374i2310ABE9E2038CAF

 

However, I can't seem to Register for Server Events - it doesn't work.

The code seems quite simple (below) - I just want to listen to all SVs on the localhost (default).

 

22368i0DAB8381D12B56AA

 

All the Events are coming through to the DSC (viewed in MAX), however, using the Server method I don't get any notifications through the Event Structure.

 

22370i0FA7BBC2B58B31BF

 

Am I doing something wrong? - Or is this a bug?

Is there somewhere I need to configure stuff?

Or does it just not send me Alarm and Notification Events of Shared Variables?

What does it send me then?

 

I couldn't even get the Example in NI Example Finder to work (labview\examples\lvdsc\Event Structure Support).

It shows the SV Registered Event but not the Server/System Event.

 

22376iD60F569D32AAE578

 

Attached is a simple project I used to demonstrate this - a SV configured for a HiHi Alarm:

 

22372iD2FF9EC9D7215BB9

 

The work around is to list out all Shared Variables and just read that from disk and load it into the application etc...

However, it is much more desirable to subscribe to the server and get all SV Events - is this possible?

 

Cheers

 

-JG

Certified LabVIEW Architect * LabVIEW Champion
0 Kudos
Message 1 of 11
(3,388 Views)

I am going to guess that there are a certain class of events that only apply to the shared variable engine itself as opposed to alarms or events specific to a particular shared variable.  Things like the engine loses connectivity.

 

I found this page in the help, and these seem like the kinds of error codes that would apply to the system events function.

Message 2 of 11
(3,383 Views)

So if I have 1000+ SV I want to register for I have to know their URLs (or script their URLs)?

Thats a lot of work! 😞

Certified LabVIEW Architect * LabVIEW Champion
0 Kudos
Message 3 of 11
(3,379 Views)

Hey JG,

 

I do not believe that this is a bug.  The Server events VI registers events for the actual Shared Variable engine, but not the Shared variables themselves.  For example if you run that example and stop your SV Engine from Distrbuted System Manager, you can see that the event reports it stopping and starting again.

 

However, there is an easy way to do what you want without having to register all 1000+ of your shared variables.  If you use the VI Get Shared Variable List.vi it will return an array of all the shared variables in a library.  You can then wire this directly to the Request Alarm & Event Notifications.vi to register all the shared variables. 

 

Hope this helps...

 

22939i03AB286C0ADF52FB

Message 4 of 11
(3,260 Views)

Hi David

 

Thanks,  thought this may be the case (so it was a question rather than bug)

Additionally the VE resides on a networked PC - I am under the impression I can only get to the Shared Variable names list that resides on the localhost (as per your example)?

 

Is this correct - do you have any tricks for me to get a SV list from a networked PC?

 

Cheers

 

-JG 

Certified LabVIEW Architect * LabVIEW Champion
0 Kudos
Message 5 of 11
(3,247 Views)

I think if you put in the fully qualified name for the network path and process and library on the other machine, you should be able to get the list.

 

You'll have to try it and find out.

0 Kudos
Message 6 of 11
(3,239 Views)

 


@Ravens Fan wrote:

I think if you put in the fully qualified name for the network path and process and library on the other machine, you should be able to get the list.

 

You'll have to try it and find out.


Cheers for posting

 

From the help - I didn't think this was possible?

 

22956i81FA5749722852E9

 

I gave it a go using the following naming 22960i3BFAEC9443FDB733

 

But I get the following error (I tried to connect to multiple SVE across our network and got the same error).

 

22958i7FC2EFCF886E01C3

 

I can use 22962i3C756A28E15C78BB though and it returns the local SV List, so I think I have the naming correct?

 

 

<edit>

My other thought is to build a hook in to the app and invoke this across the network using VI Server, so that it can run the VI on the localhost then report back the SV List).

</edit>

Certified LabVIEW Architect * LabVIEW Champion
0 Kudos
Message 7 of 11
(3,232 Views)

I saw that VI as well, and that one does look like it only gets the local processes  (after all there is no other input to tell it where to look.)

 

But the detailed help for Get Shared Variable List is what made me think it was possible.  It talks about going to the NI Distributed System Manager.

 

I was actually just in that the other day on my work PC, saw a bunch of processes on my PC (some definitely stale from different tests or trial runs of people's discussion forum projects.) but also saw variables hosted on two cFP controllers I have on my network.  So I'm thinking it is possible to get to other processes on the network.  (I'm not in a position now at home to experiment with that.  And work has been busy, but if I get a few free minutes, I might try to see if I can get them listed using the Get Shared Variable List VI.)

0 Kudos
Message 8 of 11
(3,224 Views)

Sorry! (morning-itis??) - I posted the wrong image above!

All testing, discussion and errors etc.. were based on this VI, only the image is wrong:

 

22968iE518688BD4CFA830

Certified LabVIEW Architect * LabVIEW Champion
0 Kudos
Message 9 of 11
(3,221 Views)

I did see that statement, but I took "host computer" to mean the one that is hosting the shared variables and that might not necessarily the same computer as the one you are running this VI on.

 

(I might be completely mistaken about all this and it can't be done, but the networking capability that NI has been into shared variables has given me faith that it is possible to use the right naming convention to get this kind of information across the network, that they wouldn't have left out a networking feature on a VI such as this.)

0 Kudos
Message 10 of 11
(3,214 Views)