我們的品牌

Impact-Company-Logo-English Black-01-177x54

歡迎造訪施耐德電機全球網站

歡迎訪問我們的網站
		
我们今天能为您提供什么帮助?
How to give an address to variables that are part of an structure in EcoStruxure Machine Expert?

Issue:

This FAQ provides an alternative for assigning addresses to variables that are part of a structure in EcoStruxure Machine Expert, as this process is not intuitive.

Additionally, this FAQ includes an example illustrating the relationship between different memory types (e.g., %MLx, %MBx, %MWx, %MDx, %MXx).

This information is useful when using the Modbus TCP protocol to read tags from an M241, M251, or M262 controller and share them with another device (e.g., SCADA, HMI, PLC).

Product:

EcoStruxure Machine Expert (previously SoMachine)

Environment:

PLC Configuration Software in Windows

Resolution:

When using Modbus TCP, you must assign an address to the variables. If you are working with structures, follow the steps below:

a. Create a structure and calculate its size in bytes.

b. In Machine Expert, use %MLx to address structures. This memory type occupies 8 bytes.

Depending on the structure size, you must leave enough space between instances to avoid overlap (unfortunately, this must be done manually).

In this example:

  • %ML0 starts at %MB0 (Memory Byte).
  • %ML3 starts at %MB24.

This spacing ensures all tags fit properly.

c. Create a tag for each element of the structure instance and assign an address using %MWx (INT/WORD), %MXx (BOOL/Bit), or %MDx (REAL), depending on the data type.

d. Validation.

In this example:

a. Structure GateOC is create that consist of 17 bytes.

1

Note: 6 INT (2 bytes each) + 2 BOOL (1 bit each, so 1 byte is required) + 1 REAL (4 bytes) = 17 bytes

b. Create each structure instance and assign it a %MLx address, leaving enough space to prevent overlapping.

2

c. Create a set of tags for each instance, in the picture below a set of tags was created for instance CokRecLg1TpGt.

3

Note: Not all tags use %MWx, but the comments show the relationship between %MXx and %MDx with the %MWx memory type.

d. Validation.

Each color represents a different case, and in the end, everything aligns. Yellow is consistent across all three representations, as are sky blue and purple.

4

For the REAL tag:

WORD 1 = 33,554 (lower 16 bits)

WORD 2 = 16,288 (upper 16 bits)

REAL ≈ 1.254

Unfortunately, this is the only way to assign addresses to tags inside a structure in Machine Expert. It is a manual process, and you must maintain proper order to ensure tags do not overlap

施耐德電機Taiwan

探索更多
系列:
探索更多
系列:
  • 產品文檔
  • 軟體下載
  • 產品選型工具
  • 產品替代和替換
  • 幫助和聯絡中心
  • 尋找我們的辦公室
  • 取得報價
  • 施耐德電機社群
  • 人才招募
  • 公司簡介
  • 舉報不當行為
  • 無障礙
  • 新聞中心
  • 投資者
  • 專業洞察
  • 台灣施耐德電機學院
  • 綠色影響力落差調查
  • Schneider Go Green 2025
  • 隱私政策
  • Cookie通告
  • 使用條款
  • Change your cookie settings