Codesys V3, Hour meters & dealing with retain memory

boompy

Member
Join Date
Jul 2019
Location
Australia
Posts
6
I'm working myself into a bit of a lather.

I'm in need of some assistance with programming an 'Hour Meter' in Codesys V3. I'm using a Wago 750-8202 (PFC200).

This system will be routinely power cycled. As such I will need to write data to a variable declared as 'persistent retain'.

Ultimately I'd like to periodically write data to an external SD card for logging purposes. The CAA_File library seems to me to be the best way of achieving this.

In the meantime, I'm trying to understand the memory architecture of my controller. Is remanent memory explicitly 'flash' memory? In which case, I should resist writing to it too often?

If I wrote my hour meter status to it every 10 minutes, would this be considered poor programming practice? Will the device perform any internal 'wear levelling'?

The PFC200 manual talks about 128kB of 'Remanent Memory' which is broken into 24kB of 'Flag Area' memory and 104kB 'Retain Memory'. I have no idea what flag area means.

Can anyone clarify the best practice for implementing an hour meter and how one should go about storing the data, without compromising the device (flash write service life).

Thanks!
 
I can only speak from experience with my preferred Codesys platform.
Do you have the option to add a PersistentVars object from the context menu (right-click Application).
It adds a Global Variable list, but the Vars within are retained. May be the same in Wago land.
 
You need to define the variable as Persistent Retained to hold the value in all cases. This will only be wiped out by a download. There should be a truth table in the manual indicating when the different memory types are reset.
 
An hour meter and a logging component are both available in the Oscat libraries (free and open source). I think you would need Oscat Basic and Oscat Network. It may need a little tinkering to get these to compile and work in your Codesys version. I have used them in Codesys 2.3 and in Wago E!****pit (which is based on Codesys 3). The hour meter counts both runtime hours as well as cycles, to me both are useful.
 
If memory serves me right..

In codesys 3 it's enough to declare a variable persistent to make it both retain and persistent that's a difference between v 2 and 3.

Persistent variables remain even after program download etc.

You need to add the persistent variable list but persistent variables can be declared inside FBs also. Persistent variables cannot be declared in other variable lists (difference to codesys V2). There is also other solutions for persistent variables in standard codesys but I don't know if wago supports them.

Read the device manual.. PLC makers tend to stray away from codesys standard way of dealing with retain and persistent memory and there is a chance you need to do something special..
 
Thank you boompy! Think I had a similar problem, but didn't know where to find solutions to all those "memory issues". Honestly, I thought your post was some kind of an American flag essay (considering the terms you use). Apparently, I have some basic knowledge to gain ))
 

Similar Topics

Hello, I am using a Hitachi Micro EHV+ for a small project, and I wanted to have a Web visu, done with Codesys V3.5 SP13 Patch 2. I test the...
Replies
6
Views
296
Hello, I have a requirement to manage the text alignment dynamically. So, for example: 1. English Texts should be displayed from Left in...
Replies
0
Views
90
Hello, I am new to Codesys, and am trying to learn about it for a project we're developing. I've got a couple questions, but first a little...
Replies
1
Views
161
Hi everyone, as this is my first experience with Rockwell Software i would like to know what's the best way to make Enumerations?
Replies
10
Views
511
I am trying to get Codesys to work with a couple of Moxa ioLogik E1200 series DIO devices (E1210 and E1211). I am able to write to the E1211 DOs...
Replies
2
Views
174
Back
Top Bottom