Storing setups in a Micrologix 1000 PLC


Thread Starter

Don Hanfland

I have micrologix 1000 plc that I wish to save 4 integers for each setup. I was thinking of using the N7:XX and figured that I can get 25 setups. I am going to use the Cop function to copy values into the current values. I was wondering are they're better ways of doing this?
Sounds like you have it. The ML1000 is pretty limited in terms of files/memory. Without indirect addressing, your going to write alot of rungs just to move the data to where you need it.

If you were using a ML1200 or above indirect addressing is the way to go. You could create new files N11, N12, N13, and N14, then put your index in a register such as N7:0, for example a 1 for setup 1, then N11:[N7:0] has the first of the four integers, N12:[N7:0] has the second, N13:N7:0] has the third, and so on. Then to access a diffrent setup all you need to do is change the number value in N7:0.

Don Hanfland

Well actually I have figured since I'm going to need an index of some sort it's now going to be 5 integers to be stored. So I will only have 20 setups. So it would kind of like this;

01 N7:0 N7:1 N7:2 N7:3 N7:4
02 N7:5 N7:6 N7:7 N7:8 N7:9
03 N7:10 N7:11 N7:12 N7:13 N7:14
04 N7:15 N7:16 N7:17 N7:18 N7:19
05 N7:20 N7:21 N7:22 N7:23 N7:24
06 N7:25 N7:26 N7:27 N7:28 N7:29
07 N7:30 N7:31 N7:32 N7:33 N7:34
08 N7:35 N7:36 N7:37 N7:38 N7:39
09 N7:40 N7:41 N7:42 N7:43 N7:44
10 N7:45 N7:46 N7:47 N7:48 N7:49
11 N7:50 N7:51 N7:52 N7:53 N7:54
12 N7:55 N7:56 N7:57 N7:58 N7:59
13 N7:60 N7:61 N7:62 N7:63 N7:64
14 N7:65 N7:66 N7:67 N7:68 N7:69
15 N7:70 N7:71 N7:72 N7:73 N7:74
16 N7:75 N7:76 N7:77 N7:78 N7:79
17 N7:80 N7:81 N7:82 N7:83 N7:84
18 N7:85 N7:86 N7:87 N7:88 N7:89
19 N7:90 N7:91 N7:92 N7:93 N7:94
20 N7:95 N7:96 N7:97 N7:98 N7:99

N7:102 - CURRENT DIM#1
N7:103 - CURRENT DIM#2
N7:104 - CURRENT DIM#3

Making var1 the same value as the slot#, I will then know which slot of data i'm working with. The last 5 integers will be used for the current values that the machine will work with.

So I will load from and into based the current slot#.

This Ml1000 is attached to a Micorview as the HMI,
and I'm just starting to make the screens.

Thanks for the help!

Bob Peterson

> Sounds like you have it. The ML1000 is pretty limited in terms of files/memory. Without indirect addressing, your going to write alot of rungs just to move the data to where you need it.<

doesn't the ul1000 have some sort of datalogging memory available? could this be used?

Bob Peterson

Michael Griffin

I haven't done this with a Micrologix, but I have done it with various Siemens PLCs. The details would be different, but I thought you may be interested in the principles I used. The S7-200 series is the smallest current Siemens PLC (and so closest to the Micrologix), so I will describe how I work with that one.

The S7-200 has only one data block (the equivalent of an AB integer file), but it forms one large continuous address space. I allocate a section of memory to act as parameter storage (as you have). This would be "n" * "PS" in size, where:

n=(maximum number of parameters), and
PS=(size of one parameter set).

I also allocate one section of memory of size "PS" to act as storage for the current model (as you have). This allows the program to work with a fixed set of addresses for active parameter data regardless of what model is being run.

This makes the program much easier to understand. In addition, I allocate a section of memory of size "PS" to act as an editing buffer. The operator panel has a parameter editing screen which operates on this section of memory. If you edit any parameters, you have the choice of saving them, or discarding the edits (since you didn't edit the permanent storage directly).

The S7-200 has a block copy instruction which can be used to copy blocks of memory. By copying data between the permanent storage, the current working
memory, or the edit memory, you can edit, save, and recall parameter sets as required. Most PLCs have an equivalent instruction.

You don't need to store the "slot number" (parameter set number) as a parameter. The program will operate on the current working memory. You only need a word (or byte) to act as a pointer to the permanent storage parameter set you want to copy from (or to). The "index number" of the parameter sets in the permanent storage area can be calculated from their addresses (you know the parameter size and start address).

I would normally also allocate memory for an actual part number in each parameter set. The Siemens OPs (OP17, etc.) allow you to edit ASCII
characters with a small keypad by using special key combinations (it is easier than my explanaion makes it sound). This allows the user to store the
proper part number as part of the parameter set. I don't know how much memory you have available with the Micrologix, but the S7-200 has enough that there is no shortage.

One other point is that I normally also allocate an area of memory for
parameters which are not associated with any particular product model, but are related to the general function of the machine. This relates to time delays, options, counter limits, etc. which the machine operator (or other personnel) may need to adjust from time to time to optimise the operation of the machine. These are also adjusted via an OP screen (completely separate from that for product related data). Instead of wasting time hauling out a computer to change a timer, you just adjust in via an OP screen - a very big
time saving.

Michael Griffin
London, Ont. Canada