Each element of the array can be accessed by symbolic name, as shown below. In this
example, a new value is moved into the second element of the array which corresponds to
Modbus address 40002.
Each of the words in the array, as defined in the data block, provides the MB_SLAVE
instruction with Modbus holding register addresses. In this instance, since there are only 10
elements in the array, there are only 10 available Modbus holding register addresses usable
by this MB_SLAVE instruction and accessible by a Modbus master.
The correlation of the array element names to Modbus addresses is shown below.
"HR_DB".Array[1]
" HR_DB ". Array[2]
" HR_DB ". Array[3]
...
" HR_DB ". Array[9]
" HR_DB ".Array [10]
Example 2 - Named word structure
This example holding register is a series of words with descriptive symbolic names.
Advantages:
Disadvantages:
This is how a named word structure would appear in the data block editor. Each element has
a unique name and can be a WORD, UINT, or INT.
S7-1200 Programmable controller
System Manual, 11/2009, A5E02486680-02
Each structure element has a descriptive name with a specific data
type assigned to it.
It takes longer to create this type of structure than the standard
array of words.
The elements require additional symbolic referencing when used in
a user program. Where the first element of the simple array is
referenced as "HR_DB".Array[0] the first element of this type is
referenced "HR_DB".Data.Temp_1.
Programming instructions
6.3 Global library instructions
Modbus address 40001
Modbus address 40002
Modbus address 40003
...
Modbus address 40009
Modbus address 40010
203