Troubleshooting
PLCnext MQTT client ENO false: readiness before broker checks
Short answer
A false ENO on the PLCnext MQTT client function block means the client instance is not ready for method calls; it is not a verdict on broker credentials or the network. Keep EN true across scans until ENO turns true, issue Connect once per attempt, then verify the same-subnet path and the TCP connection before blaming authentication.
On this page
A false ENO on the PLCnext MQTT client function block is a readiness report, not a broker verdict. It means the client instance has not finished initializing, so it refuses method calls — Connect included. At that moment nothing has been sent to the broker, and no username, password, or port has been tested. The fix is sequencing: keep EN true across scans, wait until ENO turns true, and issue Connect once per attempt. Only after that do the Ethernet path and the TCP connection to the broker tell you anything. The case here is an AXC 2152 on runtime v2021_0_5 with PLCnext Engineer 2021.3, using the MQTT blocks from IIoT_library_2.
ENO false is a readiness report #
While ENO is false the block refuses method calls; that is all the output says. It cannot distinguish a wrong password from a missing route, because with a false ENO neither has been attempted yet. The EN/ENO convention runs across IEC 61131 programming tools, and ENO can sit false even while EN is true for reasons inside the called instance — the pattern is documented in ENO false despite EN true in function-block calls. Read a false ENO as a hold order on your sequence, not as an error code from the network.
Hold EN true across scans #
The block documentation requires the EN input to be maintained in the TRUE state. Initialization takes more than one PLC scan, because the instance allocates state and coordinates with the Remote Service (RSC) through which the MQTT Client component delivers its functions to PLCnext Control applications. Three common patterns starve that initialization:
- Pulsing EN for a single scan and letting it fall back.
- Gating EN with a transient start bit that drops after the first cycle.
- Dropping EN while waiting for the connection result.
Any of them leaves the client re-initializing, so ENO stays false — the state the reported project was in. The pass condition: across several normal task scans, EN stays true and ENO becomes true. If ENO stays false with EN continuously true, read the block inputs and the PLC diagnostics for initialization errors, and confirm from the library metadata and block documentation that the installed IIoT_library_2 release supports the controller's runtime. Make these program changes in a planned window or with the machine in a safe state, because a download restarts the application.
Call Connect once per attempt #
The same documentation warns that most methods must not run continuously with EN := TRUE — especially Connect. In a cyclic task a permanently true enable re-executes Connect every scan and restarts or duplicates the asynchronous connection attempt. The sequence that works:
- Keep the base client block enabled.
- Wait until ENO is true.
- Issue Connect once — one rising request per attempt.
- Wait for the method's completion, error, and status outputs.
- Retry only after a reported failure or a deliberate disconnect.
Take those output names from the declaration of the block actually placed in your project, never from another library's example. Then prove the sequence with a trend: one rising request corresponds to one completed or failed attempt, with no scan-by-scan retriggering.
Worked example: the path from 192.168.1.2 to the broker at 192.168.1.20:1883 #
Inputs and where each comes from:
- Controller address: 192.168.1.2, from the reported project.
- Broker endpoint:
tcp://192.168.1.20:1883, the URL configured in the MQTT block; the port carries plain MQTT, no TLS. - Subnet mask: not stated in the reported project. The example uses 255.255.255.0; substitute the mask actually configured on the controller.
The rule: two stations deliver directly to each other when each address, ANDed with the same mask, yields the same network address. If the results differ, the sender hands the frame to its default gateway and routing decides reachability.
The arithmetic:
- 192.168.1.2 AND 255.255.255.0 → 192.168.1.0
- 192.168.1.20 AND 255.255.255.0 → 192.168.1.0
Result: both stations sit on the network 192.168.1.0.
Decision: with the example mask the controller reaches 192.168.1.20:1883 directly on the local link, so no router or gateway setting can be the fault — the remaining checks are the TCP connection and, once ENO is true, a single Connect. If your real mask produces two different network addresses, the configured gateway must route to the broker's network before anything else is changed.
Test TCP before credentials #
Three checks, in this order, before anyone edits credentials:
- Link and negotiation. The AXC F 2152 datasheet gives the interface as an RJ45 jack with auto-negotiation and auto-crossing, 10/100 Mbps full duplex. Confirm the link is up and stays negotiated; a down or flapping link makes every higher-layer result meaningless.
- Duplicate addresses. A second device answering the controller's or the broker's address produces intermittent reachability, because neighbors learn different hardware addresses for the same IP. Rule it out first.
- The port itself. A ping from an engineering workstation proves only that workstation's path; the decisive test starts from the controller's network, or from a diagnostic point with the same route and filtering. Ping can succeed while a host firewall, an access rule, or a broker bound to a different address blocks TCP — so open a real TCP connection to port 1883 from the controller's side.
If that connection opens and the MQTT session still will not establish, the fault has moved up a layer: diagnose the MQTT handshake when TCP already works.
Rebuild the old example on IIoT_library_2 #
The published example program references JSON_utility_library and MQTT_Client_Library, and it has not been updated for the newer IIoT library arrangement. Compiled unchanged against a project on IIoT_library_2, it stops on unresolved references before any communication is attempted. Rebuild it minimal:
- Create a new project with only the MQTT blocks the installed IIoT_library_2 supplies.
- Enter the broker endpoint through the current block interface; do not import declarations from the old example.
- Enable the base block, wait for ENO true, issue one Connect.
- Build until nothing references the old libraries.
A public Mosquitto broker is a fair controlled endpoint for this minimal test: enter its documented connection settings in the block. If the same logic connects there but not to your own broker, the fault sits in the local listener, route, firewall, or authentication — not in the PLC program. To keep the test endpoint under your own control instead, run a secured Mosquitto lab broker on the bench and point the block at it.
Decision for each case #
- ENO false while EN is true for only part of the sequence: fix the enable logic first. Nothing else you test matters until ENO turns true.
- ENO false with EN continuously true and a clean build: the client is not initializing. Read the PLC diagnostics and the block inputs; leave credentials and firewall alone.
- ENO true and Connect reports a failure: the path is now the suspect — run the same-subnet check, rule out duplicate addresses, open the TCP connection from the controller's side, and examine authentication last.
- The example project will not compile: rebuild it minimal on IIoT_library_2, prove it against a controlled broker, then return to your own endpoint.
- ENO never turns true and the diagnostics show nothing: confirm the client component's service is present and loaded on the controller, then take the block inputs and the library release to the library's developers.
Questions asked
Where do a wrong MQTT username or password actually show up?
In the result of the Connect call, not on ENO. Once ENO is true and the TCP connection to the broker opens, a rejected credential appears in the method's error and status outputs. Re-enter the username and password through the current block interface; declarations carried over from the older example libraries do not transfer to the installed library.
Who supports the MQTT blocks from IIoT_library_2?
The library's own developers. Support for libraries and apps from the PLCnext Store comes directly from the developers through the contact option on the app's page in the Store. Include the controller runtime v2021_0_5, the PLCnext Engineer version 2021.3 and the library release you installed, so they can check that combination against their compatibility notes.
Is a desktop client like MQTT Explorer part of the controller's data path?
No. MQTT Explorer opens its own session to the broker from the PC it runs on, so the topics it shows prove the broker serves that PC's route and credentials, nothing about the controller's. Keep it as an observer of broker-side topics, and run the decisive reachability tests from the controller's side of the network.
Does the MQTT client need a service running on the controller?
Yes. The MQTT Client component provides its functions to PLCnext Control applications through a Remote Service. When the app is deployed from the PLCnext Store, that service is deployed and loaded automatically. If the component arrived by another route, or the controller was reflashed since, verify the service is present and loaded before expecting ENO to turn true.