
adccommunitymod (AutomationDirect) asked a question.
Created Date: December 13,2006
Created By: marksji
**** 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.****
I 've got some code written for the 260 CPU that is supposed to keep track of widgets made for the current shift and the last shift. In an effort to make things universal the customer enters the hour and minute each shift starts for 1, 2, or 3 shifts. At the shift start the widgets this shift becomes the widgets last shift and I 0 the widgets this shift count. I thought this would be a simple easy task, and it appears to work sitting here at my desk, but the two different customer locations where I 've tried it report the same thing; widgets this shift works great and counts up during the shift as each widget is made, at the start of the next shift it gets reset to 0, but widgets last shift stays 0 forever. I added a count to see how many times the line that moves widgets this shift to widgets last shift executes and found that during a 24hr period the shift 1 start and shift 2 start occurred 3 times each (basically 7am and 7pm each happened 3 times in 24 hours?!?!?!). Below is a code snip from my project; the VMEMs and C bits are not used anywhere else in the program (double and triple checked). Am I missing something or is the internal PLC clock screwed up? PLC 260 // Rung 1 // Address 0 STR C15 INC V7450 // Rung 2 // Address 3 STRE V7770 V7452 ANDE V7767 V7453 SET C1760 // Rung 3 // Address 8 STRE V7770 V7454 ANDE V7767 V7455 SET C1761 // Rung 4 // Address 13 STRE V7770 V7456 ANDE V7767 V7457 SET C1762 // Rung 5 // Address 18 STRPD C1760 AND C1763 LD V7450 OUT V7451 LD K0 OUT V7450 INC V7460 // Rung 6 // Address 26 STRPD C1761 AND C1764 LD V7450 OUT V7451 LD K0 OUT V7450 INC V7461 // Rung 7 // Address 34 STRPD C1762 AND C1765 LD V7450 OUT V7451 LD K0 OUT V7450 INC V7462 // Rung 8 // Address 42 STR C1760 TMR T64 K900 // Rung 9 // Address 46 STR T64 RST C1760 // Rung 10 // Address 48 STR C1761 TMR T65 K900 // Rung 11 // Address 52 STR T65 RST C1761 // Rung 12 // Address 54 STR C1762 TMR T66 K900 // Rung 13 // Address 58 STR T66 RST C1762 // Rung 14 // Address 60 END // Rung 15 // Address 61 NOP #BEGIN ELEMENT_DOC "C15 ", "New Widget Made ", "PD ", " " "C1760 ", "Do ShiftChange1 ", " ", " " "C1761 ", "Do ShiftChange2 ", " ", " " "C1762 ", "Do ShiftChange3 ", " ", " " "C1763 ", "Shift 1 Enable ", " ", " " "C1764 ", "Shift 2 Enable ", " ", " " "C1765 ", "Shift 3 Enable ", " ", " " "T64 ", "Shift1 DeBounceT ", " ", " " "T65 ", "Shift2 DeBounceT ", " ", " " "T66 ", "Shift3 DeBounceT ", " ", " " "V7310 ", "Bales last 5 min ", " ", " " "V7350 ", "Bales last min ", " ", " " "V7450 ", "WidgetsThisShift ", " ", " " "V7451 ", "WidgetsLastShift ", " ", " " "V7452 ", "ShiftChng1 Hr ", " ", " " "V7453 ", "ShiftChng1 Min ", " ", " " "V7454 ", "ShiftChng2 Hr ", " ", " " "V7455 ", "ShiftChng2 Min ", " ", " " "V7456 ", "ShiftChng3 Hr ", " ", " " "V7457 ", "ShiftChng3 Min ", " ", " " "V7460 ", "Num of Shift 1s ", " ", " " "V7461 ", "Num of Shift 2s ", " ", " " "V7462 ", "Num of Shift 3s ", " ", " " "V7767 ", "PLC MINUTE ", " ", " " "V7770 ", "PLC HOUR ", " ", " " #END
Created Date: December 13,2006
Created by: Tech Guy
It seems to work on my D2-260, firmware 2.2. I'll update my firmware tomorrow and try again.
Created Date: December 22,2006
Created by: marksji
Just wanted to update this thread with my solution.
It turns out my C-More screen was over-writing the PLC system VMEMs that hold the date/time.
Thanks TechGuy for all your help with this one!
Created Date: December 13,2006
Created by: marksji
I 've got some code written for the 260 CPU that is supposed to keep track of widgets made for the current shift and the last shift. In an effort to make things universal the customer enters the hour and minute each shift starts for 1, 2, or 3 shifts. At the shift start the widgets this shift becomes the widgets last shift and I 0 the widgets this shift count.
I thought this would be a simple easy task, and it appears to work sitting here at my desk, but the two different customer locations where I 've tried it report the same thing; widgets this shift works great and counts up during the shift as each widget is made, at the start of the next shift it gets reset to 0, but widgets last shift stays 0 forever.
I added a count to see how many times the line that moves widgets this shift to widgets last shift executes and found that during a 24hr period the shift 1 start and shift 2 start occurred 3 times each (basically 7am and 7pm each happened 3 times in 24 hours?!?!?!).
Below is a code snip from my project; the VMEMs and C bits are not used anywhere else in the program (double and triple checked). Am I missing something or is the internal PLC clock screwed up?
PLC 260
// Rung 1
// Address 0
STR C15
INC V7450
// Rung 2
// Address 3
STRE V7770 V7452
ANDE V7767 V7453
SET C1760
// Rung 3
// Address 8
STRE V7770 V7454
ANDE V7767 V7455
SET C1761
// Rung 4
// Address 13
STRE V7770 V7456
ANDE V7767 V7457
SET C1762
// Rung 5
// Address 18
STRPD C1760
AND C1763
LD V7450
OUT V7451
LD K0
OUT V7450
INC V7460
// Rung 6
// Address 26
STRPD C1761
AND C1764
LD V7450
OUT V7451
LD K0
OUT V7450
INC V7461
// Rung 7
// Address 34
STRPD C1762
AND C1765
LD V7450
OUT V7451
LD K0
OUT V7450
INC V7462
// Rung 8
// Address 42
STR C1760
TMR T64 K900
// Rung 9
// Address 46
STR T64
RST C1760
// Rung 10
// Address 48
STR C1761
TMR T65 K900
// Rung 11
// Address 52
STR T65
RST C1761
// Rung 12
// Address 54
STR C1762
TMR T66 K900
// Rung 13
// Address 58
STR T66
RST C1762
// Rung 14
// Address 60
END
// Rung 15
// Address 61
NOP
#BEGIN ELEMENT_DOC
"C15 ", "New Widget Made ", "PD ", " "
"C1760 ", "Do ShiftChange1 ", " ", " "
"C1761 ", "Do ShiftChange2 ", " ", " "
"C1762 ", "Do ShiftChange3 ", " ", " "
"C1763 ", "Shift 1 Enable ", " ", " "
"C1764 ", "Shift 2 Enable ", " ", " "
"C1765 ", "Shift 3 Enable ", " ", " "
"T64 ", "Shift1 DeBounceT ", " ", " "
"T65 ", "Shift2 DeBounceT ", " ", " "
"T66 ", "Shift3 DeBounceT ", " ", " "
"V7310 ", "Bales last 5 min ", " ", " "
"V7350 ", "Bales last min ", " ", " "
"V7450 ", "WidgetsThisShift ", " ", " "
"V7451 ", "WidgetsLastShift ", " ", " "
"V7452 ", "ShiftChng1 Hr ", " ", " "
"V7453 ", "ShiftChng1 Min ", " ", " "
"V7454 ", "ShiftChng2 Hr ", " ", " "
"V7455 ", "ShiftChng2 Min ", " ", " "
"V7456 ", "ShiftChng3 Hr ", " ", " "
"V7457 ", "ShiftChng3 Min ", " ", " "
"V7460 ", "Num of Shift 1s ", " ", " "
"V7461 ", "Num of Shift 2s ", " ", " "
"V7462 ", "Num of Shift 3s ", " ", " "
"V7767 ", "PLC MINUTE ", " ", " "
"V7770 ", "PLC HOUR ", " ", " "
#END