The read-write register is a data variables that "holds" the value that is written to it by an OPC client, and the same value is then provided when the data variable is read by an OPC client (or an OPC client subscribes to it). Without further configuration, each data variable in OPC Wizard behaves essentially as a read-write register, because
However, even though the default behavior correspond to the read-write register, you usually still need to configure additional properties on the data variable, such as the data type. In most cases, you also want to define some reasonable initial data for the variable. These tasks can be done with the help of extensions methods for Data Variable Configuration.
The OPC Wizard provides extension methods that allow you to define read-write register data variables easily. This is described in the Data Variable Configuration article. Typically, you will use some overload of the ReadWrite or ReadWriteValue method to configure the data variable as the read-write register. The following example illustrates the use of the ReadWriteValue method.
How do you choose between these extension methods?
The following example illustrates the use of the ReadWrite method for defining a read-write register with specified initial attribute data (including status code and timestamp).
If there is no valid initial value for the register, you can specify a "Bad" status code in its attribute data. This is illustrated in the following example.
The read-write registers defined by the ReadWrite method allow writing of the value, status code and timestamp. The read-write registers defined by the ReadWriteValue method only allow writing of the value. You can modify this behavior by configuring the data variable further, with the use of the Writable method. This is illustrated in the following example.
See Variable Data Type Considerations.