You are on page 1of 48

MODBUS Map Format Description

Revision History:
Initial Draf 9/2/2009 Alex Kravchenko
rev 1.0 9/30/2009 Alex Kravchenko
rev 1.1 9/30/2009 Alex Kravchenko
rev 1.3 10/29/2010 Alex Kravchenko
rev 1.4 12/6/2011 Prashantha
rev 1.5 4/18/2013 Alex Kravchenko
rev 1.6 9/24/2013 Alex Kravchenko
rev 1.7 10/13/2016 Anguel Tzavkov
Updated based on Tom H comments
Added mode details for MODBUSMin/Max IONMin/Max scaling attributes
Added Date Time and PF format details for IEC 870-5-4
Added DeviceSpecific01 -DeviceSpecific16 formats
Clarified SetupReg attribute and described new, CacheSpec "S" option
Added Ping attribute (available in PME 8.2)
Entity Entity Type Applies To

ModbusMap Element
DeviceInfo Element ModbusMap

MaxRequestRegisters Attribute DeviceInfo

GlobalNotAvailable Attribute DeviceInfo

MDISupported Attribute DeviceInfo


MultiplePresetSupported Attribute DeviceInfo

ScatteredReadSupported Attribute DeviceInfo

EthernetSupport Attribute DeviceInfo

SerialDevice Attribute DeviceInfo

EthernetDevice Attribute DeviceInfo

LowSpeedUpdateRate Attribute DeviceInfo

HighSpeedUpdateRate Attribute DeviceInfo

DateTimeValidation Attribute DeviceInfo


TimeSyncInterval Attribute DeviceInfo

AutoCacheControlHandles Attribute DeviceInfo

TimeSyncWithDST Attribute DeviceInfo

IONHandle Attribute ModbusInfo


Name Attribute ModbusInfo
ModbusAddress Attribute ModbusInfo

RequestType Attribute ModbusInfo

Format Attribute ModbusInfo

Mask Attribute ModbusInfo

Scale Attribute ModbusInfo


Multiplier Attribute ModbusInfo

Offset Attribute ModbusInfo


ModbusMin Attribute ModbusInfo
ModbusMax Attribute ModbusInfo
IONMin Attribute ModbusInfo
IONMax Attribute ModbusInfo
WriteValue Attribute ModbusInfo

NumberOfRegisters Attribute ModbusInfo

ReadTime Attribute ModbusInfo

CheckRegister Attribute ModbusInfo

CheckRegValue Attribute ModbusInfo


ConfigValueHandle Attribute ModbusInfo

ConfigLabelHandle Attribute ModbusInfo


NotAvailableValue Attribute ModbusInfo

DisableNotAvailableCheck Attribute ModbusInfo

DefaultEnumValue Attribute ModbusInfo

MatchPattern Attribute ModbusInfo


CacheSpec Attribute ModbusInfo

SetupReg Attribute ModbusInfo

ConfigWrite Attribute ModbusInfo

EnumName Attribute ModbusInfo

ConfigLabelName Attribute ModbusInfo


Diagnostics Element ModbusMap

ModbusInfo Element ModbusMap

CalcInfo Element ModbusMap

EnumInfo Element ModbusMap


ConfigLabelInfo Element ModbusMap

TransactionConfiguration Element ModbusMap

HandleExclusionList Element ModbusMap


DatasetAddressBlock Element TransactionC
onfiguration

InvalidAddressRange Element TransactionC


onfiguration

DynamicLabel Element ModbusInfo


Ping (available in PME 8.2 and later) Attribute ModbusInfo
Description Design
Referen
ces
The root element of the map document.
This lement defines parameters of the device. Does not
have any child elements, only attributes.
Specifies how many registers can bre requested within one
MODBUS packet. The MODBUS protocol specification
limits the size packet to 125 16-bit registers, but some
devices have lower limit.

The translatopr recognizes the following values for this Efficien


attribute: cy-
"AllBitsSet" - Used when the device indicates a 'not GlobalN
available' value by setting all bits in the register. otAvaila
"NotSpecified" - The 'not available' value is not known. bleRew
This effectively disables the default N/A value. If the ork-
attribute is missing, the behaviour is the same as Design.
'NotSpecified'. doc
numeric value - The value used by the device to indicate a at
'not available' value. If a ModbusInfo entry does not \\pan.c
define its own N/A value, this value is used. anada.c
orp.po
werme
asurem
ent.co
m\Proj
ects\20
08\ION-
E_Devic
e_Drive
rs_2\De
sign

This attributes controls whether the Modbus Device


Importer (MDI) tool can modify the device type translation
files. The following are the possible values of the attribute:
0 - This device type cannot be opened by the tool
1 - MDI has full control over the device type (default
option)
2 - Only translation extensions changes are allowed (SW
Logging and Calculations)
Specifies which write function translator would use to
write to the device. Possible values:
0 - translator would use single write functions:
5 Write Single Coil
6 Write Single Register
1 - translator would use multiple write functions (default
option)
15 Write Multiple Coils
16 Write Multiple registers

Specifies if the device supports function 100 Scattered


Read. This function is not listed in the MODBUS protocol, it
is a Schneider Electric extension. The possible attribute
values are:
0 - device does not support Scattered Read function
(default option)
1 - device supports Scattered Read Function

Deprecated attribute. Current translator code ignores it.


