You can wire a Shared Variable node into VIs and functions or use the DataSocket VI and functions to programmatically configure, read, or write live data.
![]() |
Note Shared Variables can only be created, configured and hosted on Windows systems. You can use the DataSocket VIs and functions to read or write shared variables from other platforms. If you have a VI with a Shared Variable node that was configured on a Windows system, you can also move that VI to another platform. |
You read or write data by specifying a URL in much the same way you specify URLs in a Web browser.
URLs use communication protocols, such as psp, dstp, opc, ftp, http, and file, to transfer data. The protocol you use in a URL depends on the type of data you want to write and how you configure your network.
You can use the following protocols when you read or write data using the DataSocket VI and functions or when you enable a connection for a control:
![]() |
Note You can use the NI-PSP protocol to write data only from Windows NT/2000/XP and RT platforms. However, you can use the NI-PSP protocol to read data on all LabVIEW-supported platforms. |
![]() |
Note To read a text file from an FTP site using DataSocket functions, add [text] to the end of the URL. |
The following table shows examples of each protocol URL.
| URL | Example |
|
psp |
For shared variables: psp://computer/library/shared_variable For NI-PSP data items, such as server and device data items: psp://computer/process/data_item fieldpoint://host/FP/module/channel For dynamic tags: psp://machine/system/mypoint, where mypoint is the named tag for the data |
|
dstp |
dstp://servername.com/numeric, where numeric is the named tag for the data |
|
opc |
opc:\National Instruments.OPCTest\item1 opc:\\computer\National Instruments.OPCModbus\Modbus Demo Box.4:0 opc:\\computer\National Instruments.OPCModbus\Modbus Demo Box.4:0?updaterate=100&deadband=0.7 |
|
ftp |
ftp://ftp.ni.com/datasocket/ping.wav ftp://ftp.ni.com/support/00README.txt[text] |
|
file |
file:ping.wav file:c:\mydata\ping.wav file:\\computer\mydata\ping.wav |
|
http |
http://ni.com |
Use the psp, dstp, and opc URLs to share live data because these protocols can update remote and local controls and indicators. Use the ftp and file URLs to read data from files because these protocols cannot update remote and local controls and indicators.
You can pass data of any LabVIEW data type using the DataSocket VI and functions. You also can use the DataSocket VI and functions to read and write the following data: