Codesys 3.5, comments on array elements

leon78

Member
Join Date
Jul 2004
Posts
65
Can you please tell me if it is possible to add comments to array elements in Codesys 3.5?
For example, Control Expert (Schneider Electric)

изображение_2022-07-13_0833110.png
 
Li Leon:
It does not seem to be possible to add comments straightforwardly for arrays. A Google search showed two forums with unanswered posts on your very same question.
The workaround below requires the creation of a user data type, in which you can create an array of strings to store your comments in the initialization of the array within the user data type declaration. I know this is ugly, but I can't think of anything else.

2022-07-13_ArrayWithComents.png
 
Hi Alfredo,
Thanks, but I can't use your idea. It demand to use a lot of variables' memory for the comments.
 
Another option is a STRUCT. (left hand side of image)

If you want to be able to do array access like for loops, you can use a UNION as well. (right hand side of image)


In both cases, they use the same controller memory of 6 bytes, as can be seen in the memory view (bottom of image).

union or struct for array comments.png
 

Similar Topics

Hi , I am not able to expand any global variable in offline mode, also not able to add comments to the elements of the variable since it does not...
Replies
13
Views
3,240
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
305
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
93
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
164
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
517
Back
Top Bottom