Support Forums
Counters

Hi

I am currently trying to set up a program with counter inputs from an energy meter. I have setup the inputs fine and also used +CV command to accumulate the kWh.

What i want to do now is to setup another schedule to calculate the daily kWh reading whereby I read the counter input every second and add this to a +cv and run another schedule at 1 day interval to give the one daily reading.

However if i reset the counter input in one schedule the other schedule does not see the counts. here is a copy of the program created with delogger 5 DT85 series 3.

'JOB=JOB1
'COMPILED=2012/12/14 00:11:54
'TYPE=dt80
DT=\d
BEGIN"JOB1"
CATTN
'Spans and polynomial declarations
S1=0,1000,0,10"W/m2"
S2=0,60,0,100"m/sec"
S3=0,360,0,100"Degrees"
S4=0,1,0,100"kWh"
'Thermistor declarations
'Switches declarations
'Parameter declarations
'Global declarations
RS1S
'schedule definition
RA("B:",ALARMS:OV:100KB,DATA:OV:100MB)15M LOGONA GA
1TT("TCP01")
1+TT("TCP02")
1-TT("PV01")
2
TT("PV02")
2+TT("PV03")
2-TT("PV04")
3TT("JB01")
3+TT("JB02")
3-TT("JB03")
4
TT("JB04")
4+TT("AAT")
5*L(S2,"WS01")
5+L(S3,"WD01")
6V(S1,"RS01")

here is the counter inputs
3C(R,"M1",W,+=1CV)
4C(R,"M2",W,+=2CV)
1CV(S4,"EM01")
2CV(S4,"EM02")

ALARM1(3ST("Logon")><8.,19.)"Logon"{[LOGON]}
ALARM2(3ST("Logoff")<>8.,19.)"Logoff"{[LOGOFF]}
'schedule definition
RB("B:",ALARMS:OV:100KB,DATA:OV:1MB)1S LOGONB GB

here is the counter inputs
3C(R,"M1-1sec",W,+=5CV)
4C(R,"M2-1sec",W,+=6CV)

6V(S1,"RS01",+=10CV)
ALARM3(3ST("Logon")><8.0000,19.0000)"Logon"{[LOGON]}
ALARM4(3ST("Logoff")<>8.0000,19.0000)"Logoff"{[LOGOFF]}
'schedule definition
RC"PV Daily"("B:",ALARMS:OV:100KB,DATA:OV:50MB)1D LOGONC GC
20SV
21SV
22SV

here is the counter inputs
5CV(S4,"EM01 Daily",R)
6CV(S4,"EM02 Daily",R)

10CV("RS01 Daily Kw/h",R)
5L(S2,"WS01 Daily",AV)(MX)
1
TT("TCP01 Daily",AV)(MX)
1+TT("TCP02 Daily",AV)(MX)
1-TT("PV01 Daily",AV)(MX)
2TT("PV02 Daily",AV)(MX)
2+TT("PV03 Daily",AV)(MX)
2-TT("PV04 Daily",AV)(MX)
3
TT("JB01 Daily",AV)(MX)
3+TT("JB02 Daily",AV)(MX)
3-TT("JB03 Daily",AV)(MX)
4TT("JB04 Daily",AV)(MX)
4+TT("AAT Daily",AV)(MX)
5
L(S2,"WS01 Daily",AV)(MX)
ALARM5(3ST("Logon")><8.0000,19.0000)"Logon"{[LOGON]}
ALARM6(3ST("Logoff")<>8.0000,19.0000)"Logoff"{[LOGOFF]}
END
'end of program file

can you advise how i might program this so i can record accumulated kWh and also a daily kWh.

thank you
Stephen

