HJTrost Posted March 23, 2023 Share Posted March 23, 2023 I am converting a set of Turbo Pmac programs to Power Pmac in order to make the transition from the Turbo Clipper to the Power Clipper ARM (specifically targeted at the CK3C-AX1100). I noticed that #define's for cmd program commands are not properly recognized, e.g., with #define CmdPhaseX cmd"#1$" I get an error for a line in a PLC CmdPhaseX ; saying "Illegal syntax, expecting type definition or operator". I haven't found any hint in the Power Pmac SRM why the token string cmd"#1$" should be illegal. I'd appreciate any explanation and suggestion. Hans-Jochen Trost Quote Link to comment Share on other sites More sharing options...
Omron Forums Support Posted March 23, 2023 Share Posted March 23, 2023 Is the correct coordinate system addressed? Power PMAC defaults to coordinate system 0. Either way, it's best to put that in, i.e. #define CmdPhaseX cmd"&n#1$", where n = coordinate system #. Quote Link to comment Share on other sites More sharing options...
HJTrost Posted March 23, 2023 Author Share Posted March 23, 2023 Good question. One of my .pmh files contains these lines: &1 #1->x #2->y #3->Z &3 #4->W &4 #5->C Putting the coordinate system explicitly into the CmdPhase definitions does not change the error message. Putting the actual command in place of the macro instruction makes the error go away. By the way, I am working on a PC and am telling the IDE that there is no device connected. I'm issuing Build commands just to find bugs like this one. The #define is in a .pmh file, the instruction "CmdPhaseX ;" is in a PLC. There are more than one location where these commands are used, which is why I want the macro to ensure that all occurrences use the same command. Quote Link to comment Share on other sites More sharing options...
DaveBarnett Posted March 23, 2023 Share Posted March 23, 2023 I don't think the Pmac pre-processor likes quotation marks in the #define. If you put this in global definitions.pmh: #define CmdPhaseX #1$ and this in the PLC: cmd "CmdPhaseX" It should have your desired result...no ?? Quote Link to comment Share on other sites More sharing options...
HJTrost Posted March 24, 2023 Author Share Posted March 24, 2023 Dave, unfortunately not. The error message disappears alright, but when I write cmd "CmdPhaseXYZ"; into the PLC, with no definition of CmdPhaseXYZ anywhere, there is no error message either. Quote Link to comment Share on other sites More sharing options...
Omron Forums Support Posted March 24, 2023 Share Posted March 24, 2023 OK, but doesn't CmdPhaseX work now, using Dave's approach? I believe the problem with not seeing an error message is that you're not looking in the right place. The PLC is on a different thread than the Terminal Window. Try checking Ldata.CmdStatus in the PLC after the CmdPhaseXYZ command. I believe you'll get a "-21" error code. See under the SRM manual's description for the "cmd" command. Quote Link to comment Share on other sites More sharing options...
HJTrost Posted March 24, 2023 Author Share Posted March 24, 2023 I don't have my trial project (setting of variables, macro definitions and 3 basic PLCs out of my Turbo program conversion) far enough to actually hook up to my controller, so it will be a while until I get to see the Ldata.CmdStatus. pp_proj.h gets loaded with errors, creating among other issues somehow duplicates from definitions in my .pmh files. I'll take that into a new thread next week. Thanks for your guidance so far. Quote Link to comment Share on other sites More sharing options...
steve.milici Posted March 24, 2023 Share Posted March 24, 2023 Here is the original MACRO specification document from the now discontinued “MACRO.org” website. MACRO specification.pdf 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.