How-to
Mapping Weintek BACnet values into a CODESYS program
Short answer
EasyBuilder Pro does not import BACnet objects as CODESYS variables. Decide where the logic runs: on the panel's built-in CODESYS runtime, reach the variables through a Modbus Gateway over MODBUS TCP/IP (EasyBuilder Pro V6.00.02 or later on cMT X Series), or copy the BACnet-backed registers into a separate CODESYS PLC with Data Transfer objects. Prove one value end to end before mapping the rest.

On this page
Nothing in EasyBuilder Pro turns a BACnet object into a CODESYS variable, which is why the tags never appear in the program no matter how carefully the BACnet server side is configured. Map the path by hand: when the logic runs on the panel's built-in CODESYS runtime, expose its variables through a Modbus Gateway; when it runs on a separate CODESYS PLC, copy the BACnet-backed registers into the PLC tags with Data Transfer objects. The setup behind this article is a cMT2058XH on EasyBuilder Pro 6.10.01, already configured as a BACnet server. The decision is the same on any cMT project: identify which runtime executes the logic first, because that choice alone picks the transfer mechanism.
Decide which runtime holds the logic #
Both paths move the same values; they differ in where the CODESYS application executes.
The built-in CODESYS runtime on the panel #
A cMT X Series panel such as the cMT2058XH can run the CODESYS application on the panel itself. The manufacturer's cMT X Series + CODESYS datasheet names that runtime CODESYS Control for Embedded Systems, documents MODBUS TCP/IP as the protocol between the EasyBuilder Pro project and the runtime, and sets a minimum EasyBuilder Pro build of V6.00.02 for the feature (the worked example below checks one install against it). On this architecture you set up a Modbus Gateway to reach the CODESYS tags and carry data between the HMI project and the runtime on the same panel; MODBUS TCP/IP runs on its registered port 502 unless you deliberately move it.
A separate CODESYS PLC #
When the program runs on its own CODESYS PLC, the panel stays the BACnet server and Data Transfer objects do the copying: they read the BACnet-backed registers on the panel and write the matching tags on the PLC. No gateway is involved, and the HMI-to-PLC connection becomes its own item to verify.
Record the BACnet source before mapping anything #
The BACnet server setup itself follows the manufacturer's BACnet document, and the object manual flags these BACnet features for cMT panels. Before any mapping, write down, for every value the program needs: the object the panel serves, the HMI-side register or tag that backs it, the data type, and whether the program reads it, writes it, or both. Keep the list to what the logic actually uses; every extra point is another address pair to get wrong.
When the program must push a value onto the BACnet network instead of reading one, the write side lives in the same tag space, and the analog output dimmer walkthrough shows one complete write path: configuring an HMI analog output dimmer over BACnet/IP.
Map into the built-in runtime with a Modbus Gateway #
- List the BACnet-backed values the program needs and record, for each one, the served object, the backing HMI register or tag, and the data type.
- Declare the matching variables in the CODESYS project with deliberate types: a 16-bit integer destination silently truncates a REAL, and a BOOL is not a WORD.
- Set up the Modbus Gateway and give each CODESYS variable a defined Modbus address. MODBUS TCP/IP is the documented protocol between the EasyBuilder Pro project and CODESYS Control for Embedded Systems, so both ends speak standard Modbus TCP on port 502.
- Map each BACnet-backed HMI tag to the gateway address that carries its CODESYS variable, and keep read and write pairs separate and written down.
- Download both sides, the CODESYS application from the CODESYS development environment and the EasyBuilder Pro project, and confirm the runtime is running before you judge any value.
Map into a separate CODESYS PLC with Data Transfer objects #
- Create or verify the EasyBuilder Pro connection to the CODESYS PLC. If the connection itself is refused rather than the transfer, the usual culprit is encryption on the PLC side: why a CODESYS V3 HMI connection fails an encrypted PLC covers that case.
- Create the destination tags in the PLC project and expose them on the path the HMI connection uses.
- Add one Data Transfer object per block of values: source is the BACnet-backed HMI register, destination is the PLC tag, and the word count and data type match on both sides. A 32-bit REAL needs two words on each end; never copy it into a single-word destination.
- Set the execution condition: periodic execution for live process values, event- or condition-triggered execution only where the process genuinely calls for it.
- Download both sides and prove one point before you duplicate the pattern across the rest of the list.
Worked example: a cMT2058XH project on EasyBuilder Pro 6.10.01 #
Inputs, each with its source:
- Panel: cMT2058XH, a cMT X Series model (the setup being configured).
- Installed build: EasyBuilder Pro 6.10.01 (the setup being configured).
- Documented minimum for the built-in CODESYS feature: V6.00.02 (the manufacturer's cMT X Series + CODESYS datasheet).
The rule, in words: a version floor is compared left to right, the first position where the two builds differ decides, and every position after it is ignored.
The arithmetic:
- Major position: 6 against 6, equal, so move right.
- Minor position: 10 against 00, and 10 is the larger, so the comparison ends here and the trailing build digits are never consulted.
Result: 6.10.01 is later than V6.00.02, so the built-in CODESYS feature exists on this install.
Decision: configure the Modbus Gateway path now. Any build below V6.00.02 gets updated first, because the built-in CODESYS integration is not documented before that release. The floor gates the built-in feature; 6.10.01 clears it with margin at the minor position.
Verify one value end to end #
Map one point before the whole list, and test it with values you can afford to change: a mapping that writes to a wrong address acts on the process, not on the screen. Pick a value you can recognize immediately, then follow it through all four stops: the BACnet object on the panel, the HMI-side register that backs it, the gateway address or transfer destination, and the CODESYS variable watched online in the development environment. Repeat the test at zero, at a normal operating value, and at one value that exposes a sign or scaling error.
For screens alone, system register LB-12358 switches a downloaded project into off-line simulation mode on the panel, so you can exercise the mapping screens before the live runtimes are in place on both ends.
Then triage by symptom:
- The source moves and the destination does not: the transfer is not executing. Check its trigger condition first, then the connection. When reads stall against a Modbus server listening on a moved port such as port 8000, why a Modbus server on port 8000 causes HMI client read timeouts is the pattern to compare against.
- The destination moves to the wrong number: connectivity is fine. Check data type, word width, signedness and word order on both ends.
- The CODESYS variable is right but the logic ignores it: the transport path has already passed. Trace variable scope and program logic.
- The panel shows question marks instead of numbers: the value path is timing out, and why HMI values show question marks when PLC communications time out walks that failure mode.
Questions asked
Does every Weintek panel have the built-in CODESYS runtime?
No. The built-in runtime, CODESYS Control for Embedded Systems, is documented for cMT X Series panels with EasyBuilder Pro V6.00.02 or later, talking MODBUS TCP/IP. Check the CODESYS datasheet for your exact model before planning the Modbus Gateway path; a panel without the built-in runtime leaves the Data Transfer route to an external CODESYS PLC as the only option.
How can I bench-test the screens before a live download?
Set system register LB-12358 to switch a downloaded project into off-line simulation mode on the panel. That exercises the screens and HMI-side logic without live tags, so use it to confirm the BACnet source and the mapping screens behave before you commit. The Modbus Gateway and Data Transfer paths still need the real runtimes on both ends to prove the destination variables.
Which port does the Modbus Gateway path use?
MODBUS TCP/IP uses its registered port 502, so the built-in runtime path runs there unless a configuration deliberately moves it. When a Modbus server has been moved to a nonstandard port, clients report read timeouts rather than clean failures, so check the port on both ends whenever mapped values stall partway through a test.
Can the CODESYS program write a value back to the BACnet network?
Yes, but only by configuration: build the reverse mapping the same way as the read path, and confirm the BACnet object accepts writes from the panel. A working read never proves the write direction, so exercise the return path on the bench with a value you can afford to change, then watch the object from a second BACnet client if one is available.


