The Modbus Protocol is an “Memory Range” orientated protocol, but VisXpert implements an “Tag Name” based memory model. To be able to publish variables as memory areas in Modbus, you must create an mapping, where you define which variables are available on the Modbus registers, and what data types they will use.
You will create on e “Mapping Item” for each variable that you want to make available on the Modbus Server. Each Item can then define how it will be made available to the registers.
You have to make sure that the Register offsets and length do NOT overlap!

VisXpert Variable And Group Name
Here you have to select the variable that you want to publish
Read Only
if set to read only, the modbus registers can not be written to, and every write attempt will return an error code
Modbus Address
Defines the Address and data type to use in the Modbus Registers. The Data type will be converted appropriately if the VisXpert variables type does not match.
- Modbus Data Area: the memory area where the data will be made available. Generally you want to use “Hold Registers.
- Modbus Register Offset: Defines the register offset in the selected Data Area. Remember that each Modbus register is defined as uint16.
- Modbus Register Count: the amount of register that the data type will use. Remember that each modbus register is 16 bits wide, so an 32 bit real will occupy 2 register.
Expressions
These Expressions allow you to modify the value before handing it out to the modbus server.
An common use case is to apply an “V*10” before haning it to the Modbus Cliente (OnReadExpression)
and an “V/10” Expression when receiving it from the Modbus Client (OnWriteExpression).
The Variable “V” always refers to the Value (either coming from modbus or going to modbus, depnding on Read/Write).
Available functions include common mathematical functions such as:
*, / , +, -, pow(base, exponent) etc.
Example:
Convert Celsius to Fahrenheit: (V * 9/5) + 32
Convert Fahrenheit to Celsius (V − 32) * 5/9

