Sign in to follow this  
Followers 0
shalamar

Reading individual bits from DINT tag on the CompactLogix 1769

7 posts in this topic

I have been supplied with a list of tags from a vendor containing flags indicating if alarm conditions are on. These tags have the format AlarmGroup.Num.1 through AlarmGroup.Num.10 as recorded. Reading these tags as presented by making a read request to the Read Tag Service fails with general error code status 0x05, "Request path destination unknown. Probably instance number is not present.". I am using ASCII extended symbolic segments to translate the tag into a path so the instance number is not required for this approach. Upon further discussion with the vendor I found out AlarmGroup.Num.1 refers to bit 1 of the AlarmGroup.Num tag that is a DINT tag. I can successfully read the AlarmGroup.Num as a DINT but I was hoping for a more universal solution that would not require me to add solution specific parsing functionality to identify tags that refer to individual bytes from other tags and manually shift the bits as required. I am very new at this and I want to know if it is possible to address an individual bit (for reading only) from a DINT tag and how to build the path to access it. Are there other types of segments other than the ASCII extended segments required? Edited by shalamar

Share this post


Link to post
Share on other sites
What exactly are you trying to accomplish? You're trying to get the CompactLogix to communicate with another device? What protocol/network are you using? Or maybe, it sounds like you may be using some sort of software/HMI to communicate with the PLC? If so, what is it? Edited by MrAutomation

Share this post


Link to post
Share on other sites
I am trying to read data off the AB PLC programatically via a driver I created that uses the Common Industrial Protocol to target the Read Tag Service and Write Tag Service CIP services implemented by the Logix 5000 controller. Reading and writing to all other tags works. It's only these ones that address a particular bit within a DINT that do not work. The PLC and tag setup has been performed by a vedor whose equipment I am trying to control via said PLC so I am not sure if what I am doing is wrong or the setup is wrong on the vendor side, e.g. the DINT tag should really be set up as a word to allow access to individual bits (see in the original message the difference between the DINT tag and the tag that targets a particular bit).

Share this post


Link to post
Share on other sites
No this looks like a problem on your end. It's common practice in PLCs to use individual bits of a DINT in groups, especially for alarms and such. The CIP protocol is correct in only transferring the whole DINT tag. It wouldn't make sense to send each of the bits of the DINT individually. That would create a whole bunch of extra network traffic. On a traditional HMI, it's possible to "dig down" to the individual bits of a DINT, but the HMI does the work of isolating the bit from the word. Since you're using a custom made driver, that's going to be your job to isolate the individual bits from the DINT. It should be pretty easily doable with a bit of math. I'm not a driver expert, but this is what I would say the problem is. Edited by MrAutomation

Share this post


Link to post
Share on other sites
Just for curiosities sake, why do you need to build a driver? You can't use an existing software to do what you need?

Share this post


Link to post
Share on other sites
Because the company that employs me refuses to spend money on a commercial product. To their credit it is also the case that a solution requiring this type of driver would require an additional license.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0