Hi everyone.
I’m using AXC F2151.
I need to exec a Linux Command like: python3 /opt/plcnext/.local/bin/test.py
In my project, i’m using code below:
strCommand is SRING.
cmdShell is PBCL_SysLinuxShell_1.
strCommandResult is STRING.
------------------------------------------
strCommand := ‚python3 /opt/plcnext/.local/bin/test.py‘;
cmdShell.anyCommand := strCommand;
cmdShell.anyResult := strCommandResult;
cmdShell.diTimeout := diTimeout;
cmdShell.xExecute:= TRUE;
cmdShell();
-------------------------------
This is the first time i work with PLCNext Engineer and i don’t know how to fix this.
Can anyone help me?
Thanks
when i run the command in terminal, it fine

Hi!
- Pay attention to ASCII encoding of your script execution response. I can see several specific characters in provided terminal exec sample. It probably could case PBCL_SysLinuxShell_1 fault.
- diTimeout in ms, and should be raised to proper expected execution time of script.
- Some times scripts should be launched in detached mode. Please refer to fb manual for more details.
- Attach variable to xExecute for more flexible exec control.
It seems to be first steps to check.
BR
Please also read the FAQ section titled „Execute Python scripts“ in the help file for that library.
Please also read the FAQ section titled „Execute Python scripts“ in the help file for that library.</p>
Got it. I forgot to restart. Thanks.