Jump to content
OMRON Forums

MACRO read


wfsteele
 Share

Recommended Posts

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Guest DavisG

What is the correct syntax for the MacroSlaveRead program command?

 

I cannot test this right now as I don't have any macro slave stations, but the syntax should be:

 

MacroSlaveReadn,macro var,ppmac var;

 

where n is the node number, macro var is any valid variable at the macro station, and ppmac var is any valid variable at the power pmac.

 

So, to read the value of MI996 from node 0 into the ppmac variable P200:

 

MacroSlaveRead0,i996,p200;

 

 

 

 

Link to comment
Share on other sites

The reason I posted the question was that I tried that syntax and it didn't work. The online command:

MacroSlave0,I920

works, but the program command:

MacroSlaveRead0,I920,P1

does not. When I try to download that statement, I get the error: "invalid data".

Link to comment
Share on other sites

Guest DavisG

The reason I posted the question was that I tried that syntax and it didn't work.

I've asked an engineer in CA to look at this.

 

 

Link to comment
Share on other sites

With a Power PMAC and ACC-5E talking to a MACRO 16 CPU across the MACRO ring, I issued all of these commands from the Power PMAC (master) and received no errors:

 

Gate2[0].MacroEnable=$FCCCF
Gate2[0].MacroMode=$4030

MacroSlaveRead0,MI996,P1
// Response: P1=1015823=$F800F
MacroSlaveRead0,MI920,P1 
// Response: P1=70437463654400=$401000000000

 

I also tested the following PLC and received no errors, and P1 and P2 appropriately filled up after I ran the PLC (I typed "enable plc 1" in the Terminal, without the quotes).

 

Keep in mind that if you want to use these commands in a PLC or a motion program, you need to use cmd"". E.g.:

 

open plc 1
cmd"MacroSlaveRead0,MI920,P1"
cmd"MacroSlaveRead0,MI996,P2"
disable plc 1
close

 

The cause of your error could be that you are not surrounding your MacroSlaveRead commands with cmd"". Remember also that you must properly enable you nodes to which you want to talk using Gate2[n].MacroEnable, and then use the proper Gate2[n].MacroMode settings as well. You need to enable the same nodes on your MACRO station using MI996 and the appropriate setting of MI995.

 

Please refer to the "Gate2. MACRO Ring Setup Elements" section of the "Power PMAC Saved Data Structure Elements" manual for more information: ftp://support.deltatau.com/DT-USA/Power%20PMAC%20Documentation/PDFs/Software%20Reference/Power%20PMAC%20Saved%20Data%20Structure%20Elements%202011-01.pdf

 

 

Link to comment
Share on other sites

MACRO is setup correctly; the online command

macroslave0,i920

works as expected.

 

You are correct, in a plc program

cmd "macroslaveread0,i920,p1"

works. However, I expected the macroslaveread command to work as a program command as it does in TurboPMAC. There is little or no reason to use this command as an online command; it is useful in a program to get the value into a register so that further calculations can be done in the program. Having to use the cmd"" syntax in a program makes things difficult because there is no clean way to synchronize the rest of the program with the updating of the destination register.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...