Jump to content
OMRON Forums

Reading IO space from script


dennisg
 Share

Recommended Posts

I am trying to figure out how to access IO space from inside a PLC script. I would like to just read it into P values. It will be a 26 bit value at piom + $A00000 (lower 24 bits), and piom + $A00004 (upper 8 bits).

 

What is the syntax to accomplish this ?

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Dennis,

 

You have to define two pointers in global include section under Script Language section of the project:

ptr LowerWord->u.io:$A00000.8.24;    // upper 24-bits of a 32-bit word
ptr UpperWord->u.io:$A00004.8.8;     // bits 8 through 15 of a 32-bit word
global CombinedWord;

the definitions here are based upon an ACC-84E memory map. The ACC-84E was designed for use with Turbo UMAC. All Turbo UMAC compatible accessories use a 24-bit data bus. When these 24-bit bus accessories are used with Power PMAC, the data is always in the upper 24-bits of Power PMAC's 32-bit data bus. As you can see in the pointer definition, the second value is always 8, indicating that the LSB of the data is located at bit 8.

Then in a script PLC you can read or write to the pointed register. (In case of an ACC-84E these registers are read-only)

CombinedWord = (UpperWord<<24)|LowerWord;

Link to comment
Share on other sites

Dennis,

 

You have to define two pointers in global include section under Script Language section of the project:

ptr LowerWord->u.io:$A00000.8.24;    // upper 24-bits of a 32-bit word
ptr UpperWord->u.io:$A00004.8.8;     // bits 8 through 15 of a 32-bit word
global CombinedWord;

the definitions here are based upon an ACC-84E memory map. The ACC-84E was designed for use with Turbo UMAC. All Turbo UMAC compatible accessories use a 24-bit data bus. When these 24-bit bus accessories are used with Power PMAC, the data is always in the upper 24-bits of Power PMAC's 32-bit data bus. As you can see in the pointer definition, the second value is always 8, indicating that the LSB of the data is located at bit 8.

Then in a script PLC you can read or write to the pointed register. (In case of an ACC-84E these registers are read-only)

CombinedWord = (UpperWord<<24)|LowerWord;

 

Thanks Sina.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...