Not to be specified in the map any more.
Deprecated attribute. Current translator code ignores it.
Not to be specified in the map any more.
Deprecated attribute. Current translator code ignores it.
Not to be specified in the map any more.
Defines period (in seconds) for requests for cached values
(scaling, setup registers, exclusion lists, dynamic labels
etc...). Default value is 30 seconds.
Defines period (in seconds) for extesion requests (SW
logging and calculation). Default value is 10 seconds.
Some device types provide indication for invalid
timestamps. The DateTimeValidation attribute dictates
whether the translator returns "Not Available" response
rather than possible timestamp value to the caller in cases
where the timestamp is marked as invalid. The possible
attribute values are:
0 - timestamp value returned even if it is marked as
suspect (default option)
1 - invalid timestaps returned as "Not Available" value
Specifies how ofen translator sends time synchronization
requests to the device. The value is specified in seconds. http://p
Value 0 means that time synchronization is disabled. Base owerw
MODBUS translator class forces this value to be zero. All eb.pmc
the derived classes need to override function .ca.sch
GetDefaultTimesyncInterval and provide device specific neider-
implementation in have the time synchronization to work. electric.
com/pr
ojects/
pmp/d
di/Desi
gn
%20Do
cument
ation/D
evice_T
imeSyn
c.doc

This attribute if set to 1 (default value) makes any control


written to the device to set the configuration change flag.

Specifies if time sychronisation is to be performed taking in


account DST affset. The possible attribute values are:
0 - ignore DST offset
1 - use DST offset (default option)

ION Register handle


Name of the map entry. Is not use anywhere in the code. It
is provided for reference only.
Modbus address string that uses the following format for "Sepam
different MODBUS register types: _Protec
"000001" to "099999" - Coils tionSe
"100001" to "199999" - Input Status ttings_
"300001" to "399999" - Input Registers Design.
"400001" to "499999" - Holding Registers. doc" at
Note that all strings are 6-character long. Although the "\\pan.
translator code would recognize different commonly canada.
accepted lengths of the address string we encourage using corp.po
only 6-character strings as some of our tools use it as the werme
standard. asurem
There also device type specific formats: ent.co
- Micrologic devices have two ':'-separated parts of the m\Proj
address specifying unit id as a first part ects\20
- PowerLogic addresses can have 'p'- separated suffix 08\ION-
specifying "portal register offset" E_Corsi
- Sepam devices also use ModbusAddress string to identify ca_Devi
a Protection Setting. The string will have two 's'-separated ce_Driv
parts: the first part is function number, the second part is ers\0_D
the setting number. esign_a
nd_Test
\Design
_Docu
mentati
on"
"http://
power
web.p
mc.ca.s
chneide
r-
electric.
com/pr
ojects/
pmp/d
di/Desi
Specifies which requests the transaltor can use to access gn
this register:
"R" - read only
"W" - write only
"RW" - read and write
"CW" - command-write request

Specifies MODBUS register fromat. See separate


spreadsheet "Data Formats" that ia a part of this
document. It lists all the supported formats.
Mask values applies to the modbus register value before
converting to ION register value.
According to the current map guidelines use of the Scale
parameter is discouraged in favor of the Multiplier. See
description of the Multiplier attribute
The attribute is used to convert a MODBUS register value
to ION Register for read requests and from ION Register
value to MODBUS register value for write requests.
Translator uses scaling parameters according to the
following formula:

ION = (IONMin + (modbus - ModbusMin)*(IONMax -


IONMin)/(ModbusMax - ModbusMin) - Offset) *
Multiplier / Scale

where modbus is the MODBUS register values read from


the device and ION is the ION register value
According to the current map guidelines use of the Scale
parameter is discouraged in favor of the Multiplier. Each of
the scaling parameters can be specified either as a numeric
value or as handle of another ION register, those value is
used for calculation. If the parameter specified as a
decimal number it is a numeric parameter, if the parameter
is specified as a hexadecimal value with "0x" prefix or
using 'R' prefix then it is a referenced ION Register handle.
If ModbusMin and ModbusMax attributes are used for
scaling they also applied as limiting bonds for the modbus
value. For example, is ModbusMax value is specified as
1000 and the actual modbus value that is received from
the device is 1001 then it be changed to 1000 before it will
be used for calculation.

See description of the Multiplier attribute


See description of the Multiplier attribute
See description of the Multiplier attribute
See description of the Multiplier attribute
See description of the Multiplier attribute
Explicitly specifies value that has to be written into the
MOBUS register for the write request.
Some MODBUS register formats can have variable size. This
parameter specifies how many 16-bit words have to be
read from the device.
Specifies which ION Register is mapped to MODBUS
register that provides value for Register_read_time
requests.
CheckRegister and CheckRegister value parameters are
provided for requests performed with the Command Write
procedure ("CW" request types). They specify wich register
has to be checked and what value it is expected to have.

See description for CheckRegister attribute


This attribute is used to overwrite the register value with
other value or make it unavailable based on value of the
other, referred ION register. The list of options is specified
in child elements.
Each such child element has name ConfigValues and it has
two attributes. One is "Ordinal" specifying the option and
the other is "Value" specifying the overwriting value. The
Value attribute can also be "-NA-", in which case it
overwrites the original value with "NotAvailable"
exception.

This attributes is used to implement the "dynamic


