compare values

bfranklin

Member
Join Date
Sep 2012
Location
Alberta
Posts
125
Hey,

I need to compare 60 [int] tags to zero.
Is there a short, easy way of doing this? I am currently just comparing each individual tag to zero.

Thanks,
 
I am currently just comparing each individual tag to zero.

I take that to mean you have already programmed a brute force tag by tag comparison. If so then just keep it. The work is done, and using other programming instructions such as FSC or a For/next loop isn't going to decrease the processor work load, the processor is still comparing 60 words. Brute force programming isn't always as elegant as other constructs, but it has the advantage of being easy to understand. When its two dark thirty in the morning and Bubba from maintenance is trying to figure out what is happening he won't bother you about code that he can understand. If you want to simplify the code so you don't have to scroll past all the compares, then put the brute force compares in a subroutine and call the subroutine.
 

Similar Topics

I'm working on an array that contains a UDT of 5 Items Array[4] DataType[0] - Part 1 - Part 2 - Part 3 - Part 4...
Replies
1
Views
843
Looking at the compare values instruction, it seems as though you have to use 2 separate boolean tags to perform a greater than or equal to...
Replies
3
Views
1,163
hello. i am trying to store the values of a sensor every 1 minute to an array of 3. and compare the 3 values to see of the values is increasing or...
Replies
12
Views
3,527
Hi Guys, Im back again after 1&1/2 year. But my question is... How can I read values in excel file especially from one column then compare it with...
Replies
4
Views
1,936
I am using rslogix5000 and a controllogix L73 Processor. I need to compare 4 analog position inputs and use the highest or lowest input value to...
Replies
5
Views
4,008
Back
Top Bottom