Experimenting with CCW (v.22): PT parameter in Timer

AutomationTechBrian

Lifetime Supporting Member
Join Date
Jul 2013
Location
St. Cloud, MN
Posts
669
I confess, I always have a little frustration trying to accomplish tasks in CCW that are simple in Studio 5000. My latest task is with timers:

I'm using 3 inputs for a selector switch that uses BCD to give me 8 different choices for cycle times. I can either use 1 timer to create a .TT equivalent (I know how) and move the timer values into the PT field (if it's possible), or use 8 different timers and activate them with a compare. It doesn't really matter which one I choose, except that I don't know how to move a value into the PT parameter.

Can I use MOV to change a Timer's PT value?
 
I've only used CCW a little bit - but won't CCW accept a variable in the preset parameter on a timer? I'm not sure of the effect of increasing a preset value on a timer that has already timed out. Does IEC define how this works?

I do remember some awkwardness in converting a number like an interface REAL that is in seconds to a TIME data type that can be fed into the block. Can't remember what I did right now (senile?).

My usual sermon:
The 'ease' of Logix 5000 may not always be a good thing. IEC data type purists like explicitly typed function blocks that make you spell out each conversion. It forces the programmer to consider the suitability of the data type for the purpose. My C compiler only allows certain conversions without the use of a type 'cast' designation. The compiler was designed to do that for valid reasons. The ADA programming language carried it to what may be a ridiculous extreme.
 
I don't know yet... everything I'm attempting has a catch. I haven't figured out the help for commands yet. F1 does nothing. I'm searching for a manual.

It's the little things... I want to use a counter for creating a sequence. I figured out the one-shot, because it looks like Siemen's one-shot (P). But now I'm searching on the right way to reset the sequence variable... am I moving a 0? Resetting? Clearing? Setting? ...Ugh.

I'm sure a little time will help.
 
The time value in IEC timers is as follows:
for example 21 mins 23 seconds 400 ms
is 1283400 decimal
in other words 21 X 60 = 1260 + 23 seconds then 400 ms
It appears that the last 3 digits of 1283400 are effectively the ms
so the decimal value is in ms.
so the problem (depending on your IDE) will be either you copy a time type var into the PT or most IDE's have a Dint to time Function or if you use some others that with legacy type variables write directly to that variable (not symbolic).
Not sure you can use COP function into a time variable.

IEC time.png
 
Building on what @parky said, TIME data types are 32-bit integers that express durations in milliseconds. CCW has a conversion instruction from integer data types (and Boolean and real and string!) to time:

Untitled.png
 

Similar Topics

I've wanted to experiment with this for a while, and this morning was the perfect time with the cold, heavy rain. I have a 1756-DNB in my test...
Replies
6
Views
2,716
Hey out there, I am trying to build an alarm que in CCW. I have got the FFL and FFU working, however the string that goes with the alarm can't be...
Replies
38
Views
434
Hello. Has anyone ran into an issue with HSC on 2080-LC20. It run a cut off press and every so often after resetting to 0 it does not count...
Replies
1
Views
105
I am running CCW 13 trying to upload to a micro 820 vers.12 I get an output message OPC server is unable to load project controller. Please help!
Replies
5
Views
273
How to retain Values in CCW software? I am using CCW software and I can not find the Retain function in this software. Not even local or global...
Replies
2
Views
188
Back
Top Bottom