dhidas Posted March 12 Share Posted March 12 I'd like to have a shorthand way to look at the bits in SerialEncDataB, for example looking at the CRC bit etc. I thought something like this might work, but it doesn't seem to. Is there a good way to do this without having to do all of the bit shifting in a PLC? #define LENC1CRC Acc84E[0].Chan[0].SerialEncDataB.22.1 Quote Link to comment Share on other sites More sharing options...
DaveBarnett Posted March 12 Share Posted March 12 You could put your data into a Watch Window....and then, in the response column, choose BINARY format. Wouldn't that give you what you desire? Quote Link to comment Share on other sites More sharing options...
dhidas Posted March 12 Author Share Posted March 12 I'm looking to use it in a PLC (script language) Quote Link to comment Share on other sites More sharing options...
Omron Forums Support Posted March 12 Share Posted March 12 (edited) A user shared memory address could be used to hold the value of Acc84E[0].Chan[0].SerialEncDataB, and then individual bits in the user shared memory addresses could be accessed. For example: u.user:$3000 = Acc84E[0].Chan[0].SerialEncDataB ptr LENC1CRC->u.user:$3000.4.1 // for reading bit 4 See under the headings User Shared Memory Buffer Variables and M-Variable Access in the Power PMAC Users manual for details. Edited March 12 by Gregs Quote Link to comment Share on other sites More sharing options...
dhidas Posted March 12 Author Share Posted March 12 Thanks, this looks to be what I was after! (small correction is a missing : after u.user): ptr LENC1CRC->u.user:$3000.4.1 Quote Link to comment Share on other sites More sharing options...
Omron Forums Support Posted March 12 Share Posted March 12 Thanks for the correction. Note that I went back and edited to make the correction. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.