Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script download problem
#1
Hi,

I have found a problem when downloading a motion program. PPMAC vers 2.3.2.5 and IDE 3.1.4.0.

I have a "sub" program which is called from a "subprog". The structure of the sub program is like this:

-------------------------------------------------------------------
sub: DoCalcs(void)

local var

//some code here

if (error)
{
//some code
return;
}

var = a + b; //some code using "var"

return;
------------------------------------------------------------------------

This code does not download because the local variable "var" is not recognised as an L variable. If I move the local declaration after the return that's inside the if loop, it will download. It seems that the sub doesn't get its end point right.

If I make a similar code structure in the higher level "subprog", it downloads perfectly ok - so it only seems to be a problem in the lower level "sub" program.

Steve
Reply
#2
You declare your “local variables” as argument in the subroutine. The IDE automatically uses L-variables. There is no usage of “void”.
See the section “IDE Program Enhancements” in the “Power PMAC User’s Manual” starting on page 640 for details.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)