Studio 5000 programs and subroutines

markus506

Member
Join Date
Dec 2016
Location
Fredericton
Posts
9
Hi Everyone,

New PLC programmer here (13 years of embedded experience), so please bear with me....🤞🏻

Building a cell using a Compactlogix L24-QB1B. I have a couple of quick questions:

1/ If you have multiple programs within a task, does each main program get executed sequentially?

2/ Is it possible to have 'global' subroutines? I have 3 different stations in my cell, each using the same stepper/drive. I wanted to create 3 programs to clarify the code, however, the routines to home, execute records, etc. are the same for each drive. Is there a way to have a 'global' subroutine, or does the subroutine code need to exist within each separate program?

Thanks!
 
In the contrologix world, the hierarchy is Task > Program > Routine

1) You schedule Programs by right-click on Task in the Controller Organizer window.

2) Yes, Logix's Add-On-Instruction is perfect for this situation.
 
In the contrologix world, the hierarchy is Task > Program > Routine

1) You schedule Programs by right-click on Task in the Controller Organizer window.

2) Yes, Logix's Add-On-Instruction is perfect for this situation.


Thank you for the quick response. I have set up a user datatype for the controller, which basically just encapsulates all of the I/O lines for the device. Are you able to use the same UDT for inputs and outputs to the Add-on instruction? If so, this seems like it could work quite well.


Thanks!
 
Thank you for the quick response. I have set up a user datatype for the controller, which basically just encapsulates all of the I/O lines for the device. Are you able to use the same UDT for inputs and outputs to the Add-on instruction? If so, this seems like it could work quite well.


Thanks!

Yes, but you'll have to program rungs to populate the UDT's inputs from real inputs and the UDT's output to real outputs.
 
An Add-On Instruction could be described as a UDT with logic attached to it.

Instead of creating a UDT, create an Add-On Instruction with exactly the same elements. You create the tags exactly the same way, the only difference is instead of it being a "user defined" tag type, it's an "add-on defined" tag type. Makes no difference to how you define it though.

The only other thing that will be different is that you will have to put a little more thought into whether each element of your data type is an input, and output, an in-out parameter, or a local parameter.

In general:
- Input: signals from the field, or data entry from HMI's or elsewhere in the PLC
- Outputs: commands to field equipment, or HMI indication, or triggers for external PLC logic
- In-Out: data types like STRINGS etc. An In-Out tag does not strictly speaking exist within the data structure; instead you create a tag in the greater PLC, and then just point the AOI to that tag. It uses that external tag as that element of your data structure
- Local parameter: control bits etc that do not need to talk to anything outside the AOI; they're purely for making your AOI function internally

Of course, you *can* directly copy a UDT to part of an AOI, or copy part of an AOI directly to a UDT, as long as your data structure is *identical*, but you've got to be very precise with it or you could wind up with some very unexpected results. And double handling the data seems a little pointless to me :)
 
Thanks for the replies. Much appreciated. I did mess around a bit with AOI, and I think I figured them out. I didn't quite understand them when I first talked about passing then receiving (explicitly) the same UDT. I didn't realize that I could just pass my UDT, and process it within (I thought I also had to 'return' the UDT so it would update).

Thanks again, all!
 
hi friends,

i open the studio 5000 for searching 1756RM2 controller, i can't find it, so how to choose that module, please suggest

thanks
regards
tamil
 
hi friends,

i open the studio 5000 for searching 1756RM2 controller, i can't find it, so how to choose that module, please suggest

thanks
regards
tamil
Please start a new thread since this is not related to the OP.

List the complete model of the PLC, RM2 is a redundancy module, not a PLC.
 
thanks harryting,

if i am try to open the rslogix 5000 v16.04 program backup in studio 5000 v21,at the time, its shows install logix designer support for firmware revison v16.04 otherwise cancel.

so i need firmware 16.04, please send the link sir,thank you.
 
thanks harryting,

if i am try to open the rslogix 5000 v16.04 program backup in studio 5000 v21,at the time, its shows install logix designer support for firmware revison v16.04 otherwise cancel.

so i need firmware 16.04, please send the link sir,thank you.
If you really want to receive any help, start a new thread.
 

Similar Topics

Hi all, I recently was upgraded from Win7 machine to a Win10 machine with lots of horsepower. Last Friday, I tried exporting a routine and when I...
Replies
9
Views
4,645
i have factorytalk application (.mer) and rslogix 5000 application(.acd) and the are some problems in factorytalk application some trends are not...
Replies
2
Views
3,892
Hi, how do I convert 2x Integer registers to a Real? The two integers are from Modbus registers that contain a floating point value, I need to...
Replies
2
Views
67
What is the best way to extract the hour and minute from the register that comes from Yaskawa VFD. In studio 5000 I have a register saved as INT...
Replies
3
Views
90
I have an Allen Bradley temperature switch that I am trying to use in studio 5000. I am getting the message "Unable to interpret the IODD file"...
Replies
0
Views
54
Back
Top Bottom