In/Out "External" port in C++
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.
This does not work to clear the buffer as rxbuffer is only an Input port.
I don't see an option to make a port in cpp external / input-output port.
What is the best way to clear the buffer?
This discussion has been closed.
Comments
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:
With kind regards,
Damian Bombeeck
Thanks for the response,
I have started doing it with a similar method as the one that you suggested.