URL Property

Measurement Studio User Interface

URL Property

Syntax

CWBinding.URL

Data Type

String

Purpose

Specifies the location as a URL of the data source or target to which you are binding.

Remarks

You also can set the URL with the ConnectTo method call.

The CWBinding can connect to different data sources or targets, depending on the specified URL. The AccessMode property determines if the CWBinding is reading a data source or writing to a data target.

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

The following types of URLs are supported:

DataSocket Server ("dstp:")

Examples: dstp://localhost/wave, dstp://machine/item

Standard Web Server ("http:")

Example: http://www.ni.com/cworks/datasocket/tone.wav

Standard FTP Sites ("ftp:"). The ftp site should allow anonymous connections.

Examples: ftp://ftp.ni.com/datasocket/ping.wav

Files directly accessible from your file system ("file:")

Examples: file:ping.wav, file:c:\mydata\ping.wav, file:\\machine\mydata\ping.wav

OLE for Process Control (OPC) Servers ("opc:")

Examples: 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

'Create a binding that charts wave data
'from a local DataSocket Server on a graph.
Dim Binding As CWBinding

'Add new CWBinding
CWGraph1.CWBindings.Add
Set Binding = CWGraph1.CWBindings.Item(1)

'Set AccessMode to automatically read and update
Binding.AccessMode = cwdsReadAutoUpdate
'Specify the data source on the DataSocket Server
Binding.URL = "dstp://localhost/wave"

'Bind the URL to CWGraph control, YData property
Binding.SetBindObject CWGraph1
Binding.BindProperty = "YData"

'Connect to data source
Binding.Connect

See Also

AccessMode

ActualURL

Connect

ConnectTo