
adccommunitymod (AutomationDirect) asked a question.
Created Date: November 01,2007
Created By: kevin91172
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
PLC 06 I am trying to program a 2 hour oven batch timer using 1 60 timer that counts up a minute counter that counts up a hour counter. Next I want to display this 2 hour count down on a EZ-T10C-F HMI.Now how can I not put preset minutes the counter and just put 2 in the hour counter for this thing to work. I am just confusing myself. Any suggestions? The below is just not working for me. // Rung 1 // Address 0 STR SP0 LD K400 OUT V700 LDA O2000 OUT V701 LD K0 OUT V703 OUT V704 OUT V706 // Rung 2 // Address 9 STRN T0 TMRF T0 K1000 // Rung 3 // Address 13 STR T0 LD V3005 BTOR DIVR R4.0949998 RTOB BCD OUT V1400 // Rung 4 // Address 22 STRN T0 TMRF T1 V1400 // Rung 5 // Address 25 STR X30 SET C0 // Rung 6 // Address 27 STR CT1 AND CT3 RST C0 // Rung 7 // Address 30 STRN T1 ANDNE TA1 K0 AND X1 AND V2002 K5000 OUT Y0 // Rung 8 // Address 37 STR V2000 V3002 AND C0 STRN C0 OR T2 TMRA T2 K20 // Rung 9 // Address 45 STR T2 STRN C0 OR CT0 CNT CT0 V5000 // Rung 10 // Address 50 STR CT0 STR CT3 CNT CT3 K3 // Rung 11 // Address 55 STR CT0 STRN C0 CNT CT1 V5002 // Rung 12 // Address 59 STR SP1 ANDN CT3 LD V5000 SUB CTA0 OUT V4000 // Rung 13 // Address 64 STR SP1 LD V5002 SUB CTA1 OUT V4002 // Rung 14 // Address 68 END // Rung 15 // Address 69 NOP #BEGIN ELEMENT_DOC "X1 ", " ", " ", "WE HAVE AIR FLOW " "X2 ", " ", " ", "ELEMENT TEMPERATURE TO HIGH " "X30 ", " ", "TOUCH SCREEN ", "START CYCLE " "X31 ", " ", "TOUCH SCREEN ", "RESET CYCLE " "X41 ", " ", "TOUCH SCREEN ", " " "Y0 ", " ", " ", "HEATERS " "Y1 ", " ", " ", "CYCLE IS DONE " "C0 ", " ", " ", "START CYCLE " "C1 ", " ", " ", "RESET CYCLE " "T0 ", " ", " ", "PID LOOP 1 TIMER #1 " "T1 ", " ", " ", "PID LOOP 1 TIMER #2 " "CT0 ", " ", " ", "Minute counter " "CT1 ", " ", " ", "Hour counter " "CT2 ", " ", " ", "second counter " "V2000 ", " ", " ", "OVEN TEMPERATURE " "V2002 ", " ", " ", "ELEMENT TEMPERATURE " "V3002 ", " ", " ", "OVEN TEMPERATURE SET POINT " #END
Created Date: November 02,2007
Created by: Bob S BN
If you just need a 2 hour batch counter, did you look at the other timer types available?
If you choose a "TMRA " accumulating timer, reserve 2 consecutive words for the 8 digit preset and counting areas, you can count for 2,777 hours if needed.
Much less confusing. Will that work for you?
Bob
Created Date: November 02,2007
Created by: kevin91172
Ok Bob,that will work for me.What will now be an easy way to display on a HMI ____ hours Remaining(V4000) ____ Minutes remaining(V4002)?My code below is not working for me !
PLC 06
// Rung 1
// Address 0
STR SP0
LD K400
OUT V700
LDA O2000
OUT V701
LD K0
OUT V703
OUT V704
OUT V706
// Rung 2
// Address 9
STRN T0
TMRF T0 K1000
// Rung 3
// Address 13
STR T0
LD V3005
BTOR
DIVR R4.0949998
RTOB
BCD
OUT V1400
// Rung 4
// Address 22
STRN T0
TMRF T1 V1400
// Rung 5
// Address 25
STR X30
SET C0
// Rung 6
// Address 27
STR T2
RST C0
// Rung 7
// Address 29
STRN T1
ANDNE TA1 K0
AND X1
AND V2002 K5000
OUT Y0
// Rung 8
// Address 36
STR V2000 V3002
AND C0
STRN C0
OR T2
TMRA T2 V4004
// Rung 9
// Address 43
STR C0
LD V4004
SUB TA2
DIV K600
OUT V4000
// Rung 10
// Address 48
STR C0
LD V4000
DIV K600
OUT V4002
// Rung 11
// Address 52
END
// Rung 12
// Address 53
NOP
#BEGIN ELEMENT_DOC
"X0 ", " ", " ", "TEMPERATURE IS GOOD "
"X1 ", " ", " ", "WE HAVE AIR FLOW "
"X2 ", " ", " ", "ELEMENT TEMPERATURE TO HIGH "
"X30 ", " ", "TOUCH SCREEN ", "START CYCLE "
"X31 ", " ", "TOUCH SCREEN ", "RESET CYCLE "
"X41 ", " ", "TOUCH SCREEN ", " "
"Y0 ", " ", " ", "HEATERS "
"Y1 ", " ", " ", "CYCLE IS DONE "
"C0 ", " ", " ", "START CYCLE "
"C1 ", " ", " ", "RESET CYCLE "
"T0 ", " ", " ", "PID LOOP 1 TIMER #1 "
"T1 ", " ", " ", "PID LOOP 1 TIMER #2 "
"T2 ", " ", " ", "OVEN TIMER #1 "
"V2000 ", " ", " ", "OVEN TEMPERATURE "
"V2002 ", " ", " ", "ELEMENT TEMPERATURE "
"V3002 ", " ", " ", "OVEN TEMPERATURE SET POINT "
"V4000 ", " ", " ", "Minutes Left "
"V4002 ", " ", " ", "Hours Left "
"V4004 ", " ", " ", "Oven timer preset "
#END
Created Date: November 02,2007
Created by: Bob S BN
Kevin, I didn't import this to try, but these changes might help. Perhaps C0 wasn't on when you wanted to see values. Also, once seconds are converted to minute, you only need to divide by 60 to get hours.
// Rung 9
// Address 43
STR C0 change C0 to sp1, always on
LD V4004
SUB TA2
DIV K600
OUT V4000
// Rung 10
// Address 48
STR C0
LD V4000
DIV K600 change k600 to k60
OUT V4002
Good Luck, Bob
Created Date: March 21,2008
Created by: Tanno
Could someone help me with this to run a DL05?
Created Date: March 21,2008
Created by: milldrone
Tanno,
I can't help you because rung # 3 uses binary to real and real to binary instructions both of which are not supported by the DL05. But the good news is. If you post what you need,(are you using an eztouch?)(are you trying to make a 2 hour timer?) maybe somebody smarter than myself can help.
Vaughn
Created Date: March 22,2008
Created by: Tanno
I need a count-down timer that works on the DL05 and the EA7-S6C C-More panel.
I 've tried and tried and tried. I'm new to PLC programming. I'm doing this one from scratch....never done that before.
I 've tried using the UDC in DirectSoft32 4.0 and no luck. It doesn't work like the manual and online instruction say.
So, I tried using a standard timer and subtracting the entered value from the timer value and I get numbers, but not accurate and they are all over the place.
I 've divided it by 10, 100, 60....nothing it getting me what I need.
I'll probably start a new thread asking for this because it doesn't have to do with the 06.
Created Date: March 22,2008
Created by: hanziou
Tanno,
I have only used the EZ-touch panels (not the C-more) but something that you may need to check is the number format.
You say that you are new to PLC programming. Do you understand BCD numbers? If you display BCD numbers as if they were 'binary ' numbers, then it will seem that your subtraction is inaccurate.
The Koyo (Automation Direct) PLCs use BCD for timers, counters and native math. When you create tags for the HMI be sure that you specify that they match the format of the Vmem* that you are looking at. That should be an editable property of tag. (Also make sure that display object in the HMI uses the correct fromat.)
*Vmem is a container only. You can look at/use the value in a particular Vmem (e.g. v2000) as binary, or BCD, or bits, etc. Just make sure that you use it consistently.
Created Date: March 22,2008
Created by: Tanno
Yes, that's what I 've done. I 've made sure that BCD was and is used everywhere.
Exception: Input for time is entered by typing in the number. And I'm unsure of the format that it's using.
The other thing, I finally got a countdown timer to work that's accurate. BUT, I can't seem to get the secs to roll over to mins and visa-versa. And the only way I could think of getting it working is I had to setup a "loading " sequence. This loads the UDC with the value that I want to countdown.
Is there a faster way to load this? I'm using sp5 (.01 secs) as the rate to load it.
At the moment, I only have one input for time and I'm using that for the secs. I haven't yet figured out any more of it.
FYI, I 've been at this for 12-hrs straight for the last three days.
Created Date: March 22,2008
Created by: milldrone
Tanno,
I just remembered a post by Bernie Carlton. At http://forum1.automationdirect.com/board/Forum1/HTML/001746.html
The response from the original poster and others was positive about the outcome.
Vaughn
Created Date: March 22,2008
Created by: Tanno
Well, here's what I 've got so far.
PLC 05
// Rung 1
// Address 0
#BEGIN COMMENT
"Start loading counter until it equals input vlaue (V1400). "
#END
STR X100
ANDN CTA0 V1400
ANDN X101
OUT C5
// Rung 2
// Address 5
#BEGIN COMMENT
"Generating load pulse. "
#END
STR C5
OR CT0
AND SP5
ANDN CT0
OUT C2
// Rung 3
// Address 10
#BEGIN COMMENT
"Generating count pulse. "
#END
STR SP4
AND X101
OUT C1
// Rung 4
// Address 13
STR C2
STR C1
STR X102
UDC CT0 K300
// Rung 5
// Address 19
#BEGIN COMMENT
"Compare current count value with input value (V1400) and stop loading cycle when "
"equal. "
#END
STRE CTA0 V1400
OUT C6
// Rung 6
// Address 22
#BEGIN COMMENT
"Compare current count value and stop count cycle when equal to 0. "
#END
STRE CTA0 K0
OUT C7
// Rung 7
// Address 25
#BEGIN COMMENT
"Convert current count value (CTA0) to minutes. V1200 is the value to display as minutes. "
#END
STR SP1
LD CTA0
DIV K60
OUT V1200
// Rung 8
// Address 29
END
// Rung 9
// Address 30
NOP
#BEGIN ELEMENT_DOC
"UB ", "co ", " ", " "
"X100 ", "Load Start ", " ", " "
"X101 ", "Count Start ", " ", " "
"X102 ", "Count Reset ", " ", " "
"C1 ", "Count Pulse ", " ", " "
"C2 ", "Load Pulse ", " ", " "
"C5 ", "Load ", " ", " "
"CT0 ", "Counter ", " ", " "
#END