Hi I am currently trying to set up a program with counter inputs from an energy meter. I have setup the inputs fine and also used +CV command to accumulate the kWh. What i want to do now is to setup another schedule to calculate the daily kWh reading whereby I read the counter input every second and add this to a +cv and run another schedule at 1 day interval to give the one daily reading. However if i reset the counter input in one schedule the other schedule does not see the counts. here is a copy of the program created with delogger 5 DT85 series 3. &#039;JOB=JOB1 &#039;COMPILED=2012/12/14 00:11:54 &#039;TYPE=dt80 DT=\d BEGIN&quot;JOB1&quot; CATTN &#039;Spans and polynomial declarations S1=0,1000,0,10&quot;W/m2&quot; S2=0,60,0,100&quot;m/sec&quot; S3=0,360,0,100&quot;Degrees&quot; S4=0,1,0,100&quot;kWh&quot; &#039;Thermistor declarations &#039;Switches declarations &#039;Parameter declarations &#039;Global declarations RS1S &#039;schedule definition RA(&quot;B:&quot;,ALARMS:OV:100KB,DATA:OV:100MB)15M LOGONA GA 1*TT(&quot;TCP01&quot;) 1+TT(&quot;TCP02&quot;) 1-TT(&quot;PV01&quot;) 2*TT(&quot;PV02&quot;) 2+TT(&quot;PV03&quot;) 2-TT(&quot;PV04&quot;) 3*TT(&quot;JB01&quot;) 3+TT(&quot;JB02&quot;) 3-TT(&quot;JB03&quot;) 4*TT(&quot;JB04&quot;) 4+TT(&quot;AAT&quot;) 5*L(S2,&quot;WS01&quot;) 5+L(S3,&quot;WD01&quot;) 6V(S1,&quot;RS01&quot;) here is the counter inputs 3C(R,&quot;M1&quot;,W,+=1CV) 4C(R,&quot;M2&quot;,W,+=2CV) 1CV(S4,&quot;EM01&quot;) 2CV(S4,&quot;EM02&quot;) ALARM1(3ST(&quot;Logon&quot;)&gt;&lt;8.,19.)&quot;Logon&quot;{[LOGON]} ALARM2(3ST(&quot;Logoff&quot;)&lt;&gt;8.,19.)&quot;Logoff&quot;{[LOGOFF]} &#039;schedule definition RB(&quot;B:&quot;,ALARMS:OV:100KB,DATA:OV:1MB)1S LOGONB GB here is the counter inputs 3C(R,&quot;M1-1sec&quot;,W,+=5CV) 4C(R,&quot;M2-1sec&quot;,W,+=6CV) 6V(S1,&quot;RS01&quot;,+=10CV) ALARM3(3ST(&quot;Logon&quot;)&gt;&lt;8.0000,19.0000)&quot;Logon&quot;{[LOGON]} ALARM4(3ST(&quot;Logoff&quot;)&lt;&gt;8.0000,19.0000)&quot;Logoff&quot;{[LOGOFF]} &#039;schedule definition RC&quot;PV Daily&quot;(&quot;B:&quot;,ALARMS:OV:100KB,DATA:OV:50MB)1D LOGONC GC 20SV 21SV 22SV here is the counter inputs 5CV(S4,&quot;EM01 Daily&quot;,R) 6CV(S4,&quot;EM02 Daily&quot;,R) 10CV(&quot;RS01 Daily Kw/h&quot;,R) 5*L(S2,&quot;WS01 Daily&quot;,AV)(MX) 1*TT(&quot;TCP01 Daily&quot;,AV)(MX) 1+TT(&quot;TCP02 Daily&quot;,AV)(MX) 1-TT(&quot;PV01 Daily&quot;,AV)(MX) 2*TT(&quot;PV02 Daily&quot;,AV)(MX) 2+TT(&quot;PV03 Daily&quot;,AV)(MX) 2-TT(&quot;PV04 Daily&quot;,AV)(MX) 3*TT(&quot;JB01 Daily&quot;,AV)(MX) 3+TT(&quot;JB02 Daily&quot;,AV)(MX) 3-TT(&quot;JB03 Daily&quot;,AV)(MX) 4*TT(&quot;JB04 Daily&quot;,AV)(MX) 4+TT(&quot;AAT Daily&quot;,AV)(MX) 5*L(S2,&quot;WS01 Daily&quot;,AV)(MX) ALARM5(3ST(&quot;Logon&quot;)&gt;&lt;8.0000,19.0000)&quot;Logon&quot;{[LOGON]} ALARM6(3ST(&quot;Logoff&quot;)&lt;&gt;8.0000,19.0000)&quot;Logoff&quot;{[LOGOFF]} END &#039;end of program file can you advise how i might program this so i can record accumulated kWh and also a daily kWh. thank you Stephen

Good afternoon Stephen,

In schedule A you are sampling counters 3 and 4 every 15 minutes and then resetting the counters.
3C(R,"M1",W,+=1CV)
4C(R,"M2",W,+=2CV)

In schedule B you are sampling counters 3 and 4 every 1 second and then resetting the counters.
3C(R,"M1-1sec",W,+=5CV)
4C(R,"M2-1sec",W,+=6CV)

I would re-arrange the schedule swapping schedule A with B so the one second schedule runs first
Leave the code for the counters as is
3C(R,"M1-1sec",W,+=1CV)
4C(R,"M2-2sec",W,+=2CV)

Then in the 15 minute schedule report and reset the CV values
1CV(R,"M1-1sec",W,+=5CV)
2CV(R,"M2-1sec",W,+=6CV)

This way you only reset the counter once.

Cheers,
Roger

