Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

vb.net NetworkVariableSubscriber - not receiving events

Hi,

I recently tried to implement some example code (from this directory: National Instruments\MeasurementStudioVS2005\DotNET\Examples\NetworkVariable\Basic\vb\Subscriber) in a VB.net program of my own.  Unfortunately I am not receiving and OnDataUpdated events or any other events for that matter.  I am changing the data via VarManager and I would expect my application to be notified that the data was changed.  Does anyone have any idea what could be stopping me from receiving the events.  (The NVs are being sourced from a different machine on the network.)

Thanks
-Steve
0 Kudos
Message 1 of 3
(2,865 Views)
Hi Steve,

If your VB.NET program has established an event handler for the OnDataUpdated event, changing the value in Variable Manager should fire this event. I put together a very basic VB.NET program that demonstrates this and attached it. The steps to run the example is

1) Open Variable Manager and add a "test" process and then a "myDouble" variable of type Double (see the attached "VarMan.jpg" screenshot).
2) Go back to the VB.NET code and place a breakpoint in the OnDataUpdated event handler
3) Run the application and click the Connect button.
4) Double-click the variable in Variable Manager and edit the value

This will force the event to be captured.

Let me know if you have problems.

Best Regards,
Jonathan N.
National Instruments
Download All
0 Kudos
Message 2 of 3
(2,861 Views)
Thanks.  I had two problem.

1. I was forgetting to call subscriber.connect. (oops)
2. The subscriber variable was scoped wrong.  I had it defined in the local method and I noticed you had it global.  Changing that to have a larger scope is what realy resolved the issue.

Thanks for the help.
-Steve
0 Kudos
Message 3 of 3
(2,842 Views)