labeling" technique where label of an ION Register would
be changing based on value of the other ION Register
(providing for example device configuration information)..
The list of options is specified in child elements.
Each such element has name ConfigLabels and it has two
attributes. One is "Ordinal" specifying the option and the
other is "Value" specifying the corresponding register
label.
There is another dynamic labeling technique that uses the
DynamicLabel attribute. That technique is used for more
complex cases of controlling register labels (Input Metering
feature for Power Logic devices). It is explained in the
description of DynamicLabel element and referenced
design document.
Specifies MODBUS register value which indicates that the Efficien
register does not have any value. In that case the ION cy-
register value will be "NotAvailable" exception. GlobalN
otAvaila
bleRew
ork-
Design.
doc
at
\\pan.c
anada.c
orp.po
werme
asurem
ent.co
m\Proj
ects\20
08\ION-
E_Devic
e_Drive
rs_2\De
sign

Disables checking MODBUS register for glabally specifyied


not available value.
Specifies which value will be applied to the ION Register in
case if any of the listed enumeration options matches the
MODBUS register value.

Specifeis the exact value of the MODBUS register that sets


the corresponding ION BooleanRegister value to true. Note
that the Mask attribute if specified is applied to the
MODBUS register value before it gets checked against the
pattern.
Translator recognizes two possible values for this attribute Cache_
"D" , "C", and "S". Re-
- Option “D” (On Demand Request) prevents the Design.
translator code periodic check for the register value, which doc
would be happening otherwise for registers in the cache. at
With On Demand request the translator will be requesting \\pan.c
the value only when its immediately needed (not in anada.c
advance). orp.po
- Option "C" (Retrieve from cache) indicates that if the werme
translator would be sending request to the device in case if asurem
the value of the register is available in the cache (it was ent.co
retrieved from the device in one of the recent requests). m\Proj
- Option "S" (Setup Register) has the same effect as ects\20
setting SetupReg attribute to 1 (supported in PME 7.2 and 08\ION-
later releases). E_Corsi
ca_Devi
ce_Driv
ers\0_D
esign_a
nd_Test
\Design
_Docu
mentati
on

This attribute if set to 1 marks the register as a setup


register, which means it will be a cached register with low
speed update rate. If value of a register that is marked with
this attribute changes then the Modbus translator
increments device' aggregate setup counter. The default
value of this attribute is 0.

This attribute if set to 1 (default value) indicates that any


write operation would be changing setup settings on the
device.
This attributes refers to an EnumInfo definition that is
defined as a separate root-level XML element.

This attributes refers to an ConfigLabelInfo definition that


is defined as a separate root-level XML element.
This element can have only one possible attribute Efficien
EnableTracing, which switches on tracing messages. cy.Traci
The tracing output is directed to the Win32 debug string ngDesig
facility. This is a Win32 API call that writes strings to an n.doc
area of globally shared memory. The debug information is at
accessible via a debugger (such as Visual Studio) or a \\pan.c
general purpose debug string viewer (such as DebugView anada.c
by Sysinternals). orp.po
werme
asurem
ent.co
m\Proj
ects\20
08\ION-
E_Devic
e_Drive
rs_2\De
sign

This element represents one map entry. IONHandle is a


mandatory attribute. It has to be unique within the map.
The other mandatory attributes are Name,
ModbusAddress, RequestType, and Format. All other
mapping attributes are optional.

This element defines an extension logging or calculation


function of the translator. It has the following three
attributes:
IONHandle - specifies the handle of the corresponding
module in tree file, Name is the name of the function, and
Function is the type of the module.

EnumInfo element defines an enumeration that is not


specific to any particular register. As such it can be used
from within multiple map entries. The element has an
orbitrary Name attribute and optional DefaultEnumValue
attribute. The element has at least one Option element
having two attributes: Ordinal and Value.
ConfigLabelInfo element defines a set of configurable
labels that can be applied to a map entry. The element
requires two attributes. One attribute is Name and the
other attribute is IONHandle. The IONHandle attribute
points to the ION register that controls the resulting labels.
The label options are specified in a set of children
ConfigLabels elements. Each of those have two attributes:
Ordinal and Value.

TransactionConfiguration elements holds Efficien


DatasetAddressBlock and InvalidAddressRange cy.Trans
definitions. Those definitions controls grouping of modbus actionTr
registers. They are addressing device constrains to have acing.d
modbus registers be requested only by datasets and oc
constrains to exclude restricted registers into modbus at
requests. The element also has the DiagnosticFlags \\pan.c
attribute that controls diagnostics tracing for MODBUS anada.c
transactions. The possible choices for the flags values are 0 orp.po
- no traces enabled, 1 - responses are traced, 2 - messages werme
are traces, 3- both, responses and messages are traced. asurem
ent.co
m\Proj
ects\20
08\ION-
E_Devic
e_Drive
rs_2\De
sign

HandleExclusionList element defines an element in the list Register


of excluded registers. Register exclusion (aka Register Pruning
Pruning) is a technique of removing some elements from -
ION tree based on value of a particular register. This Design.
technique helps re-using one tree file for multiple device doc
subtypes. In this case the ION registers that controls the at
exclusions would have different hard-coded value for each \\pan.c
of the device sub-types. HandleExclussionList also can be anada.c
used to react to dynamic changes in the device orp.po
configuration that require adding or removing registers. werme
The element has the following two attributes: IONHandle asurem
and ConfigIONHandle. The first attribute specifies the ent.co
target register, the second specifies the controlling register. m\Proj
ects\20
08\ION-
E_Devic
e_Drive
rs_2\De
sign
This element defines a set of MODBUS registers that has to
be requested as a whole block from the device. If
translator needs to send a request for a single register from
a dataset address range it will include all other registers
and request al registers at a time. The element has the
following attributes: ModbusAddress and
NumberOfRegisters.

This element specifies a group of registers that translator


