How to create structures and arrays of existing atomic data

6 posts in this topic


I'll apologise for asking noob questions before I start - please don't shoot, but searching for existing answers on this is very difficult for me as I'm not confident in what search terms to use to get some appropriate results! And I'm afraid there are several aspects to my question too.

I'm a software developer tasked with extending an existing EtherNet/IP driver. The driver already has the ability to identify atomic data in a range of AB controller models (by specifying a file type, file number, element and sub-element). The driver can then issue the appropriate commands (at the different link layers) to read the values of that atomic data, and write new values back.

I have some test hardware: 

(1) Control Logix 1756-ENBT

(2) SLC 500 1747-L551

(3) MicroLogix 1400 1766-L32BWA

(4) CompactLogix 5370 1769-L30ER

I need to access these units remotely over a VPN. I've been able to change the subnet & gateway of (2) and (3) so that I can now see them over my VPN but have yet to work out how to do this for (I) and (4). None of the controllers are set for BOOTP but, to be honest, I'm less concerned about an answer for this than I am about other stuff that follows in a while! I also have a valid licensed dongle which allows me to load RSLinx, RsLogix 500 and Studio 5000 software - for some reason, the RSLogix 500 hasn't activated and I only have a day's grace period left but, here again, I hope to find a resolution to that outside of this forum.

So, to the nitty-gritty....

I'm a confident, mature developer but I have absolutely no experience with PLCs and their terminology - and I admit I haven't been on any training courses. It will take me long enough to figure out protocol/command formats without the added burden of understanding the PLC programming processes, different pieces of Rockwell applications software and their associated plethora of documentation.

In short, my task is to extend our driver to read and write non-atomic data types, i.e. structures and arrays. As a general concept, naturally, I know what a structure and an array are, but not specifically in terms of my test hardware's existing data files. I'm assuming that my easiest approach is to create a couple of simple structures and arrays in the existing test hardware using the Rockwell apps, at which I point I then have an odds-on chance of working out the command packets to put in my driver to read them. I believe that, to read non-atomic data structures and arrays like these, I need to use tags to address the data - if I've understood that correctly. Later on, I could then look at how I put together command packets to write to those structures and arrays, but I want to walk before I run.

At present, I have fumbled my way through setting up a driver in RSLinx to access test hardware items (2) and (3). I can even run up a data monitor for both controllers, and can see various atomic data such as integers, booleans, etc. However, I'm guessing RSLinx doesn't let me set up structures and arrays. I assume that is done through either RSLogix500 or Studio 5000 -- but I have absolutely no idea how to do it or what I'm looking for. And the other aspect that's confusing me is that these two pieces of software are limited in the controller models for which I can start a new project.

If someone could just give me some idiotproof pointers to step me through this, it would be fantastic.

Thanks in anticipation.

Edited by gazroo

Share this post

Link to post
Share on other sites

The SLC500 and Micrologic do not have the ability to set up user defined structures. They have some items (counters, timers, strings and others) which are structures. In the Compactlogix User-defined types (UDT) can be set up. Google for UDT and RSLogix.

Share this post

Link to post
Share on other sites


Thanks for the reply.

What you say now makes some sort of sense to me, because it appears from the existing driver code that we can only read data of types integer (89), float (8a), boolean (85), output (82) and input (83). One of the mistakes I guess I made was when I looked at the RSLinx Data Monitor for one of the controllers: I saw a list of data files which included not just integral and float types, but also strings, timers and counters, and made the (wrong) assumption that they were all atomic data types as far as the controller was concerned.

Once I've worked out the correct format of command packet required to read non-atomic data files, you're implying I should be able to read one or more of the timers or counters already available in the above controller.

So, one follow-on question if I may: I am guessing that, since 'string' is not an atomic data type, it must be an array type (wouldn't make sense for it to be a structured data type) ? And presumably if there was a 'table' of strings I wanted to read, that would be a 2-dim array ? It's just that I'm sure I've seen in one of the protocol documents that it is possible to read both structures and arrays of 1, 2 or 3 dimensions (and even where each element of that array needn't be just an atomic type but could be a structure, e.g. a 2-dimensional array of counters).

Share this post

Link to post
Share on other sites

Yes, timers and counters in the SLC500 and Micrologix worlds consist of 3 16 bit words One contains the preset time/count. Another contains the current time/count. The third is used as individual bits and, at least in the timer, a small numeric section to compare with the system real-time clock. Refer to chapter 8 in this manual for more info.


Share this post

Link to post
Share on other sites

TO further b_carlton's point...the STRING is an array of 82 SINTs with a second value in the form of a DINT to describe the length LEN of the array or string.

1 person likes this

Share this post

Link to post
Share on other sites


Just wanted to say thanks for your replies so far.

I'm understanding how these different controllers either do or don't support UDT. I'm also understand how everything (whether UDT, structures or arrays) eventually maps down to atomic data types. And I've tried out the free AdvancedHMI software with at least some success (e.g. I can amend a string and capture the command packet needed to achieve that with Wireshark, then compare that packet with my driver's existing functions). So that's all good progress.

It leads me onto another question ….

I notice that if I use RSLinx Data Monitor to look at what each of my different controllers has in terms of data files, I get different results, e.g.

SLC 5/05:

S2, B3, T4, C5, R6, N7, F8, ST9, F10, N11, B12, N20

MicroLogix 1400:

O0, I1, S2, B3, T4, C5, R6, N7, F8, ST9, B10


No data tags found


Now I'm assuming these results are simply reflecting the actual data files that have been set up by whoever commissioned the controllers in the first place.

I can also see that various non-atomic data types are mentioned, e.g. string, counter, timer and so on, which appear in one type of controller but not another.

My question is simply: given the 4 types of controller model listed at the top of my original post (and completely leaving aside the question of UDT), how do I determine the full catalogue of "standard" non-atomic types that each controller specifically supports (and which my driver would also therefore need to cater for) ? Is there a set of docs I need to read ? Or is the answer simpler than that ?



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