URL Property

NI DataSocket

URL Property

Syntax

CWDataSocket.URL

Data Type

String

Purpose

Specifies the location expressed as a URL of the data source or target to which the CWDataSocket is connecting.

Remarks

Use the ConnectTo method to set the URL as you connect.

The CWDataSocket can connect to different data sources or targets according the URL specified. The AccessMode property determines if the CWDataSocket is reading a data source or writing to a data target.

If the data source or target pointed to by the URL redirects the CWDataSocket to a new URL, the ActualURL property is set to the new URL.

The following types of URLs are supported:

ProtocolExamples
DataSocket Server ("dstp:")dstp://localhost/wave
dstp://machine/item
Standard Web Server ("http:")http://www.ni.com/cworks/datasocket/tone.wav
Standard FTP Sites ("ftp:")ftp://ftp.ni.com/datasocket/ping.wav
The ftp site should allow anonymous connections.
Lookout/Logos objects ("lookout:" or "logos:")lookout://localhost/testprocess/pot1.value
logos://localhost/testprocess/pot1.value
Files directly accessible from your file system ("file:")file:ping.wav
file:c:/mydata/ping.wav
file://machine/mydata/ping.wav
OLE for Process Control (OPC) Servers ("opc:")opc:/National Instruments.OPCDemo/sine
opc:/National Instruments.OPCDemo/sine?Accesspath=sine
opc://machine/National Instruments.OPCModbus/Modbus Demo Box.4:0
opc://machine/National Instruments.OPCModbus/Modbus Demo Box.4:0?updaterate=100&deadband;=0.7

Example

'Set the AccessMode and URL properties and connect
'to a data source.
CWDataSocket1.AccessMode = cwdsRead
CWDataSocket1.URL = "http://myhost/pata_path"
CWDataSocket1.Connect

'The AccessMode and URL also can be set with ConnectTo.
CWDataSocket1.ConnectTo "http://myhost/pata_path", cwdsRead

See Also

AccessMode

ActualURL

Connect

ConnectTo