must not request from the device.
The element has the following attributes: ModbusAddress
and NumberOfRegisters. A special case of the
InvalidAddressRange is when the NumberOfRegisters
attribute is specified as 0. In this case the translator would
be splitting a block of registers in two parts. This deals with
constraint of some devices that reject requests including
registers from two zones. In this case the ModbusAddress
attribute specifies the border between such two zones.

This element enables support of advanced dynamic "CM40


labeling for ION registers. One of the specific use cases is 00
specifying "downstream devices" as sources for historical Input
data logged on the devices. This element supports flexible Meterin
schema for building register labels based on device g
configuration. It has the following attributes: Support
EnumOrdinalHandle, EnumName, DeviceLabelHandle, .ppt"
DeviceLabelTrigger, ActiveFormat, and InactiveFormat. and
Document "Design.DynamicLabels [Input Metering].doc" "Design
provides detailed description for the dynamic labeling .Dynam
teqnique. icLabels
[Input
Meterin
g].doc"
at
\\pan.c
anada.c
orp.po
werme
asurem
ent.co
m\Proj
ects\20
08\ION-
E_Devic
e_Drive
rs_2\De
sign
This attribute can be added to one or more ModbusInfo n/a
elements and specifies which register or registers will be
used by Site Server to determine if the device is still
communicating. If more that one ModbusInfo element has
a Ping attribute set one of the registers will be used
(decision is semi-random, usually the first in the list is
chosen)
Examples

<DeviceInfo GlobalNotAvailable="AllBitsSet"/>

<DeviceInfo Type="MicrologicA" MaxRequestRegisters="20" />

<DeviceInfo GlobalNotAvailable="AllBitsSet"/>

<DeviceInfo Type="Sepam80" MDISupported="2" />


<DeviceInfo Type="MicrologicA" MultiplePresetSupported="1" MDISupported="0" ScatteredReadSupported="1" />

<DeviceInfo Type="MicrologicA" MultiplePresetSupported="1" MDISupported="0" ScatteredReadSupported="1" />

<DeviceInfo Type="MicrologicA" EthernetSupport="0" MDISupported="0" ScatteredReadSupported="1" />

<DeviceInfo Type="MicrologicA" LowSpeedUpdateRate="150" HighSpeedUpdateRate="150" DateTimeValidation="1" />

<DeviceInfo Type="MicrologicA" LowSpeedUpdateRate="150" HighSpeedUpdateRate="150" DateTimeValidation="1" />

<DeviceInfo Type="MicrologicA" MultiplePresetSupported="1" DateTimeValidation="1" />


<ModbusInfo IONHandle="4867" Name="FAC1 Revision" ModbusAddress="403014" RequestType="R" Format="UINT16"/>
cm3: <ModbusInfo IONHandle="176161819" Name="V2 THD N1 Eval This Interval" ModbusAddress="438280p9" RequestType
Sepam: <ModbusInfo IONHandle="140511237" Name="ANSI 27 Unit 1 - Enabled" ModbusAddress="1001s1" RequestType="R
Micrologic <ModbusInfo IONHandle="23694" Name="CCM Firmware Revision" ModbusAddress="50:400577" RequestType="R

<ModbusInfo IONHandle="4867" Name="FAC1 Revision" ModbusAddress="403014" RequestType="R" Format="UINT16"/>

<ModbusInfo IONHandle="4867" Name="FAC1 Revision" ModbusAddress="403014" RequestType="R" Format="UINT16"/>

<ModbusInfo IONHandle="16024" Name="CL1 Month" ModbusAddress="403034" RequestType="R" Format="UINT16" Mask

<ModbusInfo IONHandle="16024" Name="CL1 Month" ModbusAddress="403034" RequestType="R" Format="UINT16" Mask


<ModbusInfo IONHandle="161480705" Name="Current Avg" ModbusAddress="401105" RequestType="R" Format="SINT16" M

<ModbusInfo IONHandle="4864" Name="FAC1 DeviceType" ModbusAddress="403010" RequestType="R" Format="UINT16" O


<ModbusInfo IONHandle="168822273" Name="Power Factor A" ModbusAddress="401160" RequestType="R" Format="S16-1-
<ModbusInfo IONHandle="168822273" Name="Power Factor A" ModbusAddress="401160" RequestType="R" Format="S16-1-
<ModbusInfo IONHandle="168822273" Name="Power Factor A" ModbusAddress="401160" RequestType="R" Format="S16-1-
<ModbusInfo IONHandle="168822273" Name="Power Factor A" ModbusAddress="401160" RequestType="R" Format="S16-1-
<ModbusInfo IONHandle="143655432" Name="V2 Latching Alarm Reset" ModbusAddress="400242" RequestType="W" Forma

<ModbusInfo IONHandle="167788289" Name="Label" ModbusAddress="403000" RequestType="R" Format="ASCII" NumberO

<ModbusInfo IONHandle="162541569" Name="Peak Demand Current B Date Time" ModbusAddress="401974" RequestType=

<ModbusInfo IONHandle="26834" Name="100ms Data Log Reset" ModbusAddress="408000" RequestType="CW" Format="U1

<ModbusInfo IONHandle="26834" Name="100ms Data Log Reset" ModbusAddress="408000" RequestType="CW" Format="U1


<ModbusInfo IONHandle="174064897" Name="Current A Additional" ModbusAddress="400607" RequestType="R" Format="
<ConfigValues Ordinal="0" Value="-NA-"/>
</ModbusInfo>

<ModbusInfo IONHandle="164628993" Name="Demand Apparent Power" ModbusAddress="200:402236" RequestType="R" F


