How to change a value in a single array element

sxj1988

Member
Join Date
Apr 2014
Location
Rochester, NY
Posts
38
Hi guys,
I have a question, I have a scenario where I need to change the value of a specific array element. In this scenario I have an FIFO_array[100]. In this array, its only storing 0 and 1 in each element.

For example, lets say I have this:

FIFO_Array[0] = 0
FIFO_Array[1] = 0
FIFO_Array[2] = 0
FIFO_Array[3] = 0

My FIFO_Array_Control.POS is currently at Position 3 which contains a value of 0, but I want to make that FIFO_Array[3] to equal a 1. What do I need to do in order to change the value of that specific position?
 
The obvious answer is FIFO_Array[3] = 1, but this may depend on the particular circumstances. I think we need to see you actual code to determine why you think the position of possibly a FIFO instruction limits assigning a value to a particular array variable.
 

Similar Topics

It's a while since I had used this that I forget where the setting to enable/disable object security is. There are some devices (pumps/valves)...
Replies
1
Views
858
Hi all. I am looking at a valve position which has been scaled for an operator HMI. The valve position is in 0-100% shown to the operator for...
Replies
6
Views
1,136
Hello, I am currently trying to control a motor in my plc. I've made a simple on/off button logic. And it works pretty well, when i press the...
Replies
25
Views
6,016
Hello all, wondering if there's a simple way to detect when a tag's value has changed. I have some tags whose values get updated every so often...
Replies
4
Views
1,652
Hello guys hope y’all healthy during this time, Im looking for help in a project im trying to finish. I need to get a bool (ote) when a dint...
Replies
6
Views
1,787
Back
Top Bottom