Jump to content
OMRON Forums

Error passing string to "system" command in PLC routines


Recommended Posts

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



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:

What am I doing wrong?

Edited by RafaelFalcaro
Link to comment
Share on other sites

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


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.


L0 = strcpy(6,"test")
system "touch /var/ftp/gather/%s",6

you can use the L0 for some sanity checks

Edited by leandro.martins
  • Like 1
Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...