<ConfigLabels Ordinal="0" Value="Demand Apparent Power - Sliding"/>
<ConfigLabels Ordinal="1" Value="Demand Apparent Power - Thermal"/>
<ConfigLabels Ordinal="2" Value="Demand Apparent Power - Sliding"/>
<ConfigLabels Ordinal="5" Value="Demand Apparent Power - Sliding"/>
</ModbusInfo>
<ModbusInfo IONHandle="29251" Name="1025 Reverse Power Dropout Value" ModbusAddress="100:409744" RequestType=

<ModbusInfo IONHandle="176161539" Name="Supply Voltage Dips" ModbusAddress="403920" RequestType="R" Format="In

<ModbusInfo IONHandle="30131" Name="FAC1 T Config" ModbusAddress="403100" RequestType="R" Format="UINT16" De


<Enumeration Ordinal="1" Value="0"/>
<Enumeration Ordinal="2" Value="0"/>
<Enumeration Ordinal="3" Value="100"/>
</ModbusInfo>
<ModbusInfo IONHandle="4867" Name="FAC1 Revision" ModbusAddress="400003" RequestType="R" Format="U16-21" Cach

<ModbusInfo IONHandle="2669" Name="Alarm Register Change Counter" ModbusAddress="410056" RequestType="R" Form

<ModbusInfo IONHandle="26800" Name="Peak Demand Current Reset" ModbusAddress="0:407720" RequestType="W" Form

<EnumInfo Name="NoYes12">
<Option Ordinal="1" Value="No"/>
<Option Ordinal="2" Value="Yes"/>
</EnumInfo>
<ModbusInfo IONHandle="141558017" Name="Transformer Presence" ModbusAddress="D003s1" RequestType="R" Format="
<Diagnostics EnableTrace="1"/>

<ModbusInfo IONHandle="141558017" Name="Transformer Presence" ModbusAddress="D003s1" RequestType="R" Format="

<CalcInfo IONHandle="135266304" Name="Data Rec 1" Function="DataRecorder_Module"/>

<EnumInfo Name="NoYes12">
<Option Ordinal="1" Value="No"/>
<Option Ordinal="2" Value="Yes"/>
</EnumInfo>
<ModbusInfo IONHandle="141558017" Name="Transformer Presence" ModbusAddress="D003s1" RequestType="R" Format="
<TransactionConfiguration DiagnosticFlags="3">
<DatasetAddressBlock ModbusAddress="408754" NumberOfRegisters="10"/>
<InvalidAddressRange ModbusAddress="400294" NumberOfRegisters="2"/>
</TransactionConfiguration>

<HandleExclusionList IONHandle="148897792" ConfigIONHandle="153093121"/>


<DatasetAddressBlock ModbusAddress="408754" NumberOfRegisters="10"/>

<InvalidAddressRange ModbusAddress="400294" NumberOfRegisters="2"/>

<DynamicLabel EnumOrdinalHandle="180355085" EnumName="UnitsCode" DeviceLabelHandle="180355083" DeviceLabelTri


<EnumInfo Name="UnitsCode" DefaultEnumValue=" ">
<Option Ordinal="0" Value="No Units"/>
<Option Ordinal="11" Value="W"/>
<Option Ordinal="12" Value="kW"/>
</EnumInfo>
<ModbusInfo IONHandle="4867" Name="FAC1 Revision" ModbusAddress="403014" Ping="1" RequestType="R" Format="UIN
Name Description
S16-21 16-bit signed value in 2-1 (or big ENDIAN) format. The high order byte is first,
the low-order byte second
U16-21 16-bit unsigned value in 2-1 (or big ENDIAN) format. The high order byte is first,
the low-order byte second
S16-12 16-bit signed value in 2-1 (or small ENDIAN) format. The high order byte is
second, the low-order byte first
U16-12 16-bit unsigned value in 2-1 (or small ENDIAN) format. The high order byte is
second, the low-order byte first
S32-4321 (The same as SINT32) is a 32-bit signed value returned in two consecutive 16-bit
registers. The high-order word is returned in the first register, the low order
word in the second. In effect, the 4 bytes are returned in 4-3-2-1 (or big
ENDIAN) format.

U32-4321 (The same as UINT32) is a 32-bit unsigned value returned in two consecutive 16-
bit registers. The high-order word is returned in the first register, the low-order
word in the second. In effect, the 4 bytes are returned in 4-3-2-1 (or big
ENDIAN) format

S32-2143 32-bit signed value returned in two consecutive 16-bit registers. Contrary to
S32_4321, the high-order word is returned in the second register, the high-order
word in the first. In effect, the 4 bytes are returned in 2-1-4-3 format
U32-2143 32-bit unsigned value returned in two consecutive 16-bit registers. Contrary to
U32_4321, the high-order word is returned in the second register, the low-order
word in the first. In effect, the 4 bytes are returned in 2-1-4-3 format
S32-M10k-4321 (The same as S32-MFP) is a 32-bit signed value returned in two consecutive 16-
bit registers. The word stored in the first 16-bit register is multiplied by 10000
and added to the word stored in the second 16-bit register. Also known as
‘signed Modulo 10000’

U32-M10k-4321 (The same as U32-MFP) is a 32-bit unsigned value returned in two consecutive
16-bit registers. The word stored in the first 16-bit register is multiplied by
10000 and added to the word stored in the second 16-bit register. Also known
as ‘unsigned Modulo 10000’

