Studio 5000 set the order of routines in organizer

g.mccormick

Lifetime Supporting Member
Join Date
Jul 2012
Location
IN
Posts
961
Is there a way to change the order of the routines in the organizer? It is defaulting to alphabetical order, but I would like to change the order to better suite my feeble brain (I know it has nothing to do with the execution of code). If I can't figure anything else out, I will prepend a number to the names to force the order.
 
One thing to keep in mind, they scan in the order which you call the routines, not by the order that they are organized in the project tree. If you already had your program calling the routines based on the order in the tree, then you rename them, putting them in a different order, the execution order doesn't change. Hopefully that made sense....
 
I name all my continuously executed routines R01...R99, so that I can name them in the order I intend to call them.

For subroutines that are not continuously executed, I number them SBR01..SBR99. Luckily S comes after R in the alphabet, so they all sit just below my continuously executed routines, and the specific order is largely unimportant as they're not being continuously executed.
 
But what is next after R99? Been there before

Since the only limit to the number of routines is determined by available memory (or 65,536, if I remember correctly), then you could easily adopt a numbering system with as many leading zeroes that fit the bill... e.g.

R001_{name}
R002_{name}
..
R099_{name}
R100_{name}

The alphanumeric sorting on the organiser tree works correctly then.

2021-01-27_214315.jpg
 
But what is next after R99? Been there before

Since the only limit to the number of routines is determined by available memory (or 65,536, if I remember correctly), then you could easily adopt a numbering system with as many leading zeroes that fit the bill... e.g.

R001_{name}
R002_{name}
..
R099_{name}
R100_{name}


The way my programs are structured, I very rarely have a need to go past R99. Most of the time I prefer to separate different sections of plant into different programs, with each section/program having a common routine structure - e.g. R01-R09 is housekeeping and signal processing for sensors and analogs, R10-11-12 is sub-section 1 motors-pneumatics-other, R20-21-22 is sub-section 2 motors-pneumatics-other, R80-R89 is alarms/warnings/annunciation, and so on. 100 routines for one section of plant has always been more than enough.

But on the odd occasion this structure doesn't suit, yes, more leading zeroes is the answer.
 
The way my programs are structured, I very rarely have a need to go past R99. Most of the time I prefer to separate different sections of plant into different programs, with each section/program having a common routine structure - e.g. R01-R09 is housekeeping and signal processing for sensors and analogs, R10-11-12 is sub-section 1 motors-pneumatics-other, R20-21-22 is sub-section 2 motors-pneumatics-other, R80-R89 is alarms/warnings/annunciation, and so on. 100 routines for one section of plant has always been more than enough.

But on the odd occasion this structure doesn't suit, yes, more leading zeroes is the answer.

It sounds like you have the bases covered there ASF !

This post is for the "not so experienced" programmers

Whatever your needs are, structuring your code in a logical and defined way is not for you (although it helps enormously), it is for the poor guy who has to fix a fault at 3:00 am on a cold winter's morning, with nothing more than a cable drum to put his laptop on, a beer crate to sit on, and trying to type while wearing gloves ! Been there, done that, etc.

Yesterday he worked on the chiller plant, the code written 5 years ago to the company standard, and managed to find & fix the problem in 15 minutes. In three years time there will be an issue on the newly installed Widget Palletiser that he has to address. But because of company "standards", he should already know how the code is structured, and if he knows the structure, he immediately gets a good handle on how it works.

It should not matter that the new application was written in version 93, and the chiller plant written in version 14, the code, as written should be familiar enough to ease his many years away transition.

I'm a firm believer in the old saying "If it ain't broke, don't fix it !". Change should only be attempted out of necessity.

Sometimes I think that the PLC developers are making "improvements" just so they keep a job!
 
Whatever your needs are, structuring your code in a logical and defined way is not for you (although it helps enormously), it is for the poor guy who has to fix a fault at 3:00 am on a cold winter's morning, with nothing more than a cable drum to put his laptop on, a beer crate to sit on, and trying to type while wearing gloves ! Been there, done that, etc.

Yesterday he worked on the chiller plant, the code written 5 years ago to the company standard, and managed to find & fix the problem in 15 minutes. In three years time there will be an issue on the newly installed Widget Palletiser that he has to address. But because of company "standards", he should already know how the code is structured, and if he knows the structure, he immediately gets a good handle on how it works.
Right on. And as well as the advantages for maintenance, it has a lot of advantages for me as an OEM/designer/contractor as well. I've trained up two other programmers in the company I work for, to use the same structure that I use, and as a result any one of us can go and commission a program that any other one of us has written. Five years after Tom puts a system in, I can come along and add an extra widget or two, and if Tom comes looking next week, he'll know exactly where to find the code I added. And it'll look largely the same way it would have looked had he done it himself. Makes my job easy and my colleagues jobs easy.
 
One thing to keep in mind, they scan in the order which you call the routines, not by the order that they are organized in the project tree. If you already had your program calling the routines based on the order in the tree, then you rename them, putting them in a different order, the execution order doesn't change. Hopefully that made sense....

Yep. This is purely for sanity sakes.
 

Similar Topics

We have a remove PLC rack that is being used to collect data from older equipment via a 1756-DHRIO module. This module occasionally faults out...
Replies
1
Views
411
I'm trying to offset Main CIP (Master) for other slaves (Drives). I have 360 Rotary Scaling. For the MAPC I'm using "(360.0 +...
Replies
0
Views
1,172
CPU: 5069-L330ER v32 HMI: PV+7 10" v11 Every time the customer powers off the machine and re-applies power, the HMI gets stuck on Starting...
Replies
9
Views
21,678
I'm using Studio 5000 v31, and FTV SE 10. Trying to determine how to use the alarm set members such as .InAlarmUnackedCount, .HasUnackedAlarm...
Replies
0
Views
1,694
i have studio 5000 v 24 and the processor is the L75, what i am trying to do is omit the ph controllers we use for waste water treatment. The new...
Replies
0
Views
3,253
Back
Top Bottom