aTURBOPMAC2USER Posted April 4, 2013 Posted April 4, 2013 Dear All, is there any way to assign a variable to MI variable? Something like: //////////////////////////////// open plc 1 clear ... p1000=... close open prog 1 clear ... ms0,mi925=p1000+100 ... close /////////////////////////////// When i down the plc and prog to pmac, an error says that "ms0,mi925=p1000+100 -------Data error or unrecognized command" away occured. Can anyone help me? PS:Turbo PMAC2 Ultralite, one MACRO station.
Sina.Sattari Posted April 4, 2013 Posted April 4, 2013 The MACROSLAVE{node#},{slave variable}={constant} command is an online command and if you want to use it in a PLC or motion program, you need to use the CMD"" command, in which case the value is hardcoded in the quotation marks and not useful in your case. However, you can use the MACROSLVWRITE{node #},{slave variable},{PMAC variable} or its short form MSW{node #},{slave variable},{PMAC variable} both in online and in PLC/motion programs directly. Please keep in mind the {PMAC variable} section should be a single variable and not an expression. If calculation is required, the expression should be evaluated in the previous lines of the buffered program (PLC/motion program) and result assigned to a PMAC variable and then sent to the MACRO slave node using MSW command. See Also: MACROSLAVEREAD , MSR
aTURBOPMAC2USER Posted April 7, 2013 Author Posted April 7, 2013 @Sina Thank you very much. The programs works very well. Best regards.
Recommended Posts