S32-M10k-2143 32-bit signed value returned in two consecutive 16-bit registers. Contrary to
S32_M10k_4321, the word stored in the second 16-bit register is multiplied by
10000 and added to the word stored in the first 16-bit register
U32-M10k-2143 32-bit unsigned value returned in two consecutive 16-bit registers. Contrary to
U32_M10k_4321, the word stored in the second 16-bit register is multiplied by
10000 and added to the word stored in the first 16-bit register
F32-4321 (The same as IEEEFloat) is a 32-bit IEEE floating point value returned in two
consecutive 16-bit registers. The high-order word is returned in the first register
and the low order word in the second. In effect, the 4 bytes are returned in 4-3-
2-1 format

F32-2143 (The same as SwappedFloat) is a 32-bit IEEE floating point value returned in two
consecutive 16-bit registers. Contrary to F32_4321, the high-order word is
returned in the second register and the low order word in the first. In effect, the
4 bytes are returned in 2-1-4-3 format
F64-87-21 64-bit IEEE floating point value returned in four consecutive 16-bit registers. The
high-order word is returned in the first register and the low order word in the
last.
F64-12-78 64-bit value similar to IEEE floating point value returned in four consecutive 16-
bit registers, where registers follow in the reverse order.
S32-MFP (The same as S32-M10k-4321) is a 32-bit signed value returned in two
consecutive 16-bit registers. The word stored in the first 16-bit register is
multiplied by 10000 and added to the word stored in the second 16-bit register.
Also known as ‘signed Modulo 10000’

U32-MFP (The same as U32-M10k-4321) is a 32-bit unsigned value returned in two


consecutive 16-bit registers. The word stored in the first 16-bit register is
multiplied by 10000 and added to the word stored in the second 16-bit register.
Also known as ‘unsigned Modulo 10000’

IEEEFloat (The same as F32-4321) is a 32-bit IEEE floating point value returned in two
consecutive 16-bit registers. The high-order word is returned in the first register
and the low order word in the second. In effect, the 4 bytes are returned in 4-3-
2-1 format

SwappedFloat (The same as F32-2143) is a 32-bit IEEE floating point value returned in two
consecutive 16-bit registers. Contrary to F32_4321, the high-order word is
returned in the second register and the low order word in the first. In effect, the
4 bytes are returned in 2-1-4-3 format

PackedBool (The same as MaskedBool) is a 16-bit value that is interpreted according to the
bit pattern described by the Mask attribute (see below). Bits exposed by the
mask can be read or written without affecting the value of other bits. The value
that is read or written is determined by using enumeration ordinals, described
below. If used for read-only boolean data, enumerations are not required If no
mask is specified, all bits are relevant

MaskedBool (The same as PackedBool) is a 16-bit value that is interpreted according to the
bit pattern described by the Mask attribute (see below). Bits exposed by the
mask can be read or written without affecting the value of other bits. The value
that is read or written is determined by using enumeration ordinals, described
below. If used for read-only boolean data, enumerations are not required If no
mask is specified, all bits are relevant

InvertedMaskedBool Is similar to the MaskedBool format except that it is subject to the logical NOT
operation applied to the resulting Boolean value.
SINT16 16-bit signed value in 2-1 (or big ENDIAN) format. The high order byte is first,
the low-order byte second
UINT16 16-bit unsigned value in 2-1 (or big ENDIAN) format. The high order byte is first,
the low-order byte second
SINT32 (The same as S32-4321) is a 32-bit signed value returned in two consecutive 16-
bit registers. The high-order word is returned in the first register, the low order
word in the second. In effect, the 4 bytes are returned in 4-3-2-1 (or big
ENDIAN) format.

UINT32 (The same as U32-4321) is a 32-bit unsigned value returned in two consecutive
16-bit registers. The high-order word is returned in the first register, the low-
order word in the second. In effect, the 4 bytes are returned in 4-3-2-1 (or big
ENDIAN) format
S64-M10k-21-87 64-bit signed value returned in four consecutive 16-bit registers. R4*10,000^3 +
R3*10,000^2 + R2*10,000 + R1, where R4 is the last register and R1 is the first
register. Each registers range is -9,999 to +9,999
U64-M10k-21-87 64-bit unsigned value returned in four consecutive 16-bit registers.
R4*10,000^3 + R3*10,000^2 + R2*10,000 + R1, where R4 is the last register and
R1 is the first register. Each registers range is 0 to +9,999
S48-M10k-21-65 48-bit signed value returned in four consecutive 16-bit registers. R3*10,000^2 +
R2*10,000 + R1, where R3 is the last register and R1 is the first register. Each
registers range is -9,999 to +9,999
U48-M10k-21-65 48-bit unsigned value returned in four consecutive 16-bit registers.
R3*10,000^2 + R2*10,000 + R1, where R3 is the last register and R1 is the first
register. Each registers range is 0 to +9,999
S64-87-21 64-bit signed value returned in four consecutive 16-bit registers. The highest
order word is returned in the first register, the lowest order word in the fourth.
In effect, the 8 bytes are returned in 8-7-6-5-4-3-2-1 (or big ENDIAN) format

U64-87-21 64-bit unsigned value returned in four consecutive 16-bit registers. The highest
order word is returned in the first register, the lowest order word in the fourth.
In effect, the 8 bytes are returned in 8-7-6-5-4-3-2-1 (or big ENDIAN) format

S64-21-87 64-bit signed value returned in four consecutive 16-bit registers. The highest
order word is returned in the fourth register, the lowest order word in the first.
In effect, the 8 bytes are returned in 2-1-4-3-6-5-8-7 (or little ENDIAN) format

