gazroo

How big is a sub-element ? (SLC/MicroLogix)

2 posts in this topic

Hi there,

As a software engineer, but a newbie to the Allen-Bradley world, sorry if this question doesn't make sense.

I'm enhancing an existing driver by trying to add the ability to read/write structured and array data types - rather than just the elementary data types it supports right now.

This following question is only in the context of SLC/500 & MicroLogix 1400. And I'm currently working on a Counter as a test case, but any solution obviously needs to take into account other structured (and array) data types.

One of the requirements is that the user should be able to select a specific atomic item within a parent structure/array that they want to read/write. So, using the Counter as an example, they might want to define a field which holds just the value of the accumulator.

I know that I can achieve this with a CIP command. I specify file type 87 for counter, file number as 5 (my test example happens to be the standard C5 data file of counters), and element is 0 (for the first counter in C5). Bit number is irrelevant so remains as zero. I ask CIP to return me 2 bytes of data (to hold just the accumulator word). Finally, I tell CIP that I want sub-element 2 (because the accumulator is Word 2 of the whole structure).

Sure enough, the CIP response gives me exactly the 2-byte accumulator value I was expecting, nothing more, nothing less. Success.

My question is this: I knew I had to specify the sub-element as 2; this happens to work for a Counter because of the way it is structured as 3 words. However, it implies that the value I specify for sub-element is ALWAYS measured in units of 16-bit words. Is this a universal truth (i.e. works for other structured types too ?), or does the size of a sub-element depend on other factors, such as the file type ?

 

Thank you in anticipation.

Share this post


Link to post
Share on other sites

The PLC/SLC processors were based 16 bit based CPU and data structures.  This does not mean that there won't be 32 bit sub-elements, but never less than 16 bits unless a single bit.  

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