Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
About assign a MI variable?
#1
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.
Reply
#2
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
Sina Sattari
Chief Engineer
Delta Tau Data Systems, Inc.
Reply
#3
@Sina
Thank you very much.
The programs works very well.
Best regards.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)