Good afternoon Stephen, In schedule A you are sampling counters 3 and 4 every 15 minutes and then resetting the counters. 3C(R,&quot;M1&quot;,W,+=1CV) 4C(R,&quot;M2&quot;,W,+=2CV) In schedule B you are sampling counters 3 and 4 every 1 second and then resetting the counters. 3C(R,&quot;M1-1sec&quot;,W,+=5CV) 4C(R,&quot;M2-1sec&quot;,W,+=6CV) I would re-arrange the schedule swapping schedule A with B so the one second schedule runs first Leave the code for the counters as is 3C(R,&quot;M1-1sec&quot;,W,+=1CV) 4C(R,&quot;M2-2sec&quot;,W,+=2CV) Then in the 15 minute schedule report and reset the CV values 1CV(R,&quot;M1-1sec&quot;,W,+=5CV) 2CV(R,&quot;M2-1sec&quot;,W,+=6CV) This way you only reset the counter once. Cheers, Roger

Hi Roger,
Thank you for your reply. below is the changes i have made to the program as suggested, can you please confirm i have carried this out correctly to acheieve the accumulated Kwh and the daily Kwh.

RS1S
'schedule definition
RA("B:",ALARMS:OV:100KB,DATA:OV:2MB)1S LOGONA GA
3C(R,"M1-1sec",W,+=5CV)
4C(R,"M2-1sec",W,+=6CV)

RB("B:",ALARMS:OV:100KB,DATA:OV:20MB)15M LOGONB GB
3C(R,"M1",W,+=1CV)
4C(R,"M2",W,+=2CV)
1CV(S4,"EM01")
2CV(S4,"EM02")

RC"PVDaily"("B:",ALARMS:OV:100KB,DATA:OV:5MB)1D LOGONC GC
5CV(S4,"EM01 Daily",R)
6CV(S4,"EM02 Daily",R)

finally the logon command is given via an alarm between hours of the day, with this trigger and schedule C only logging once per day will Schedule C once per day still take a log if the alarm has run a logoff command at 20:00.

Thank you.
Stephen

Hi Roger, Thank you for your reply. below is the changes i have made to the program as suggested, can you please confirm i have carried this out correctly to acheieve the accumulated Kwh and the daily Kwh. RS1S &#039;schedule definition RA(&quot;B:&quot;,ALARMS:OV:100KB,DATA:OV:2MB)1S LOGONA GA 3C(R,&quot;M1-1sec&quot;,W,+=5CV) 4C(R,&quot;M2-1sec&quot;,W,+=6CV) RB(&quot;B:&quot;,ALARMS:OV:100KB,DATA:OV:20MB)15M LOGONB GB 3C(R,&quot;M1&quot;,W,+=1CV) 4C(R,&quot;M2&quot;,W,+=2CV) 1CV(S4,&quot;EM01&quot;) 2CV(S4,&quot;EM02&quot;) RC&quot;PVDaily&quot;(&quot;B:&quot;,ALARMS:OV:100KB,DATA:OV:5MB)1D LOGONC GC 5CV(S4,&quot;EM01 Daily&quot;,R) 6CV(S4,&quot;EM02 Daily&quot;,R) finally the logon command is given via an alarm between hours of the day, with this trigger and schedule C only logging once per day will Schedule C once per day still take a log if the alarm has run a logoff command at 20:00. Thank you. Stephen

Hi Stephen,

Not quite. You are still resetting the counters at two point rather than one.

More like:
'schedule definition
RA("B:",ALARMS:OV:100KB,DATA:OV:2MB)1S LOGONA GA
3C(R,"M1-1sec",W,+=1CV)
4C(R,"M2-1sec",W,+=2CV)

RB("B:",ALARMS:OV:100KB,DATA:OV:20MB)15M LOGONB GB
1CV(R,S4,"EM01",W,+=5CV)
2CV(R,S4,"EM02",W,+=6CV)

RC"PVDaily"("B:",ALARMS:OV:100KB,DATA:OV:5MB)1D LOGONC GC
5CV(S4,"EM01 Daily",R)
6CV(S4,"EM02 Daily",R)

Cheers,
Roger

Hi Stephen, Not quite. You are still resetting the counters at two point rather than one. More like: &#039;schedule definition RA(&quot;B:&quot;,ALARMS:OV:100KB,DATA:OV:2MB)1S LOGONA GA 3C(R,&quot;M1-1sec&quot;,W,+=1CV) 4C(R,&quot;M2-1sec&quot;,W,+=2CV) RB(&quot;B:&quot;,ALARMS:OV:100KB,DATA:OV:20MB)15M LOGONB GB 1CV(R,S4,&quot;EM01&quot;,W,+=5CV) 2CV(R,S4,&quot;EM02&quot;,W,+=6CV) RC&quot;PVDaily&quot;(&quot;B:&quot;,ALARMS:OV:100KB,DATA:OV:5MB)1D LOGONC GC 5CV(S4,&quot;EM01 Daily&quot;,R) 6CV(S4,&quot;EM02 Daily&quot;,R) Cheers, Roger
19
3
2
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft