For an application, we are using the AXL_CAN_COMM_4 to receive CAN messages. The processing of the messages is done in a cpp Program. As we have more than 200 different message ids we can`t use the xReceiveMode in True.
We are using an input port to get the receivebuffer in to the cpp program
To prevent the buffer from filling, the processed messages need to be removed by setting the xUsed to false.
Dear Bram,
At the moment, defining external/InOut ports in C++ is not possible. If you wish to clear the buffer, you should do this in PLCnext Engineer, such as a Structerd Text code. This does mean that you have to create a output boolean and integer in your C++ code to transfer the xUsed state and element number to the ST code after copying the message.
I think the general workflow would be:
1. In the C++ program, copy the buffer element to the processMsg variable as shown in your image.
2. set xUsed to false in the C++ program.
3. Transfer the state of _xUsed_ and the element number which needs to be cleared to your ST code in PLCnext Engineer.
4. Clear the element in the port variable which is connected to your C++ input port _rxBuffer[ ]_. This should also clear the rxBuffer element in your C++ code.