U64-21-87 64-bit unsigned value returned in four consecutive 16-bit registers. The highest
order word is returned in the fourth register, the lowest order word in the first.
In effect, the 8 bytes are returned in 2-1-4-3-6-5-8-7 (or little ENDIAN) format

S16-1-15 16 bit signed value. Bits 1 to 15 bits are unsigned data. If bit 16 is 0 the value is
positive, if bit 16 is 1 the value is negative
PF-Nexus 16 bit unsigned value, range 0 to 3999, representing 3 decimal places of
accuracy. It used for Power Factor values. The following table demonstrates the
conversion of values from 16-bit register values to the Power Factor data.
Hex Value - Decimal Value - Power Factor
000
3E7 999 0.999
3E8 1000 1.000
7CF 1999 0.001
7D0 2000 0.000
BB7 2999 -0.999
BB8 3000 -1.000
F9F 3999 -0.001

BCD Binary Coded Decimal (BCD) is a number that is expressed as a sequence of


decimal digits and then each decimal digit is encoded as an 8-bit binary number
E.g. decimal 92 would be encoded as 00001001 00000010. Length of the
registers sequence is specified by the NumberOfRegisters attribute.
PackedBCD Packed Binary Coded Decimal (BCD) - a number is expressed as a sequence of
decimal digits and then each decimal digit is encoded as an 4-bit binary number
(nibble) E.g. decimal 92 would be encoded as 1001 0010. Length of the registers
sequence is specified by the NumberOfRegisters attribute.

ASCII Sequence of bytes representing the ASCII character set. Each word stores 2
ASCII characters. Trailing spaces will be removed. Number of registers
containing the the string is specified by the NumberOfRegisters attribute.
ASCII-Reverse Sequence of bytes representing the ASCII character set. Each word stores 2
ASCII characters in the reversed order. Trailing spaces will be removed. Number
of registers containing the the string is specified by the NumberOfRegisters
attribute.

DateTime4_UTC 4-register compressed format. (Year 2001 is represented as 101 in the year
byte.)
Register 0:Hi Byte = Month (1 – 12) ; Register 0:Lo Byte = Day (1 – 31)
Register 1:Hi Byte = Year (0 – 199) ; Register 1:Lo Byte = Hour (0 – 23)
Register 2:Hi Byte = Minute (0 – 59) ; Register 2:Lo Byte = Second (0 – 59)
Register 3 = Millisecond
This format does not require the translator to convert the value into the UTC
time as it is already provided in the UTC time.

DateTime3_UTC 3-register compressed format. (Year 2001 is represented as 101 in the year
byte.)
Register 0:Hi Byte = Month (1 – 12) ; Register 0:Lo Byte = Day (1 – 31)
Register 1:Hi Byte = Year (0 – 199) ; Register 1:Lo Byte = Hour (0 – 23)
Register 2:Hi Byte = Minute (0 – 59) ; Register 2:Lo Byte = Second (0 – 59)
This format does not require the translator to convert the value into the UTC
time as it is already provided in the UTC time.

DateTime4_LOCAL 4-register compressed format. (Year 2001 is represented as 101 in the year
byte.)
Register 0:Hi Byte = Month (1 – 12) ; Register 0:Lo Byte = Day (1 – 31)
Register 1:Hi Byte = Year (0 – 199) ; Register 1:Lo Byte = Hour (0 – 23)
Register 2:Hi Byte = Minute (0 – 59) ; Register 2:Lo Byte = Second (0 – 59)
Register 3 = Millisecond
This format represents time as the local time. Thus the transltor will be
converting it to the UTC time using the site server time zone information.

DateTime3_LOCAL 3-register compressed format. (Year 2001 is represented as 101 in the year
byte.)
Register 0:Hi Byte = Month (1 – 12) ; Register 0:Lo Byte = Day (1 – 31)
Register 1:Hi Byte = Year (0 – 199) ; Register 1:Lo Byte = Hour (0 – 23)
Register 2:Hi Byte = Minute (0 – 59) ; Register 2:Lo Byte = Second (0 – 59)
This format represents time as the local time. Thus the transltor will be
converting it to the UTC time using the site server time zone information.
DateTime_YMDhms_UTC 3-register compressed format. (Year 2001 is represented as 101 in the year
byte.)
Register 0:Hi Byte = Month (1 – 12) ; Register 0:Lo Byte = Day (1 – 31)
Register 1:Hi Byte = Year (0 – 199) ; Register 1:Lo Byte = Hour (0 – 23)
Register 2:Hi Byte = Minute (0 – 59) ; Register 2:Lo Byte = Second (0 – 59)
This format does not require the translator to convert the value into the UTC
time as it is already provided in the UTC time.

DateTime_YMDhms_LOCAL 3-register compressed format. (Year 2001 is represented as 101 in the year
byte.)
Register 0:Hi Byte = Month (1 – 12) ; Register 0:Lo Byte = Day (1 – 31)
Register 1:Hi Byte = Year (0 – 199) ; Register 1:Lo Byte = Hour (0 – 23)
Register 2:Hi Byte = Minute (0 – 59) ; Register 2:Lo Byte = Second (0 – 59)
This format represents time as the local time. Thus the transltor will be
converting it to the UTC time using the site server time zone information.

DateTime_NSX2_UTC Date-time value represented as number of seconds from Jan 1/2000. This format
does not require the translator to convert the value into the UTC time as it is
already provided in the UTC time.
DateTime_NSX2_LOCAL Date-time value represented as number of seconds from Jan 1/2000. This format
represents time as the local time. Thus the transltor will be converting it to the
UTC time using the site server time zone information.
DateTime_NSX3_UTC Date-time value encoded in 3 16-bit registers. The first two registers represent
number of seconds from Jan 1/2000. The third register provides number of
milliseconds. This format does not require the translator to convert the value
into the UTC time as it is already provided in the UTC time.

