Controllogix Subroutines?

Eugen

Lifetime Supporting Member
Join Date
Apr 2004
Location
Toronto
Posts
113
Hi everybody,

It should be simple because I think I have seen few posts with this issue but my search came up with non relevant information.

I have a controllogix PLC and a program with several subroutines, How can I run one or two subroutines at a time for troubleshooting purposes.

Thank you,
Eugen
 
Eugen,

Ill assume the terminology is correct ie. CL has a continous task, that contain programs, which contain a routine commonly called mainroutine (you can check which one is the main routine by checking the properties box for the program you are working in). This main routine calls sub routines with a JSR instruction.

To enable only a couple of subroutines you need to make your JSR instructions calling the subroutines you don't want active false, I would suggest a XIC instruction on a new BOOL tag called "Eugen's Test Bit" this would allow you to toggle the bit on and off to enable and disable the sub routines to your hearts content.

C
 
Thank you Corkers and well .. Philip,

I just need it a confirmation that nothing changed for me with the new enviroment CL or maybe a detail I had to look at.

Thanks anyway
 
I was told that in CL a main program is not needed IF that is true there is any option under RS5000 or I will have to write the main routine and place XIC before JSR-s???
 
In each Task in a ControlLogix, the Programs are run sequentially, in an order configured in RSLogix 5000. In each Program, there is a designated Main Routine, which is also configured in RSLogix 5000.

Most Logix controllers run a Continuous Task with one Main Program, which has one Main Routine. If you are programming "PLC-style", you fill that Main Routine with JSR instructions to run your subroutines.

This is the absolute easiest way to do the things you describe, i.e. conditioning JSR rungs to jump or not jump to the subroutines you wish to run.
 
Like Ken said, there are two ways to run two subroutines in ControlLogix.

The first, more "traditional" way is to use subroutine calls (JSR commands). Your subroutines will be executed start-to-finish in the order you call them.

The second way, which is what you seem to be asking about, is to set up two programs as separate tasks. With this method, you have two simulataneously running programs. Each one is scheduled to scan start-to-finish at intervals of your chosing. I don't know, however, how the ControlLogix handles the resource sharing between the two programs. It may execute one completely then jump back to the other, or it might try and execute a few lines of each at a time. You need to be aware of timing issues, especially if the two programs share global tags!

AK
 
Thanks guys,

It was my first time with CL everything went ok bussiness as usual. there were three programs each with a main routine, but only one of them was the functional part the other ones just buffering the IO-s.

I guess is time to study how CL scans this things.
 
If the three programs are in the same task, then they are scanned start-to-finish, sequentially. The order of execution can be adjusted under the task's "properties".

If the programs are in separate tasks, then the scans may be interrupted, depending on task priority and interval settings.
 
Eugen said:
but only one of them was the functional part the other ones just buffering the IO-s.

I think you might want to buffer IO within the same task as the main program. Here's why:

From what I've been told, IO updates are also handled as a periodic task in ControlLogix. This means that at any point in your scan, the controller may decide to go off and service IO. If you are used to a more traditional approach, where IO is handled before or after the scan, using a JSR to jump to a buffering routine should accomplish this nicely. In fact, buffering your IO is probably a good idea if you "grew up" on a different PLC.

AK
 
akreel said:


From what I've been told, IO updates are also handled as a periodic task in ControlLogix. This means that at any point in your scan, the controller may decide to go off and service IO. If you are used to a more traditional approach, where IO is handled before or after the scan, using a JSR to jump to a buffering routine should accomplish this nicely. In fact, buffering your IO is probably a good idea if you "grew up" on a different PLC.

AK
There's more to this:
The highest priority tasks are the motion planner and I/O service. These will interrupt any program task - even mid-instruction! The exception is the CPS (copy synchronous) instruction.

It may be possible to get a true snapshot of all innputs by using UID and UIE instructions - but I'm not sure whether those instructions affect the I/O service interrupt.
 
Gerry said:
even mid-instruction!

YUCK!
I understand the time-critical nature of motion control. But, why not have that task hosted "invisibly" on the servo cards, using separate memory and a slave CPU? Answer 1, of course, is $$$. But, those cards cost a bundle anyway, right?

AK
 

Similar Topics

I have allways been frustrated that the CLX subroutines do not give you a way to develop a true function block routine (like in Wago & Siemens)...
Replies
3
Views
3,584
Why does the controllogix redundancy modules use a single mode fiber vs multimode fiber?
Replies
1
Views
78
Hello, I have two 16 point input cards and 1 16 point output card showing module faulted on my IO tree in Logix Designer. The fault code is...
Replies
7
Views
214
Hello, My associate and I are trying to sync up two ControlLogix racks (7-slot chassis) with identical modules. We are able to see the secondary...
Replies
4
Views
192
Trying to setup a message read via Ethernet. I have the path setup as 1, 1, 2, 192.168.66.10 I get an error code 1, ext err 315. I am beating...
Replies
9
Views
231
Back
Top Bottom