Ge 305

dhillon13

Member
Join Date
Feb 2020
Location
brampton
Posts
2
i have 10 signals for 10 different tanks in service.how can i find out how many are online or offline at any time.....
Thanks
 
what if someone downloads the program and at same time 5 tanks are in service. the counter will not work at that time as it will increment by only 1
 
When you initially download the program you count the number of tanks in service and set the count value to that number. After that it should maintain an accurate count.


An alternative would be to map the inputs into bits of a word. Then zero the count, perform ten bit shift operations and add 1 to the count for each 1 shifted out.


Probably easier done in ST than in ladder.
 
Last edited:
Brain-dead but simple approach below; bad practice anti-pattern also (multiple rungs writing to the same values), but that is probably going to happen in any design that solves this problem.



Replicate the second rung so there are as many of that rung as there are tank signals; this could also be done with a loop, LBL and JMP in two rungs.

This implementation is only to demonstrate the concept, as it assumes the first tank state is in I:0/0, the second tank state is in I:0/1, ..., the tenth tank state is in I:0/9.

The program would be more general if it used the [Input Map] design pattern e.g. use a bit file, say B3:0/[N7:1] instead of the I1:0/[N7:1] inputs, and copy the tank states from physical inputs into a contiguous region of B3 upstream of this code. That way the tank states do not have to be in contiguous locations along the physical inputs; also in that case if an input on the PLC went south, that tank's signal wiring could be moved to another input, and the only required code change would be to one line of the input map.


Although if I were anticipating doing that, I might as well use the hard-coded inputs in the ---] [--- XIC/NOs in the first place and skip the input map. The only advantage to using indirect addressing is that the ten lines are identical i.e. object-oriented design, conceptually separating code and data, so if I want to do anything else in the counting rungs it is easy to implement.


Crud, I just talked myself out of this approach; ignore this post.

yyy.png
 
Last edited:

Similar Topics

Hello all, First time poster, long time viewer of these forums. Could not find my solution on here. We have had issues with a Comm Fail on an...
Replies
2
Views
403
I am looking at a 1305 drive connected to a PLC5 via RIO. The drive is working and I was able to get a functional HIM working on the drive as...
Replies
3
Views
1,857
Hi Everyone, We do have several cabinets with SLC5/03 CPU's and two SCANport modules, each. 5 ports are being used, communicating with 1305 VFDs...
Replies
4
Views
2,480
Hi, Just looking for a quick pointer. I want to upload an old program out of a Texas 305 PLC. The program was last downloaded in the 90s so...
Replies
10
Views
2,036
I have a Project with multiple small sites that have pipeline valves. The client took the PLC from one site, and wants me to configure it for...
Replies
5
Views
1,468
Back
Top Bottom