LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pass an array of text through data sockets to LV application.

An application involves both LabView application(LV8.5.1) and an external data logging program (VB 6 with Measurestudio 8.1) on the same computer. Datasockets were used to pass data between the two programs. At the start of the data logging program an array of text and an array of double need to be sent to the LV application and during running, an array of double are being pulled from the LV application to the data logging program.
 
I found that URL link adopted by the browsing button such as "opc://localhost/National Instruments.Variable Engine/\\.\xxxx" does not work with my array of text. It only works with array of doubles. Further investigation fund that the URL changes to "psp:\\localhost\xxxx" will allow passing the array of text through. Here's my VB Code:
 
Dim TXs(10) as String, DBLs(10) as Double
 
Private Sub BindSocket()
Dim URL$
 
Load Sockets(1)
Load Sockets(2)
 
URL = "opc://localhost/National Instruments.Variable Engine/\\.\TestVARLib\RTDBLs"
Sockets(0).ConnectTo URL, cwdsReadAutoUpdate
 
URL = "psp:\\localhost\TestVARLib\TXInfo"
Sockets(1).ConnectTo URL, cwdsWrite
 
URL = "opc://localhost/National Instruments.Variable Engine/\\.\TestVARLib\DBLInfo"
Sockets(2).ConnectTo URL, cwdsWrite

End Sub
 

Public Sub WriteTo_SocketsTX()
Sockets(1).Data.Value = TXs
Sockets(1).Update
End Sub
 
Public Sub WriteTo_SocketsDBL()
Sockets(2).Data.Value = DBLs
Sockets(2).Update
End Sub

My questions is that what is the difference between the URL "psp:\\localhost\"  and "opc://localhost/National Instruments.Variable Engine/\\.\"? Why the URL "opc://localhost/" does not work with my array of texts?
 
Thanks
 
0 Kudos
Message 1 of 2
(2,652 Views)
 

Hi XT,

 

As described in How Do I Read/Write to a Shared Variable with the DataSocket API? describes, you should always use the psp url to pass data using datasockets.  The NI PSP is the networking protocol optimized to be the transport for Network Shared Variables.

You can find a lot of useful information about using these shared variables here, the portion about NI PSP is especially useful:  Using the LabVIEW Shared Variable

 

 

0 Kudos
Message 2 of 2
(2,626 Views)