CNiBinding

CNi

Class CNiBinding Base ClassesData ItemsConstructorsDestructorsFunctionsGo to hierarchy chart    Prev page: UpdateNext page: AccessMode    
Class Declared in:
NiBinding.h

'Overview' icon -- Shortcut to top of page. Overview

CNiBinding encapsulates the interface to a single binding object of a button, graph, knob, numeric edit, or slide control. This allows you bind a control property to a data source, such as an item on an OPC or DataSocket Server.

You can use this object to automatically associate a property with a data item. For example, if you want a slide to always display the value of the data item "wave" from a DataSocket Server, you set up a binding to connect the CNiSlide::Value property to "dstp://localhost/wave".

Notes:

  1. You can bind any control property, not just the value. For example, you can bind the graph background color to an item on an OPC Server.
  2. You also can manipulate the data values in the CWBindingOnDataUpdated event on each control, so that you can scale the values being sent or received from the property values.
  3. For a complete list of a control's bindable properties, refer to the Bindings property page for that control.
  4. You must call CNiBinding::SetBindObject in the same thread that you used to create the object to which you are binding.
  5. Currently, data binding is not supported on the 3D graph control.
  6. You must initialize a CNiBinding object from an existing object. If you do not initialize a CNiBinding object from an existing object, a CNiObjectNotInUsableState exception will be thrown when you attempt to manipulate the instance of the CNiBinding.

Hierarchy Chart Hierarchy Chart

'Base Classes' icon -- Shortcut to top of page. Base Classes

'Data Items' icon -- Shortcut to top of page. Data Items

Public data AccessModes AccessMode Specifies the access mode for the connection.
Public data CString ActualURL Identifies the actual URL of the current data source or data target.
Public data CString BindProperty The name of the property to bind to a data source or data target.
Public data bool DataUpdated Specifies if the CNiBinding object's data value or attributes have been set since they were last read or written.
Public data bool DataUpdatedEnabled Specifies if the binding should generate the DataUpdated event whenever the binding data changes.
Public data long LastError The last error code used in the StatusUpdated event.
Public data CString LastMessage The last message used in the StatusUpdated event.
Public data ConnectionStatus Status The current status of the CNiBinding connection.
Public data bool StatusUpdated The CNiBinding object calls this function when its Status property is updated.
Public data long TimerInterval Use this property to configure CNiBinding to automatically call Update at regular intervals.
Public data CString Url Specifies the data source or target.

'Constructors' icon -- Shortcut to top of page. Constructors

Public constructor

CNiBinding()

Default constructor.
Public constructor

CNiBinding( CWBinding_CI* pCustom, CNiInterface::ThreadAccess option )

Constructor that attaches to the specified CWBinding_CI pointer.
Public constructor

CNiBinding( const CNiBinding& source )

Copy constructor.

'Destructors' icon -- Shortcut to top of page. Destructors

Public destructor

~CNiBinding()

Destructor.

'Functions' icon -- Shortcut to top of page. Functions

Public function void

Connect( LPCTSTR URL, AccessModes accessMode )

Connects the CNiBinding object to a data source or target.
Public function void

Connect()

Connects the CNiBinding object to a data source or target.
Public function void

Disconnect()

Disconnect the binding connection from the source to which it is currently connected.
Public function static const IID &

GetIid()

Returns the globally unique identifier (GUID) of the ActiveX interface to which this class connects.
Public function const CNiBinding &

operator =( const CNiBinding& source )

Assignment operator.
Public function bool

SelectURL( const CString& startURL = "", const CString& title = "", int options = 0, const CString& filter = "" )

Displays a dialog box for the user to select a data source/target and sets the URL property to that data item.
Public function void

SetBindObject( CNiInterface& subObject )

Sets the object whose property binds to a data source.
Public function void

SetBindObject( CNiControl& control )

Sets the object whose property binds to a data source.
Public function void

Update()

Causes the CNiBinding object to read from a data source or write to a data target.