Record and Track output - Power Monitoring

Hey guys! My apologies if this has been here before and im new to the temco controls world but loving it so far.

I have a bunch of current sensors that are 0-200amp, and output 0-10vdc that I want to use to monitor power used by specific circuits. I understand how the input values can be assigned on a linear scale of 0-10 being 0-200 amps. I want the final output of the program to be Kw and eventually KW/Hr. So I know I have to do a calculation of converting 0-10v to the corresponding amperage, then Amps times voltage to give me Watts (power). But I also need to measure this over time to find the KW/hr.

Also, once this is done, I need to be able to record the output and get the information over a specifc date range.

I know temco has a stand alone power monitor piece but this system has 12 main sensors at 200 amp and I want to be able to use the existing units.

Help! ;o)

This is a great application, its a good excuse to fomalize the power monitoring capabilites of our system. Here is a quick stab at it without any hardware on hand. Have a go at it and report back, lets see where this goes.

REM *** accumulate the watt-seconds every second. ***
REM *** This is crude but it triggers a flag every hour ******
IF+ TOD = 0:0:0 THEN NEWHOUR = 1
IF+ TOD = 01:0:0 NEWHOUR = 1
IF+ TOD = 02:0:0 NEWHOUR = 1
IF+ TOD = 03:0:0 NEWHOUR = 1
… repeat for all 24 hours of the day …
REM *** every hour store the watt-hours ***
REM *** increment the kwh for the day whenever the new hour is triggered ****
… insert code here to accumulate the kwh for the month
and reset the day & month variables appropriately
REM *** All done with the flag, reset the flag and the watthrs accumulator.

That’s a great start and great info. Thanks !

What about getting the information ? How do you capture it ?

I understand that you can do inputs and put out to like a relay or something but how do you get the information ? Plug in computer ? Etc ?

Thanks again !

Capturing info: See the section in the help system about trend logs.

Other questions: I am confused but ready to help.

Thanks ! I’ll look that up.

And send other questions later. Really appreciate all the help !

Hey Maurice
I’m diving back into this project. HAd a few questions. Ive spent a lot of time in learning more code language and had a questions about the code you sent.

Can you explain what the IF+ for NEWHOUR for each hour of the day is doing?
I understand that it is giving a flag of NEWHOUR being “true” every hour and then making the program calculate WATTHRS. Then the values are stored under this variable and I can see the values once plugged into the controller? Will they show in the program the date/time that it is calculated? (sorry, that may be a dumb question but again, still new to the programming and havent set my controller going yet and seen what the program output will be.

As for calculating the daily and montly valules, I can do that separetly. I plan to export the raw data from the temco controller to an excel spread sheet and this was I can select the data range to sum easily for now. Crude but it will work. And once I get this calculating and summing properly, I probably will add the code to do the calculations for me.

After 24 hours is up, and all the calculations are finished for that day, you are reseting the flag and the WATTHRS value to zero. And starting off on a new day. Can you just do this by saying IF TOD (23:59:59) THEN NEWHOUR = 0 and WATTHRS = 0?

Again, sorry for the questions that are probably straight forward for you. I’m a quick learner and my teacher used to say the only stupid question was the one that would go unasked. lol


You asked about being able to see when the date and time of a certain event happened. The best way to do that would be to do a trend log of the data. It records the data and logs the time.

Resetting the counters: Your program could work, sure. I would use an IF+ edge trigger so that the logic runs exactly once.

IF+ TOD > 0:0:01 THEN NEWHOUR = 0… etc.

The greater than sign helps as well, in case the controller somhow or other missed the exact moment TOD = 0:0:01 then it would be triggered next loop through the logic.

Note to self: Do some easy excel export and reporting features. Important.

Yeah. I’m kind of stuck with that reset and trying to understand how the logic works there. I really need to go tk site and run the program and see how it responds I think.
Also see how the trend log is displayed In the database and make sure it’s what I need.

More questions to follow I’m sure. Lol

Good morning !

So with the counter NEWHOUR

Wouldn’t you want NEWHOUR to be 0 at the start of the day, then at 1am it start and be 1?

So at midnight (0:0:0) it start out at zero and then at (1:0:0) it get a flag and every hour after?


IF+ TOD > (0:0:1) Newhour = 0
***** the program will reset Newhour to zero the first time it sees this statement true
IF+ TOD = (1:0:0) Newhour = 1
***** program flags program to run and accumulate power for the hour the first time it sees it statement as true
( Do this every hour )

Then at TOD (0:0:0) it stores info for midnight and at >(0:0:1) for one time it resets back to zero

When Newhour hits zero, that’s the flag for me for resetting the whatthrs and the kwday values.

I think that will work ?

ALSO: really enjoying working with this program and hardware so far. Very easy to use and love the application.

There will certainly be more than one way to get the tickers and counters working. You can debug the program by working first with seconds and get that working, then move on to minutes and finally hours & days. Then get rid of the seconds tickers since that would just be for debugging. Use a trend log to watch what happens to all your variables over time.

Note: To do trend logs you will need an SD card in the SD slot and not all devices have the SD slot.

You can still run trend logs by keeping T3000 running.

Note2: We’re slowly rolling out a new ESP32 cpu on our products, these have on board flash so no SD card required.