Codesys Mapping I/O with Array

Join Date
Dec 2015
Location
Windsor
Posts
27
Hey everyone,

Does anyone know an easy method to map IO with an Array without having to manually enter all of them one by one? I am trying to map IO BYTEs with an array of SINTs but I do not know if its possible to do that without having to enter them one by one.

Thanks in advance

Capture.PNG
 
I dont know about array but if you want to speed it up you can create a global variable list where you write something like this:
Code:
VAR
   yourVariableName: BOOL AT %IBX.X;
END_VAR
That way you can bulk create it in a spread sheet program and pastenit into the global variable list. Im pretty sure that is the syntax, feel free to correct me or by checking the codesys help.
 
Thank you ojz0r and AlfredoQuintero for your responses. I have seen this post before where you can define in the tag itself for the IO it should be mapped to. But unfortunately I could not find a way to map an array of BYTE to an array of IO (BYTES) in one go. The way you have described is to map one array to one object which I can by defining it as:

yourVariableName AT %IBX: yourDUT;

But I need to map an array of object to an array of object (for example a SINT or BYTE), please correct my syntax

yourVariableName AT [%IB408...%IB425] : ARRAY [0...17] OF BYTE;
(In the above example %IB408 to %IB425 are of type BYTE)

The above line gives the following error :
[ERROR] PLC: Panasonic_Robot [Device: PLC Logic: Application](Line 5): C0030: Direct address expected after AT instead of [

Would really appreciate if someone could help me on this

Thanks!
 
Last edited:
Maybe if you describe your purpose there might be another solution?


Do you really need the direct I/O in an array or would a copy suffice with a move instruction?
Code:
yourArray[0] := yourInputVariable0;
 

Similar Topics

Hi everyone, I am using Codesys for the first time (V. 3.5 SP16 Patch 3) and I have used only Allen Bradley before this. I am struggling to...
Replies
17
Views
4,630
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
267
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
86
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
133
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
488
Back
Top Bottom