Jump to content
OMRON Forums

About assign a MI variable?


aTURBOPMAC2USER
 Share

Recommended Posts

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.

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...