Codesys Global Variables do not have data

drewethridge

Member
Join Date
Apr 2013
Location
Carrollton, TX
Posts
1
I have an existing array in Global Variables,
Test_Array: ARRAY [0..3,0..20] OF DINT that is working fine. I can see the values changing when I am online.

When I added an element to the array and downloaded the program I could not see any of the array values. All locations simply displayed ???. When I removed the added array element and downloaded the ??? were still present. In order to recover my array I had to download a previous copy.

Any ideas how to "repair" this array?
 
Not sure if this will help but the Var's may need to be declared as Retained_Vars.
Altering the array may re-image the table locations within the unit and result in data loss.
 
If you change the size or anything else in your program the positions of the VAR is changed, so it will come back with ???
Because you declare it every time the program starts it will keep having this problem.
you will have to save it on another place like a stick or other memory.
I solved above by using a visualisation, so i can write down the settings on paper, before stopping the program.
retain works when the power is off, and the unit is restarted, do not initialize when array is filled.
 
CoDeSys supports file operations. If all the data is in a single array and if you can figure out when you want to save the data it's very simple to save the single variable (The array will be treated as a single variable for file I/O). This won't solve the issue of changing the array size though.

Good luck,

(8{)} :) .)
(Yosi)
 

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
287
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
139
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
501
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
167
Back
Top Bottom