RafaelFalcaro Posted March 31, 2023 Share Posted March 31, 2023 (edited) Hi, I'm tryng to pass a string as parameter to "system" command in a PLC like this: open plc SYSLOG_TEST system "logger -i -p user.debug -t test_plc %s", "Testing syslog on Delta Tau" disable plc SYSLOG_TEST close I'm getting this error: ...\21-SyslogTest.plc(30,1) : Error : ( error #31) data error in equation : system "logger -i -p user.debug -t test_plc %s", "Testing syslog on Delta Tau" But, at the POWER PMAC SOFTWARE REFERENCE MANUAL, the "system" command description says this: Firmware version: 2.6.0.0 What am I doing wrong? Edited March 31, 2023 by RafaelFalcaro Quote Link to comment Share on other sites More sharing options...
leandro.martins Posted April 4, 2023 Share Posted April 4, 2023 (edited) I think you have to store the string in the user-buffer and use the address of the beginning of your string. From the manual Quote For a string variable, the expression value (rounded down to the next integer if necessary) represents the starting index in user shared memory of the string variable to be used. e.g. L0 = strcpy(6,"test") system "touch /var/ftp/gather/%s",6 you can use the L0 for some sanity checks Edited April 4, 2023 by leandro.martins 1 Quote Link to comment Share on other sites More sharing options...
RafaelFalcaro Posted August 22, 2023 Author Share Posted August 22, 2023 Thanks, Leandro, it worked very well! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.