Omron Forums Support Posted July 8, 2015 Share Posted July 8, 2015 I wrote a small library of functions for accessing ACC-72EX's memory in C. It's below. In each function "CardIndex" is the index i that addresses the card. ArrayIndex is the element of the array you want to access. short Acc72EX_Idata16(unsigned int CardIndex, unsigned int ArrayIndex) { unsigned int *myptr = (unsigned int *)piom + (DPRCSBase + CardIndex * 0x100000) / 4; return (short)((myptr[ArrayIndex] << 8) >> 16); } unsigned short Acc72EX_Udata16(unsigned int CardIndex, unsigned int ArrayIndex) { unsigned int *myptr = (unsigned int *)piom + (DPRCSBase + CardIndex * 0x100000) / 4; return (unsigned short)((myptr[ArrayIndex] << 8) >> 16); } char Acc72EX_Data8(unsigned int CardIndex, unsigned int ArrayIndex) { unsigned int *myptr = (unsigned int *)piom + (DPRCSBase + CardIndex * 0x100000) / 4; return (myptr[ArrayIndex / 2] << (16 / (1 + (ArrayIndex % 4) % 2))) >> 24; } unsigned int Acc72EX_Udata32(unsigned int CardIndex, unsigned int ArrayIndex) { unsigned int i = ArrayIndex * 4, j, k = 0; unsigned int out = 0; for(j = i; j <= i + 3; j++) { out |= (unsigned int)((unsigned int)Acc72EX_Data8(CardIndex, j) << (8 * k)); k++; } return out; } int Acc72EX_Idata32(unsigned int CardIndex, unsigned int ArrayIndex) { return (int)Acc72EX_Udata32(CardIndex, ArrayIndex); } For example, to acquire Acc72EX[0].Udata32[1], use: Acc72EX_Udata32(0,1) Link to comment Share on other sites More sharing options...
J0hann Posted October 18, 2016 Share Posted October 18, 2016 Hi Charles, Thank you very much for these codes, it will be useful to me. However these functions are just about the reading. By chance, would you have coded the writing version ? Thanks in advance ! Link to comment Share on other sites More sharing options...
Clopedandle Posted October 18, 2016 Share Posted October 18, 2016 J0hann, Yep I sure did, but they are not on the forums. Check the ACC-72EX manual starting on page 85 for the set/get functions: http://www.deltatau.com/manuals/pdfs/ACC-72EX.pdf?id=635787783278301396 Link to comment Share on other sites More sharing options...
J0hann Posted October 27, 2016 Share Posted October 27, 2016 Great, thank you so much ! I don't know how I could miss them ! Link to comment Share on other sites More sharing options...
Recommended Posts