DateTime_NSX3_LOCAL Date-time value encoded in 3 16-bit registers. The first two registers represent
number of seconds from Jan 1/2000. The third register provides number of
milliseconds. This format represents time as the local time. Thus the transltor
will be converting it to the UTC time using the site server time zone information.

DateTime_IEC870_UTC 4-register compressed format.


Register 0: b0-b6: Year (0 - 127); b7-b15: Reserved
Register 1: b0-b4: Day (1-31); b5-b7: Weekday (1-7, 0 if not used)
b8-b11: Month (1-12); b12-b15: Reserved
Register 2: b0-b5: Minutes (0-59) b6: Reserved
b7: Time synchronization quality, 1 = non valid or non
synchronization;
b8-b12: Hour (0-23); b13-b14: Reserved
b15: 0 = Standard time, 1 = Daylight Savings Time
Register 3: b0-b15: Millisecond (0 - 59999)
This format does not require the translator to convert the value into the UTC
time as it is already provided in the UTC time.
DateTime_IEC870_LOCAL 4-register compressed format.
Register 0: b0-b6: Year (0 - 127); b7-b15: Reserved
Register 1: b0-b4: Day (1-31); b5-b7: Weekday (1-7, 0 if not used)
b8-b11: Month (1-12); b12-b15: Reserved
Register 2: b0-b5: Minutes (0-59) b6: Reserved
b7: Time synchronization quality, 1 = non valid or non
synchronization;
b8-b12: Hour (0-23); b13-b14: Reserved
b15: 0 = Standard time, 1 = Daylight Savings Time
Register 3: b0-b15: Millisecond (0 - 59999)
This format represents time as the local time. Thus the transltor will be
converting it to the UTC time using the site server time zone information.

DateTime3_IEC870_UTC 4-register compressed format without milisecond.


Register 0: b0-b6: Year (0 - 127); b7-b15: Reserved
Register 1: b0-b4: Day (1-31); b5-b7: Weekday (1-7, 0 if not used)
b8-b11: Month (1-12); b12-b15: Reserved
Register 2: b0-b5: Minutes (0-59) b6: Reserved
b7: Time synchronization quality, 1 = non valid or non
synchronization;
b8-b12: Hour (0-23); b13-b14: Reserved
b15: 0 = Standard time, 1 = Daylight Savings Time
Register 3: b0-b15: Millisecond (0 - 59999) - Here Only Seconds will be filtered
This format does not require the translator to convert the value into the UTC
time as it is already provided in the UTC time.

DateTime3_IEC870_LOCAL 4-register compressed format without milisecond.


Register 0: b0-b6: Year (0 - 127); b7-b15: Reserved
Register 1: b0-b4: Day (1-31); b5-b7: Weekday (1-7, 0 if not used)
b8-b11: Month (1-12); b12-b15: Reserved
Register 2: b0-b5: Minutes (0-59) b6: Reserved
b7: Time synchronization quality, 1 = non valid or non
synchronization;
b8-b12: Hour (0-23); b13-b14: Reserved
b15: 0 = Standard time, 1 = Daylight Savings Time
Register 3: b0-b15: Millisecond (0 - 59999) - Here Only Seconds will be filtered
This format represents time as the local time. Thus the transltor will be
converting it to the UTC time using the site server time zone information.

U16-21-ARRAY Array of 16-bit signed values in 2-1 (or big ENDIAN) format. The high order byte
of each element is first, the low-order byte second. Length of the array is
specified by the NumberOfRegisters attribute.
U16-12-ARRAY Array of 16-bit signed values in 1-2 (or small ENDIAN) format. The high order
byte of each element is secont, the low-order byte first. Length of the array is
specified by the NumberOfRegisters attribute.
PF_ALT True Power Factor format specific for CM devices
Negative power factor is represented by 0-1000 (indicating 0-100% or in IEEE
format 0-1 lagging)
Positive power factor is represented by 1000-2000 (indicating 100%-0 or in IEEE
mode 1-0 leading).

PF32 True Power Factor format


Lagging power factor is represented by 0 to 1 and 0 to (-1)
Leading power factor is represented by 1 to 2 and (-1) to (-2)

DeviceSpecific01 - These formats can be re-used in Device Drivers for those Modbus data types
DeviceSpecific16 that do not need to be known for other device types. This will allow dPack
drivers with unknown formats to be installed on the system without need of
modifying master Modbus schema definition file.
Source code snippet
if (us < 1000)
{
value = us / -1000.;
}
else if (us < 3000)
{
value = (2000 - us) / 1000.;
}
else if (us < 4000)
{
value = (4000 - us) / 1000.;
}
mt.tm_year = bytes[0]-1900;
mt.tm_mon = bytes[1]-1;
mt.tm_mday = bytes[2];
mt.tm_hour = bytes[3];
mt.tm_min = bytes[4];
mt.tm_sec = bytes[5];
if (us < 1000) // lagging
{
value = us * -0.1;
return avail;
}
if (us >= 1000) // leading
{
value = (2000 - us) * 0.1;
return avail;
}
if(value < -1 && value >= -2) //Check if PF
value falls in 2-nd quadrant
value = -2 - value
else if(value > 1 && value <= 2) //Check if
PF value falls in 4-th quadrant
value = 2 - value;

You might also like