Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched.
Close
I have a question and hope someone can help me a bit with this.
I have made type of Energy meter used for a water heat exchanger.
I measure flow (L/sec), temperature in and out of water to be heated.
With these values I have made a totalizer with the Integral function.
I am logging the values to a txt file on a SD card continuisly as such:
0 (kJ)
2
4
6
7
7
8
9 (kJ)
The kilojoules are counting up and the newest logged value is the total kJ.
The problem now is that if there is a power outage and the PLC starts at zero again.
I need to load the previous latest logged value to a variable and add it to the formula.
Is there a way to load a value from the SD card? Or how would you solve this?
Any input is very much appriciated
Thank you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can you let us know how you've made the totalizer?
Which time did you choose for the the integral function?
I'm struggling with this choosing a right time for L/min or L/sec.
The integral functions that I'm using come from the Util.library or CAAMathematics and Basic.OSCAT
Thanks,
Dragos
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2016-04-11
Originally created by: scott_cunningham
Move your variable to a VAR PERSISTENT. These are retained even after power cycle (if your hardware supports it). Then, your SD card is only a report of the value of your variable.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I have a question and hope someone can help me a bit with this.
I have made type of Energy meter used for a water heat exchanger.
I measure flow (L/sec), temperature in and out of water to be heated.
With these values I have made a totalizer with the Integral function.
I am logging the values to a txt file on a SD card continuisly as such:
0 (kJ)
2
4
6
7
7
8
9 (kJ)
The kilojoules are counting up and the newest logged value is the total kJ.
The problem now is that if there is a power outage and the PLC starts at zero again.
I need to load the previous latest logged value to a variable and add it to the formula.
Is there a way to load a value from the SD card? Or how would you solve this?
Any input is very much appriciated
Thank you.
Hi Leifjoh,
Can you let us know how you've made the totalizer?
Which time did you choose for the the integral function?
I'm struggling with this choosing a right time for L/min or L/sec.
The integral functions that I'm using come from the Util.library or CAAMathematics and Basic.OSCAT
Thanks,
Dragos
Originally created by: scott_cunningham
Move your variable to a VAR PERSISTENT. These are retained even after power cycle (if your hardware supports it). Then, your SD card is only a report of the value of your variable.
Thanks for that answer Scott,
A much simpler solution to this and it works perfectly.
BR