Access array values

jcmosquera

Member
Join Date
Nov 2013
Location
Mannheim
Posts
1
Hi Everyone!

I'm currently working with an ABB RTU which has built-in PLC capabilities, I'm programming some systems using ST in Multiprog wt.

I simulated my system in Matlab and everything worked perfect, it's an earth fault recognition system for medium voltage networks.

I programmed everything with very simple commands, not using any complex Matlab functions so that I could easily port and rewrite my code in ST. All is working great but one thing that is bothering me and I'm getting an error from.

I hav the following simple for loop:

Code:
FOR m:=1 TO 1000 BY 1 DO								
	FOR n:=1 TO (n-m+1) BY 1 DO
		output[m]:=output[m]+(input[n]*input[n+m-1]);	
	END_FOR;
END_FOR;

input and output are ARRAY[0..1000] OF REAL;

I get an error saying that I cannot use input[n+m-1], not even input[n+1]! How is that possible? I'm not PLC expert I'm just starting out and that seems like basic programming syntax to me like with other normal languages.

Any way I can get around this to access and read those type of array elements?

Thanks!
 

Similar Topics

Having issues finding how to have a variable tag as an array offset, when that array is part of the FB STAT area and the array is being passed...
Replies
13
Views
2,389
Hi, I'm trying to get iFix 5.8 to access DINT and INT array elements from a ControlLogix. My tag: test_dint Data Type: DINT Array Length: 100...
Replies
6
Views
3,168
Hello at everybody, I have a client opc that is connected to an opc server RSLinx, I would read an array, I can do it using the length, the...
Replies
0
Views
1,397
Hi I have a boolean array within my PLC inside a DB Array[0...32,0..100) of type BOOL In WinCC flex how would I address an array element...
Replies
3
Views
2,070
Hi, I'm quite new to pointers and i have a question. I have made an udt1 of one integer and one timeofday (total of 6 bytes). I have also a...
Replies
14
Views
3,132
Back
Top Bottom