constant CPT instruction?

PLC_JoeD

Member
Join Date
Dec 2013
Location
Green Bay
Posts
7
I am currently converting a PLC5 over to a Compactlgx. I have the logic converted, am in the middle of making all my new tags and have made some AOI's (my first time). This is for a small tank farm process.

My question is:

In the PLC5, there are Block Transfers all over for the analog signals from the level transmitters. These are not needed in RS5k.

But, there a lot of conditional XIC .DN bits from the BTR and BTW's that control some CPT instructions.

Do I need to program a "scan rate" timer to trigger these CPT's? Or can i just have a straight rung to a CPT? I didn't know if that will load up the CPU not having it pulse.

I hope I explained it well. Thanks!!
 
In other words, I have this:

BTW.DN

-------||-------------------------------------------|CPT|-----------------


Can i have this:

----------------------------------------------------|CPT|-----------------

Or do I have to do this:


Flashing_Timer.DN

--------||-------------------------------------------|CPT|---------
 
I take it the Block Transfers are not needed in your CompactLogix program because they are local I/O? I'll assume this for now. It would be helpful to know what data the CPT is actually using for its sources and that data's relationship to the BT.

From my past experience, a BTR done bit would trigger a CPT statement in order to ensure that valid data was used in the compute statement. In other words, the data is in a transitional state while a block transfer read is being executed so it's not necessarily valid until the block transfer has completed. This occurs asynchronous to the program scan. The DN bit essentially ensures that the data block contains complete, updated data. If this is your situation, there's no need for any condition prior to the CPT instruction as the BTR has been removed. Otherwise, I'd like to get a little more detail.

Not sure why a BTW done bit would be used for a CPT instruction.
 
Last edited:
The Logix5000 Controllers General Instructions Reference Manual:

http://literature.rockwellautomation.com/idc/groups/literature/documents/rm/1756-rm003_-en-p.pdf

says about the CPT :
The execution of a CPT instruction is slightly slower and uses more memory than the execution of the other compute/math instructions. The advantage of the CPT instruction is that it allows you to enter complex expressions in one instruction.


I have often just connected to the left vertical rail and not noticed any execution delays because of it.
 
There is no need to wait for new data in the CompactLogix. The CompactLogix has a screaming fast processor in it, so even if you recompute the analog scaling before the IO updates its still going to have a higher throughput than the PLC/5 did.

The CPT instruction is slower than basic math instructions for a single operation so if you are doing just one math operation then use the appropriate math instruction (ADD, SUB, MUL, DIV, XPY, etc) for that. But if you are doing two or more operations then use CPT as it gains back the speed by skipping the extra memory store and fetch of intermediate results.

If you are scaling analog IO then I suggest you download and use the SCP add on instruction instead of using CPT. This AOI works similar to the SCP instruction on SLC500 platforms and furnishes an easy to use and easy to read scaling function.
 
Thanks for the replies!

@RonJohn - Some of these analog inputs were NOT local. There's a CNET loop with some Flex I/O that is used. Maybe that's another reason for the BT.

@TConnolly - The CPT's are about 5 elements long so I would need them. But I will look at the AOI for the Scaling. Thanks!
 
@RonJohn - Some of these analog inputs were NOT local. There's a CNET loop with some Flex I/O that is used. Maybe that's another reason for the BT.

Were the analog inputs on Flex I/O via ControlNet back when it was a PLC5? If so, I'd say you'll still need to use a block transfer type MSG instruction to collect that data. This presents a whole other set of circumstances.
 
It is currently still the PLC5 and CNET Flex I/O (in the same cabinet. Figure that one out. I think they expanded and maybe it was cheaper to get Flex I/O versus local PLC5 cards and larger chassis)

Anyway, what I plan to do is replace the CNET modules with ENET and still use the Flex. This is just to minimize the hardware switch out and wiring. I don't think I need a MSG for the ethernet do i?
 
I have not worked with analog Flex I/O over EtherNet yet so I cannot give you specifics. My suspicion is that you'll still need a block transfer. The telling factor will be how the processor views the I/O module.

In general terms, if the analog module can only be viewed as one word of input data & one word of output data then a block transfer will still be necessary. This was the case with old 1771 I/O, hence the need for BT. If you can configure the module in the Logix5000 I/O directory for the number of channels you have, etc. and a tag is created with a data element for each I/O channel then you are in the clear.

If you post the exact model numbers for what you're using, maybe someone can give you more specific answers.
 
Last edited:
In the I/O tree, in each analog module, under the config tab, there are all 8 channels.

You can toggle them OFF, 4-20, 0-10 (0-20), -10 to +10. And there was a tag generated for the unit in the Controller Tags.

So I think I'm in the clear. That was how I understood it.
 
Last edited:

Similar Topics

I am new to using Functional Block Diagram (FDB) language programming in CCW. I want to set a variable to a constant if a contact is closed...
Replies
7
Views
431
Hello all, this is my first time working with a PLC and dealing with hardware, so please have patience with me. I have an electric rod-style...
Replies
21
Views
3,049
Hello, I have posed a similar question before, but the DB then provided me with pre-allocated "spares". In this instance I need to declare a...
Replies
13
Views
4,141
Hello gentlemen, Why does this work: VAR CONSTANT SIZE_OF_dutEVENT : UDINT := SIZEOF (DUT_Event); MAX_SIZE_OF_dutEVENT : UDINT := 5...
Replies
2
Views
1,625
Hi! I know there is a lot of skilled people with Schneider somachine in this forum, so i have to ask something. How and why do you use constant...
Replies
4
Views
2,215
Back
Top Bottom