Numeric array RSLogix 5000

AlexPLC

Member
Join Date
Oct 2013
Location
Vyborg
Posts
6
Hello guys!

I have a little experience in programming PLC so I would like get any help.

I need to assigning a several thousand SINT values in ONE :nodi:tag for several seconds. Thought make it with numeric array like assembler or C, but I cant finding equal instructions in ST...

Ideally need have an own numeric array and successively getting numbers from that...

Regards
ALex!
 
in logix 5000 you can define an array of data type SINT by creating a tag and assigning the tag as in array. For example create a tag called Numeric_Array and assign it as a SINT for the data type, if you want to make it an array add the [] braces with the number of array elements in the braces right after the data type so it would look like this SINT[9], so that means you have a tag called Numberic_Array which is an array of elements 0 through 8.

If you wanted to compare the array elements with each other then you can use the following format

In the example below of the value in Numeric_Array[0] is equal to the value in Numberic_Array[1] turn on a light.


IF Numeric_Array[0] = Numeric_Array[1] THEN
Light := 1;
END_IF;

I have also highlighted some of the operators you can use to compare values

<> : not equal
= : equal
>= : Greater than or equal to
<= : Less than or equal to
> : greater than
< : less than
 
Yes! It is helped me.
I made the array[1000] with 1000 array elements.
Can I in any way upload my own numerics to array? Or only "hand input(to type)" ???
 
Yes! It is helped me.
I made the array[1000] with 1000 array elements.
Can I in any way upload my own numerics to array? Or only "hand input(to type)" ???

Do you want the same numeric in each array element or are they all different?
If they're all the same you could do a file fill (check the FLL instruction).
 
mov
Source "Any tag or number of corresponding type"
Dest Numeric_Array[desired number]
 
Last edited:
you can use what Mart B suggested or another way you can do it is by using a FOR loop in your ST code, and ofcourse this is assuming you want to fill the Array Tag Numberic_Array with the same value. See code below


Your_Value := 15;
For i := 0 to 1000 by 1 do
Numeric_Array := Your_Value;
End_For;

so every time your for loop iterates it assigns the value that you put in the Your_Value tag. In this example you assigned a value of 15, so basically when your code iterates, Numeric_Array[0] all the way through Numeric_Array[999] will have the same value of 15.
 
you can use what Mart B suggested or another way you can do it is by using a FOR loop in your ST code, and ofcourse this is assuming you want to fill the Array Tag Numberic_Array with the same value. See code below


Your_Value := 15;
For i := 0 to 1000 by 1 do
Numeric_Array := Your_Value;
End_For;

so every time your for loop iterates it assigns the value that you put in the Your_Value tag. In this example you assigned a value of 15, so basically when your code iterates, Numeric_Array[0] all the way through Numeric_Array[999] will have the same value of 15.


+1 for ST!
 
the code that i assigned will fault here is a modification of that code, just decrement the array max value by 1 which is 999

Your_Value := 15;
For i := 0 to 999 by 1 do
Numeric_Array := Your_Value;
End_For;
 

Similar Topics

Hello all, I'm currently working on a servo motor linear positioning system (ball screw). I'm all set up regarding communication between my HMI...
Replies
1
Views
111
Hi I'm working in Studio 5000 View Designer V9. The HMI panel im currently using is a 5510, whit physical buttons and functions keys on both side...
Replies
3
Views
188
Hi everybody, I have about three Red Lion HMI's, the calibration on the screens seems correct but where I'm using the pop up keypad to enter...
Replies
1
Views
125
Hi all so i have a robot project im working on were i need to set the layers. using the hmi screen i would like to use the numeric data display to...
Replies
11
Views
846
Hey, within FactoryTalk ME I have this numeric input enable button and it is not working. On the HMI, I see the button and the label but when I...
Replies
2
Views
531
Back
Top Bottom