DLS_James Posted January 27, 2017 Share Posted January 27, 2017 Hello, I have a PowerPMAC with an ACC65-E card installed. I would like to be able to read/write from/to the individual GPIO pins from a plc program. Reading the PowerPMAC Software Reference Manual, my understanding is that I need to do the following: 1. Query cid[0].num to cid[63].num looking for the card ID of the ACC65 2. Once I know which cid[x] address it is on, look up the gate address on the Card ID Status Element table on pg 654 of the manual 3. Once I know the gate address, query or write to the datareg to read/write to the GPIO pins eg GateIo[0].DataReg[0] = 1 • Is this correct? • Is there an easy way of querying all 64 cid addresses rather than having to do it individually? • Is there a table which lists what cards have what ID numbers? Cid[12].num returns 3575, is that my accessory card? Thanks for any help, James Link to comment Share on other sites More sharing options...
DLS_James Posted January 27, 2017 Author Share Posted January 27, 2017 Hello, Tony Jacobs has given me an easier answer. I can address the card directly: eg acc65e[0].datareg[y] where, y = 0 for pins 1-8, 1 for pins 9-16, 2 for pins 16-24 (input) y = 3 for pins 1-8, 4 for pins 9-16, 5 for pins 16-24 (output) Link to comment Share on other sites More sharing options...
curtwilson Posted January 27, 2017 Share Posted January 27, 2017 Note that to access a bit associated with an individual pin, you can use the format acc65e[x].datareg[y].z where z = 0 to 7 for the 8 bits in the register. For example, to access pin 12 of the input connector, you would use: acc65E[0].datareg[1].3 In your PPMAC project you can assign this a meaningful variable name. e.g.: ptr InterlockSwitch->acc65e[0].datareg[1].3 Link to comment Share on other sites More sharing options...
DLS_James Posted January 30, 2017 Author Share Posted January 30, 2017 Cool! Thanks, that's useful. James Link to comment Share on other sites More sharing options...
Recommended Posts