arrays in gxworks2

pharmaz0ne

Member
Join Date
Feb 2016
Location
krakow
Posts
4
Hello, i am trying to get access to an array using an indexing variable.
The project is a box conveyor where are 6 boxes, so i have array "box[0...5]".
I want to use variable "box_current" as an index. Is it possible to use this variable in LADDER program, i mean if i put "box[box_current]" in the label it doesnt work. Whereas when i create a function block in ST and use that kind of expresion "box[box_current]" it works perfectly.

Is there a way to use index variable straight in LADDER or do i have to do it in ST.

Many thanks in advance.
 
Last edited:
In ladder you need to use the index variables. Try using "Z0" to "Z7". I think that is what they are - it's been a while.

You also need to use the syntax like this: D200Z0. If Z0 = 0, it will resolve to D200. If Z0 = 10, it will resolve to D210.
 

Similar Topics

Two questions for GE/Emerson e.g. PACSystemsRX3i (CPE330): 1. Is it possible to use 2D arrays inside a function as a local member? (I can only...
Replies
0
Views
36
Hi. This is pretty basic but I'm struggling to find an efficient solution. I have a float value of let say 666.555 that I want to move / split...
Replies
3
Views
211
Hello. I've been using the answers in this forum for a while now, so thank you. Usually I can find the answer I'm looking for with a basic...
Replies
8
Views
755
Hello, first time poster here! A belated "thank you" for the direction I've already received from this forum! So, can I do this? Move value 1...
Replies
6
Views
722
My first real attempt at utilising the AOI function in Compactlogix. The issue I'm having is, I have an array of INT[400], but in my AOI I'm only...
Replies
1
Views
456
Back
Top Bottom