To visualize the input and output values of the expansion units in HMWIN Studio, you must configure all relevant variables (tags).
All holding registers should be prefixed with '4' per Modbus convention. To determine the correct register offset, consult the tables Adressen für FP0/FP0R-Erweiterungsmodule and Speicherbereich für GPIO-, LED- und Systeminformationen.
Inputs are read-only whereas outputs allow both reading and writing operations.
We will begin with the configuration of the 16 digital inputs and 16 digital outputs of the first expansion unit. For demonstration purposes, the 16-bit input and output data will be mapped both as a single 16-bit word and as individual bit-level signals.
Go to ProjectView and double-click Tags.
Select the Modbus protocol and click the + icon to add a new tag for a 16-bit word input.
Make the following settings:
Memory type: Holding Registers
Offset: 433040
Data type: unsignedShort
Select OK and rename the tag to an arbitrary name, e.g. Input_Word1_Expansion1.
Click the + icon to add a tag for the first single-bit input.
Make the following settings:
Memory type: Holding Registers
Offset: 433040 (same address as before)
Data type: boolean
SubIndex: 0
Select OK and rename the tag to an arbitrary name, e.g. Input_Bit0_Expansion1.
Click the + icon to add a tag for the second single-bit input.
Make the following settings:
Memory type: Holding Registers
Offset: 433040 (same address as before)
Data type: boolean
SubIndex: 1
Select OK and rename the tag to an arbitrary name, e.g. Input_Bit1_Expansion1.
Repeat this procedure for the remaining 14 single-bit inputs, incrementing the subindex value by one for each subsequent input.
The same procedure applies for outputs. Use offset 433050.
This unit has four analog inputs and two analog outputs. Since there are more than two input words, multiplexed addressing is required. Use offset 33058 instead of 33056. The outputs can use standard (non-multiplexed) addresses.
Click the + icon to add a tag for the first input word.
Make the following settings:
Memory type: Holding Registers
Offset: 433058
Data type: unsignedShort
Select OK and rename the tag to an arbitrary name, e.g. Input_Word1_Expansion2.
Click the + icon to add a tag for the second input word.
Make the following settings:
Memory type: Holding Registers
Offset: 433059
Data type: boolean
Select OK and rename the tag to an arbitrary name, e.g. Input_Word2_Expansion2.
Repeat this procedure for the remaining two input words, using the offsets 433060 and 433061 for the two subsequent inputs.
The same procedure applies for outputs. Use the offsets 433066 and 433067.
In the example, we will add a tag for the device temperature. See the register table for more system values.
Click the + icon to add a tag.
Make the following settings:
Memory type: Holding Registers
Offset: 433120
Data type: Short
Select OK and rename the tag to an arbitrary name, e.g. DeviceTemperature.
You can now use the tags in your visualization.