Using the Fix32 Object

The Fix32 object is by far the easiest to use, but it is expensive in terms of performance. Every time you execute a line of code that uses the Fix32 object to retrieve or set values, the WorkSpace will:

  1. Instantiate a new data item.
  2. Validate the item.
  3. Read/write a value.
  4. Destroy the object.

This will be especially slow if the process is attempting to access a tag that is remote to the local node.

Example

The following code example demonstrates using the Fix32 object to access thisnode:tag.f_cv:

'Writes

Fix32.thisnode.tag.f_cv = 1.0 ' Write a 1 to thisnode:tag.f_cv

 

'Reads

Dim X as Single

x = Fix32.thisnode.tag.f_cv 'Read the value to thisnode:tag.f_cv and assign it to single precision variable x