<< Click to Display Table of Contents >> Navigation: Modbus Universal MasterOPC Server > MasterOPC Universal Modbus Server > The Design-Time Mode > Parameters of Tree Objects > The Dialog of Tag Parameters |
In the General Settings section, the following parameters are set (see also Operations in Dialogs of Parameters ):
Comment – a comment to the tag; transferred to clients
Available – if TRUE, the tag is executed in real-time; if FALSE, is not executed (that is, is not accessible for a client)
Region – a MODBUS address space (COILS, DISCRETE_INPUTS, INPUT_REGISTERS or HOLDING_REGISTERS). In addition, the SERVER_ONLY value can be assign to this parameter; in this case, the tag becomes local (that is, without links to device tags) and executes only a user script.
Compliance region Modbus read and write functions |
||
Region |
Read function |
Write function |
Coils |
0x01 |
0x05 - single, 0x0F - multiply |
Discrete_Inputs |
0x02 |
not supported |
Holding_Registers |
0x03 |
0x06 - single, 0x10 - multiply |
Input_Registers |
0x04 |
not supported |
The Region parameter is available only in the tag creation dialog.
Address – an address offset in the selected address space
Data type in device – a data type in the device (bool, int16, uint16, int32, uint32, float, double or string (a string length is 250 bytes); will be converted to a data type in the server)
Data type in server – a data type for server clients (bool, int32, uint32, float, double or string)
Note. The data type in the device and the data type in the server can be set differently. The main purpose of this functionality is the convertation of the received data. However, it is possible that when writing, the value received from the OPC client exceeds the possible range of the data type in the device. For example, the data type in the device is int16, the type in the server is int32, a write value of 40000 was received from the client (with a possible range of int16 from -32768 to 32767) - in this case, writing to the device is not performed, and a message about exceeding range write to the log.
Access type – access to the variable (ReadOnly, WriteOnly or ReadWrite)
Device byte order – if TRUE, a byte order is inherited from the device; otherwise, the extra setting Byte order becomes available.
Byte order – a value cell of this parameter displays the specified order of bytes, and contains the button
to open the byte swapping editor . The parameter provides exchange with devices with different byte sequence order in numbers. For instance, for 2-byte integer, in which the upper byte goes first, an order of the kind 10xxxxxx must be set (only the first two bytes are meaningful, an order of other bytes is insignificant).
The last tag in a group query – if TRUE, the tag will always be the last in a group request query
Conversion (A*X+B) – scaling of a value X that is read out; a multiplier and an offset are defined by the parameters of the Conversion factors section (displayed if Conversion (A*X+B) = TRUE). A value is scaled back when writing to the tag. Example: assume that a tag with the ReadWrite access type is linked with a device register, A=2, and B=100. Then, if a register value is 10, a value of the tag in the server equals 2*10+100=120; but when writing 200 to the tag, (200-100)/2=50 is written to the register.
In the Conversion factors section, a multiplier and an offset are defined for the Conversion (A*X+B) parameter:
Factor A – a multiplier
Factor B – an offset
Calculate factors – a value cell of this parameter contains the button
to open the dialog to define a correspondence between an arbitrary range of read/written values (Device value) and the respective range of values in the server (Server value):
By the values defined in the dialog, a multiplier and an offset are automatically calculated (for instance, Factor A = 5 and Factor B = 100 for the example above).
In the Script section, the following parameters are set:
Script execution after reading – enable/disable processing a received value (a script is defined by the Edit read script code parameter)
Edit read script code – a value cell of this parameter contains the button
to open the script editor
Script execution before writing – enable/disable pre-processing a value before writing (a script is defined by the Edit write script code parameter)
Edit write script code – a value cell of this parameter contains the button
to open the script editor
In the Additional settings section, the following parameters are set:
Separate R/W registers – must be TRUE if different registers for reading and writing are provided for the same variable; an address of the write register is set by the Separate write register parameter
Separate write register – see description of the previous parameter, Separate R/W registers
Bit extraction – enable/disable extraction of the bit specified by the Bit number parameter from a device reply
Bit number – a bit that is extracted from a device reply
Read after write – if TRUE: if a value is written to a variable, that variable is read out right away, that is, not waiting for an inquiry cycle time. (Usually, values are read out 1 time per an inquiry cycle.)
Resetting the write command - if, when writing to the tag, the write did not go through (there was no connection with the device or the device returned an error), the write is no longer attempted until a new write request from the OPC client. Otherwise, attempts will be continued until the recording is successful.
Forced writing by function 6 – must be TRUE for some devices (in particular, for OWEN devices), for which values are read out by the command 3, and written by the command 6 (but not by the command 16). This parameter is used only in case of Region=HOLDING_REGISTERS
In the HDA section, the following parameters are set:
HDA Access – if FALSE, the tag is not archived; otherwise, its parameters can be written into an HDA archive. A writing mode depends on the parameters Auto writing and Writing on tag value change:
If Auto writing = TRUE and Writing on tag value change = TRUE, the tag is archived at each change of a its value
If Auto writing = TRUE and Writing on tag value change = FALSE, the tag is archived periodically; the period is defined by the Request period parameter of the device (sub-device).
Regardless of the parameters Auto writing and Writing on tag value change, the tag can be archived from a script, using the respective functions (for instance, server.WriteCurrentTagToHda ; see Functions to Operate with Tags ).
Archive size (100-4080 records) – a size of the tag archive (from 100 through 4080 records). If an archive is overfilled, next records are written starting from the archive beginning (the most old records are overwritten, that is, are lost).