Jump to content
OMRON Forums

Recommended Posts

Posted

In a PLC homing routine, I want to jog off of a home switch at the homing velocity, so I want to save the original jog speed and restore it at the end of the routine.

 

I'm attempting to use the following code to save the original jogspeed:

open plc 21

local JogSpeed;

JogSpeed=Motor[1].JogSpeed;

{etc. etc.}

 

Compiler coughs hairball with the following;

C:\Documents and Settings\mshaver\My Documents\PowerPmacSuite\PowerPmac3\PowerPmac2\PMAC Script Language\PLC Programs\plc21.plc(7,1) : Error : ( error #31) invalid parameter number in equation : L0=Motor[1].L0

Error: downloading preprocessed File: "/var/ftp/usrflash/Temp/pp_proj.pma"

There were errors during the download process and the download process has stopped.

 

Compile goes OK with use "of mJogSpeed", or with "L1" as my local variable.

 

So obviously, the compiler is confusing local variable JogSpeed with the element name of the Motor[1] structure.

 

I get it, I know how to fix it, no need to reply, unless I'm missing something, but I just must say Grrrrrrr!

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted

mshaver,

 

This is a good example of how using reserved words as variable names can cause problems, not only in PMAC script but also in any other programming language. In PMAC Script, all of the saved, non-saved, status structure names are considered reserved words.

Guest
This topic is now closed to further replies.

×
×
  • Create New...