CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Thu Aug 16, 2018 7:32 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Mar 31, 2017 3:02 pm 
Offline

Joined: Thu Mar 30, 2017 3:06 am
Posts: 5
Greetings,

Please allow me to start by saying I am new to Codesys having specialized in Siemens S7 for many years. Because of this please forgive me if I ask a "stupid" question :-)

I know "pointers" are a touchy subject with some people. However they do have their place. I noticed something that was a bit disturbing when attempting to setup and use a pointer. I setup variables in a "global" variable table. It was something like the following:

ABC : WORD;
XYZ : ARRAY [1..20] OF WORD;

I setup the pointer to begin at "ABC" and transfer values from there to the end of "XYZ". The result I saw was that "ABC" was being filled with "value" but not "XYZ". I then used ADR() to find out what was going on. This revealed that in memory "ABC" was not contiguous in memory with "XYZ".

My question is, is there some way (other than declaring a DUT (UDT) or ARRAY) that memory locations in a function or function block can be forced into memory in the order that they are declared?


Top
   
PostPosted: Mon Apr 03, 2017 12:00 pm 
Offline
Frequent User
Frequent User

Joined: Wed May 04, 2016 6:00 pm
Posts: 236
See attribute {attribute 'subsequent'}.

I have not test it.

Enviat des del meu Aquaris M5.5 usant Tapatalk


Top
   
PostPosted: Sat Apr 29, 2017 2:35 pm 
Offline

Joined: Thu Mar 30, 2017 3:06 am
Posts: 5
Thank you, I will check that!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 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