Koyo CLICK PLC - Take 10 readings over 10 seconds

Frobozz

Member
Join Date
Sep 2014
Location
Northeast Ohio
Posts
2
Hello everyone. I'm still trying to wrap my head around PLC programming having come from a traditional computer programming background. I've been struggling to figure out how to do the following.

I want at some point in my program to take 1 reading from an analog input every second for 10 seconds, then take the average of those readings.

The part that's stumping me is the loop. I can use For and Next rung parts, set the loop for 10 cycles, but when I run the program, there's no delay, the loop takes 10 readings milliseconds apart. When I try to put in a 1-second timer, I need to split it between rungs and I can't wrap a For and Next between rungs. I tried to just manually "set" the NO condition that starts the cycle, and "reset" when 10 have passed figuring the program would naturally loop to the next one, but I can't seem to get it to continue after the first pass.

Is there some easier way to do this? I kinda figure it can't be that uncommon of a thing to take an average of several analog readings over time.
 
I'm trying to put the test routine in a "Subroutine Program" now, thus have my program all torn up. If I figure it out for myself, I'll post the results for anyone else who may be searching. If not, I'll post the result with a "Well that didn't work" reply.
 
This would be the Click version of Lukes's efficient program. No For-Next loops are needed.
 

Similar Topics

Hey guys, I have one of the new CLICK plc from AD with an ethernet port on it. I made a subroutine for an IO Map of a modbus slave device I have...
Replies
11
Views
4,707
Hi, I'm relatively new to PLCs and I currently own the Koyo Click PLC. I haven't really been able to fully grasp the idea of memory addresses. So...
Replies
3
Views
2,514
I need a cheap PLC for a project I am doing at home, (automated beer brewing). I will need about 12 DC outputs, 12 DC inputs. I also need about 6...
Replies
27
Views
21,749
Hello forum. I have a Koyo Click Model CO-OODD1-D. It has 8 sink/source inputs and 6 sinking outputs. I have a traffic light program I already put...
Replies
3
Views
2,833
Has anyone done any programing on click plcs? I just wanted alittle info on them.
Replies
12
Views
4,742
Back
Top Bottom