CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Thu Aug 17, 2017 10:14 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon Feb 13, 2017 9:33 pm 
Offline

Joined: Wed Nov 09, 2016 8:15 am
Posts: 7
Hello,

I have arrays of quite large structures (which I can not split). I need half of the structure fields to be RETAINed, but half of them not. If I put the variables in retain area, I am running out of retain memory. I know about {nonpersistent} pragma, but it is for PERSISTENT and not RETAIN storage.
Is there any similar mechanism that makes it possible to exclude some fields form being retained, thus leaving space for others?

Thank you


Top
   
PostPosted: Mon Feb 13, 2017 10:34 pm 
Offline
Frequent User
Frequent User

Joined: Thu Jun 14, 2007 9:49 am
Posts: 974
the only way is by putting a structure in retain and copy them into another bigger structure (not retained) however you will need to copy them back into the retained structure for the ones you have to save.
do this only when they are changed.

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


Top
   
PostPosted: Tue Feb 14, 2017 5:32 am 
Offline
Frequent User
Frequent User

Joined: Fri Sep 02, 2011 8:02 pm
Posts: 240
The whole idea of a structure is a list of data items occupying a zone of memory - an array of bytes divided up into various variables. What your hoping for is to break up that ordered memory and say elements x,y and z are stored over here, and a,c,e are over here and b is over here.

Option 1 a copy in/out as suggested.

Option 2 You may too far in to adjust, but I think your structure should be different. Maybe you can change the structure elements that need to be retain to be pointers, so you can assign to retain space.

Option 3 different hardware with more retain.


Top
   
PostPosted: Tue Feb 14, 2017 10:17 am 
Offline

Joined: Wed Nov 09, 2016 8:15 am
Posts: 7
Thank you for your suggestions.


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

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 4 guests


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