Reconfiguring COM Port Parameters in OwenCommunication Library

Daniel Price2 min read
Other ManufacturerSerial CommunicationTechnical Reference
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Reopening a COM Port with Different Parameters

Serial port parameters in the OwenCommunication library are latched on the rising edge of the xEnable input of the COM_Control function block. Changing parameter inputs while the port is open does not apply them; the port must be closed and reopened. The documented procedure is:

  1. Call the COM_Control instance with xEnable := FALSE.
  2. Wait until the xActive output returns FALSE, confirming the port is closed.
  3. Write the new values to the required parameter inputs of the block.
  4. Call the block again with xEnable := TRUE. The new parameters are fixed on this rising edge.

The wait on xActive = FALSE is mandatory. Writing new parameters and re-enabling before the close completes risks latching the old configuration, because the rising edge of xEnable is what captures the input values.

Edge Behavior of COM_Control

Port open/close is edge-driven: the rising edge of xEnable opens the port and fixes the communication parameters; the falling edge closes it. A consequence engineers trip over: simply toggling xEnable within one scan does not guarantee a clean parameter swap. Keep xEnable low for at least the scans needed for xActive to drop, then apply the new configuration before raising xEnable again.

MB_SerialSlave xNewRequest Timing in Library 3.5.11.7

On library version 3.5.11.7, MB_SerialSlave holds the xNewRequest output active for two PLC cycles instead of one, contrary to the documented single-cycle behavior. The discrepancy has been confirmed by the library maintainer, who stated the behavior will be corrected to match the documentation in a future update. Until then, any logic that consumes xNewRequest must tolerate the signal being TRUE on two consecutive cycles - for example, by edge-triggering the consumer or by clearing processed request state immediately so the second cycle does not trigger duplicate handling. This was observed on firmware 3.7.0923.1107.

Read Request Size Limit

The maximum number of registers in a single read request is 125. Requests above this limit must be split into multiple sequential read operations by the application logic.

FAQ

How do I change COM port parameters at runtime with OwenCommunication COM_Control?

Call the block with xEnable := FALSE, wait for xActive := FALSE, update the parameter inputs, then call the block with xEnable := TRUE. Parameters are latched only on the rising edge of xEnable.

Why is my OwenCommunication parameter change ignored after writing new inputs?

COM_Control fixes parameters on the rising edge of xEnable, not continuously. If the port stayed open (xActive remained TRUE) while you changed inputs, the new values were never captured - close the port and reopen it.

How long does MB_SerialSlave hold xNewRequest in OwenCommunication 3.5.11.7?

Two PLC cycles instead of the documented one. The maintainer confirmed the deviation and plans to align behavior with the documentation; design consumer logic to be edge-triggered so the extra cycle causes no duplicate request handling.

Back to blog