<< Click to Display Table of Contents >> Navigation: Modbus Universal MasterOPC Server > Quick Start > Example2 - Device Connection via Modbus RTU > Tags of Discrete Inputs |
Create tags to receive values of discrete inputs. Refer to the documentation again.
To get a state of discrete inputs, the register 0x23 is used; the bit 0 indicates a state of the input 1, and the bit 1 indicates the state of the input 2. It is possible to get and transfer that tag as an INT-type number, and extract bits at the upper level (in a SCADA system), or extract bits in the OPC server.
Note. We recommend to extract bits at the upper level. This economizes licensed tags of the OPC server.
Add a new tag. In the window displayed, set parameters: Region - Holding Registers, Data type in device - int16, Data type in server - int32 (if you plan to extract bits at the upper level; if you plan to extract bits in the OPC server, you can set bool), Access Type - ReadOnly, and Byte order - High byte first.
Now let's extract the bit 0. To do this, set Bit extraction to TRUE, and specify 0 as a number of bit extracted. If Bit extraction = TRUE, Data type in server is automatically set to bool.
Click OK.
The same way, add one more tag Discrete Input 2, and configure extraction of the bit 1.
Tags are added to the tree.