A few Function Block Instructions

BachPhi

Member
Join Date
Dec 2007
Location
Los Alamos
Posts
640
I'd like to translate a few ladder instructions to FB. Here is what I have:


Ladder_Instruction.png


FB_Instruction.png


Does it looks right to you? If you have a better idea of replacing the MUL to a MOV or COPY equivalent. TIA.
 
It seems ok to me, please note that you have to modify PIDE instruction to make it work, Normally I use Progautoreq=1, Progmanualreq=0 and use SPProg as the setpoint. CVEU is your output.
 
Also you don't need to use a MUL with a 1 factor just to move a value. You can connect the two tags directly together.
 
It seems ok to me, please note that you have to modify PIDE instruction to make it work, Normally I use Progautoreq=1, Progmanualreq=0 and use SPProg as the setpoint. CVEU is your output.

in my currrent PID, I latch SoftwareManual bit in manual mode and unlatch it when it's in cycle. for PIDE, do I need to set both ProgAutoReq=1 AND ProgManReq=0? to achieve the same thing?
 
Take a step back

First, you need to know that PID (ladder) and PIDE (function block) are not the same instruction in ControlLogix.

I'm going to simplify; this is far to big a topic to be effectively addressed in a single forum post.

A concise summary of the differences between the rate-of-error PIDE and the magnitude-of-error PID instructions is in the RA Knowledgebase article 53929.

The two instructions also execute differently, which may be leading you to try to understand the trigger logic better.

The ladder logic PID executes whenever the rung conditions are True and the rung is scanned by the controller. To function correctly with respect to time, the configured update rate and the actual rate of the rung execution must be made the same.

To execute the ladder PID instruction periodically, programmers tend to put it into a subroutine that is called by a repeating Timer or by another feature of the controller like a timed interrupt. They then configure the "Loop Update Time" parameter to be equal to the preset of that timer.

In your case, it looks like you're executing the ladder PID every time an Input module updates its value. So the execution rate of the PID instruction is the same as the RPI or maybe the Real Time Sample rate of the input module.

The Function Block PIDE generally executes by adopting the execution rate of the Task it runs under.

When the PIDE is set for the default Periodic Mode, you will see that you don't have to define a "Loop Update Time". The PIDE knows how fast it's updating because it knows how often the Task that runs it is executing.

Again, this is an over-simplified explanation. If you do things like put the PIDE into the Continuous Task, it gets harder.

I recommend against attempting to duplicate the timestamp trigger method from your ladder-logic PID when configuring your function block PID.

The .EnableIn pin for PIDE does not do the same thing as the ladder preconditions for PID.
 
Ron,

Yes, the key here is my PID Loop UpdateTime = RTS of the analog mdule. I chose this over Periodic and timer mode , I thought it is more logical and more efficient.

for PIDE, can I use the RealTime mode and set it equal to my RTS analog module?

This is my first attempt to use FB, pardon me for my ignorance.
 

Similar Topics

Hello all, I'm a new member here. I've joined as I want to learn about PLC programming. I've got a few questions to begin with. To get me...
Replies
37
Views
4,561
Hi, it's been a few years since I have posted in this group. I'm looking for a product of some sort that can connect a handful of I/O's a few...
Replies
13
Views
4,358
Any advice on below issue? ➢ IFix 5.0 with USB Hardware Dongle License Standalone application connected to RX3i PLC units via Ethernet (bridged...
Replies
1
Views
1,621
Good Afternoon , I'm having my first experience with a Guardmaster Configurable Safety Relay 440C-CR30. So far , I really like the...
Replies
1
Views
1,626
Good Evening , We have a few AB PLC-5 PLC's left . I took notice that we do not have and PCMCIA slots in our laptops . Do they make any...
Replies
12
Views
2,527
Back
Top Bottom