01-15-2011 05:57 AM
01-15-2011 06:37 AM
Sorry lost all the formatting
Surely this shouldn’t be so difficult! I have a little LabVIEW program running in the background of PC1. The exe’s task is to collect and send OPC variables held on a SCADA system and convert them to shared network variables (as I thought that they would be easy to share over a network, easier than the nasty OPC and DCOM issues). I have PC2 which runs measurement studio and I have created a nice test VB program which either writes or reads the network variables which are on PC1. The PC1 collection software is working perfectly and when I change the values on the SCADA system I can see the network variable change on ‘NI Distributed System Manager’. I When I look at ‘NI Distributed System Manager’ on PC2 I can’t see PC1 on the list and when I use the basic measurement studio code below to read the network variable it times out at the TestVariable.connect() line.
Ok so what do I need to do to read a shared network variable sat on PC1 from PC2 on the network
Public Class Form1
Private WithEvents TestVariable As NetworkVariableSubscriber(Of Double)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TestVariable = New NetworkVariableSubscriber(Of Double)("\\192.168.58.139\Test\TestVariable")
TestVariable.Connect()
End Sub
Private Sub TestVariable_Data_Updated(ByVal sender As System.Object, ByVal e As NationalInstruments.NetworkVariable.DataUpdatedEventArgs(Of Double)) Handles TestVariable.DataUpdated
TextBox1.Text = e.Data.GetValue
End Sub
End Class
01-15-2011 09:54 PM
You should probably post this on the Measurement Studio forum since it sounds like the problem is in the Meas. Studio/Shared Variable communication rather than LabVIEW/Shared Variable.
01-16-2011 12:56 PM - edited 01-16-2011 01:06 PM
Could do although its not about Measurement Studio either, if I built an LabVIEW exe to look for a shared variable which was on another PC I am pretty sure I wouldn't see it either. The problem I am having is the ability to pass a shared variable between two PC's. When talking about shared variable's, NI always talk's about putting it on a RT device I wonder if it not only to do with performance but with the ability to connect a PC to those shared variables is easier between a PC and RT device than it is between two PC's?
01-16-2011
01:20 PM
- last edited on
10-12-2026
02:49 PM
by
Content Cleaner
Actually just found this
Using the LabVIEW Shared Variable
and even more relevant
Neither PC has development version of LabVIEW. Does anyone know what the PSP URL format is if I had a library in a project called Test and in that it had a Shared Variable called TestVariable would the PSP URL be \\192.168.1.1\Test\TestVariable??