steveneads Posted December 19, 2018 Posted December 19, 2018 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
steve.milici Posted December 20, 2018 Posted December 20, 2018 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.
Recommended Posts