CODESYS Control is running on my RevPi, and my system communicates over a CANbus with a master using the ConnectCan module (Slave - CANopen Device). The communication works perfectly fine so far. However, as soon as I call a Python script with "SysProcessExecuteCommand2" that creates a CSV file and executes without errors, the master does not adopt any changes to the Transmission Process Data Objects (TPDOs). I don't quite understand what one has to do with the other, and perhaps someone can help me with this.
Here is my script call:
SysProcess.SysProcessExecuteCommand2(pszCommand:='python /home/pi/test.py',
pszStdOut:=sCMDOutput,
udiStdOutLen:= SIZEOF(sCMDOutput),
pResult := ADR(eResult));
Thank you in advance!
Best regards,
Stefan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have now conducted some tests. The problem occurs when the Python script establishes an OPCUA connection, even if I only establish the connection without reading or writing any data.
Is there another way to exchange data between Python and CODESYS without having to put in a lot of effort?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
CODESYS Control is running on my RevPi, and my system communicates over a CANbus with a master using the ConnectCan module (Slave - CANopen Device). The communication works perfectly fine so far. However, as soon as I call a Python script with "SysProcessExecuteCommand2" that creates a CSV file and executes without errors, the master does not adopt any changes to the Transmission Process Data Objects (TPDOs). I don't quite understand what one has to do with the other, and perhaps someone can help me with this.
Here is my script call:
SysProcess.SysProcessExecuteCommand2(pszCommand:='python /home/pi/test.py',
pszStdOut:=sCMDOutput,
udiStdOutLen:= SIZEOF(sCMDOutput),
pResult := ADR(eResult));
Thank you in advance!
Best regards,
Stefan
please call sysproccess in an own task with low prio
Last edit: eschwellinger 2024-06-20
I am now executing the process in a separate task with lower priority, but unfortunately, the connection to the master is still interrupted.
which runtime version is it? 4.11.0.0?
4.10.0.0
4.10.0.0
I have now conducted some tests. The problem occurs when the Python script establishes an OPCUA connection, even if I only establish the connection without reading or writing any data.
Is there another way to exchange data between Python and CODESYS without having to put in a lot of effort?