Specifications

Application note Connecting CP600 to motion products via Modbus RTU AN00200-003
ABB Motion control products 10
www.abb.com/motion
End Bitfield
Dim HMIBitData As BitData
HMIBitData.DoubleWord = NETINTEGER(2) ‘Read all 32 bits into a bitfield variable
OUTX(0) = HMIBitData.Bit19 ‘Set output 0 according to the value written by the HMI
…and we could then use the following code to write to this bit…
HMIBitData.Bit19 = INSTATEX(1) ‘set bit 19 to reflect the state of input 1 on the controller
NETINTEGER(2) = HMIBitData.DoubleWord
Similar BitField types could be used to encode Byte and Word level data…
BitField ByteData
DoubleWord As 0 to 31
Byte0 As 0 to 7
Byte1 As 8 to 15
Byte2 As 16 to 23
Byte3 As 24 to 31
End BitField
BitField WordData
DoubleWord As 0 to 31
Word0 As 0 to 15
Word1 As 16 to 31
End BitField
For controllers not supporting the BITFIELD keyword (e.g. NextMove ES / ESB-2 running firmware version 5424) data less than 32
bits wide must be extracted using the logical OR, AND, NOT functions for example.
Examples:
Dim nNetData2Bit19 As Integer
nNetData2Bit19 = ((NETINTEGER(2) & 0x00080000) > 0)
Dim nNetData2Word1 As Integer
nNetData2Word1 = SHIFT((NETINTEGER(2) & 0xFFFF0000), 16)
Accessing 32 bit data (int or Float) is much simpler, the Mint program just needs to utilise COMMS, COMMSINTEGER, NETFLOAT
or NETINTEGER according to the setting of Modbus parameter _mpREGISTER_MAPPING and the programmed HMI data type.
For string data either COMMSINTEGER or NETINTEGER data should be used. Strings are made up of character data where each
character is an eight bit (byte) value. Therefore each COMMSINTEGER or NETINTEGER location is capable of storing 4 characters.
If the HMI Tag has been programmed to store more than 4 characters then successive locations are utilised as required.
Example:
A label on our HMI screen needs to display text up to 10 characters in length. The screenshot below shows how a Tag could be
programmed to allow this (using COMMSINTEGER(1) or NETINTEGER(1) depending on the register mapping setup by the Mint
program)…