CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Sat Jul 22, 2017 1:57 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sat Nov 26, 2016 12:57 am 
Offline

Joined: Wed Apr 22, 2015 1:45 pm
Posts: 11
Hi
I try and save real assets from an energy meter.
But I'm not sure how I can do it.

I've used oscat_basic.lib and METER, METER_STAT to see my meter values. But how can I save real values every hour.

I want to log kW top average value for every houre.

Duration in minutes: M1, M2, M3, M4 ... M60
kW value: kW1, kW2, KW3, kW4 ... kW60
Average hourly kW value: H1, H2, H3, H4 ... H24

Then I want to save the 3 highest values for the months.
3 highest values in months: Mont_1_1, Mont_1_2, Mont_1_3, Mont_2_1, Mont_2_2, Mont_3_3 ... Mont_12_1, Mont_12_2, Mont_12_3

When a new year starts the values for the months will be overwrithen.

I need some help to start on how to do this. An example on how to store a value in specified intervals would be grate, what function blocks should I use? Please try to explain inn FBD or CFC.

Thanks for all the help

Espen (newbie)


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Sat Nov 26, 2016 5:33 pm 
Offline

Joined: Sat Jul 23, 2016 2:34 pm
Posts: 10
Since you are already using Oscat basic, I suggest you look into the Oscat Network lib for this. It has the DATA_LOGGER component to store data. You can store in a CSV file on the PLC itself with the DLOG_STORE_FILE_CSV component. Or HTML, XML. Store on an SD card if your PLC has this. Use DLOG_FILE_TO_SMTP or DLOG_FILE_TO_FTP to have your PLC send the file to an email address or upload to an FTP server.


Top
   
PostPosted: Sat Nov 26, 2016 6:25 pm 
Offline
Frequent User
Frequent User

Joined: Thu Jun 14, 2007 9:49 am
Posts: 974
what PLC are you using, and where do you like to save the data.
and indeed have a look in oscat network.

_________________
shooter@home.nl
computer shooter
paul deelen
jacob van wassenaerstraat 29
NL 5224 GG 's-Hertogenbosch
skype shooter paul.deelen
phone +31736139136


Top
   
PostPosted: Sun Nov 27, 2016 12:40 am 
Offline

Joined: Wed Apr 22, 2015 1:45 pm
Posts: 11
Hi
Thanks for your replay.

I now have a WAGO 750-849. Otherwise, I tend to use WAGO 750-831.
So it should work on both PLCs.

I read the documentation codesys_network_121_hf1
and thought DLOG_REAL can be used.
But when I enter lib file and compiles then I get an error message.
<Maximum number of POUs (1023) exceeded compile is aborted>

I changed the settings in <of target> maximum number of Pous 2023>
When I get errors
BASE64_DECODE_STR
BASE64_DECODE_STREAM
DLOG_DT
DLOG_FILE_TO_SMTP
...
XML_READER

I tried and create a new small program. With only a few blocks.
I increased max POUs and it gets compiled but with error on memory.
When I chose 'exclude unused' and got compiled and downloaded.

But how do I get used values from DLOG on.
Is there a better approach?


Espen (Newbie)

(Does this also as sign so I know what I've done and how I got it fixed.)


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Wed Nov 30, 2016 11:11 pm 
Offline

Joined: Wed Apr 22, 2015 1:45 pm
Posts: 11
Hello.
I think I found an easier way and bring out the effects of each hour. And take care of the highest impact measured.
But I have not found any good solution and take care of the daily value so I can find the 3 highest values ​​in months. Or how to save the months view.
I thought ARRAY can be used. Also had been fine and could list the date, time measurements were from.

Do you have any good ideas? I have tested some, and tryied to find som more information.

Here is a link to the program.
https://www.dropbox.com/.../8cdsdg07... ... ter3.pro...

Espen


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited