PLC acknowledgment in ProcessController

This section shows how to write drivers for your shop's PLCs, code readers, and specialized devices in x4Trace.
Post Reply
x4Trace
Posts: 58
Joined: Fri Feb 14, 2025 2:24 pm

PLC acknowledgment in ProcessController

Post by x4Trace »

This acknowledgment is valid for only the ProcessController module. The code is open source and can be found in the x4Trace.Server.Modules project.

There are two types of commands.
PLC sends a command to the server, and the server sends a command to PLC.

VAR_IN_LINE_DIV_COMMAND: PLC sends a request to x4Trace.
VAR_OUT_LINE_DIV_COMMAND_RESULT: x4Trace answers for the request.

VAR_OUT_SERVERCOMMAND: x4Trace sends a request to PLC.
VAR_IN_SERVERCOMMAND_RESULT: PLC answers for the request.

These two variables are also used for the acknowledgment.
You must switch on the ACK in the driver variables. Set this value to 1.
If this value is 0 x4Trace automatically will skip the acknowledgment.

If PLC sends a command, it will get a result.
After the result, x4Trace needs acknowledgment.
1. PLC must set this variable:
VAR_IN_LINE_DIV_COMMAND = LINE_COMMAND_OK
2. PLC must wait for this answer:
VAR_OUT_LINE_DIV_COMMAND_RESULT == LINE_COMMAND_RESULT_NONE
3. PLC must set this variable:
VAR_IN_LINE_DIV_COMMAND = LINE_COMMAND_NONE

If the PLC gets a command from x4Trace, it has to acknowledge that if the ACK is enabled.
1. PLC has to set this variable:
VAR_IN_SERVERCOMMAND_RESULT = LINE_COMMAND_OK
2. PLC must wait for this answer:
VAR_OUT_SERVERCOMMAND = LINE_COMMAND_NONE
3. PLC has to set this variable:
VAR_IN_SERVERCOMMAND_RESULT = LINE_COMMAND_RESULT_NONE

You can read about the variables here:
https://docs.x4trace.com/sw/class_ix4_t ... river.html
Post Reply