Quick Question About Ladder Logic

Suggestions, Problems, Availability, etc. Everything is up for discussion.
fbones
Posts: 12
Joined: Tue Oct 21, 2014 1:03 pm
Bot?: No

Quick Question About Ladder Logic

Post by fbones »

Hello all. I put together a BCS-462 system based off of the thread here http://www.homebrewtalk.com/f51/diy-gly ... ers-413406 to help run stable fermentation on 6 tanks. I am only using this system for fermentation at this time. I am running into a problem with some of the ladder logic. I am trying to set it so that anytime any one of the coils opens for cooling, or if the ac unit turns on to cool the glycol reservoir, that the waterfall pump I have in the glycol tank kicks on. I was planning on doing this by running each process through the ladder logic, and make the pump requisite for each one to complete the cycle. The problem I seem to be running into, is that each "section" of the Ladder Logic seems to be broken down into 4 rungs. If I try and mimic the sequence after the first four rungs, but with the remaining 3 fermentors, it seems to cancel out the operation above it (the glycol chill and first 3 fermentors.). I am going to try and link a picture of how I have the ladder logic set up, as I am sure most of what I am trying to portray is not making a whole lot of sense. If anyone has any ideas, please let me know. Thanks!
Attachments
Ladder Logic Screenshot.png
Ladder Logic Screenshot.png (34.84 KiB) Viewed 6701 times
brahn
Posts: 543
Joined: Thu Dec 13, 2012 11:01 am
Bot?: No

Re: Quick Question About Ladder Logic

Post by brahn »

There may be an easier way, but off the top of my head you could replace the OUT8 with a different register in each of the two blocks then put those in parallel ("or" configuration) to control OUT8.
fbones
Posts: 12
Joined: Tue Oct 21, 2014 1:03 pm
Bot?: No

Re: Quick Question About Ladder Logic

Post by fbones »

brahn wrote:There may be an easier way, but off the top of my head you could replace the OUT8 with a different register in each of the two blocks then put those in parallel ("or" configuration) to control OUT8.
So this is where my total lack of understanding about how any of this works is really going to shine through. I don't really have a clue what you are suggesting...lol. Just for reference, the OUT8 is the pump that I want to run when any of the other OUT's are actuated.
brahn
Posts: 543
Joined: Thu Dec 13, 2012 11:01 am
Bot?: No

Re: Quick Question About Ladder Logic

Post by brahn »

In the Ladder Logic editor you can choose an "Internal Register", these can be set in various places like processes or ladder logic and then used like a DIN.

I'm not going to set it up all the way, but you should get the idea looking at this:
example.png
example.png (12.17 KiB) Viewed 6689 times
You'd need to use 3 of the 4 rung blocks to do this in your setup.
User avatar
SamIam
Posts: 51
Joined: Fri Aug 19, 2011 1:34 pm
Bot?: No

Re: Quick Question About Ladder Logic

Post by SamIam »

I haven't tested it but have you tried just extending the "OR" condition between rung 3 and 4? If not, Brent's suggestion should work.
brahn
Posts: 543
Joined: Thu Dec 13, 2012 11:01 am
Bot?: No

Re: Quick Question About Ladder Logic

Post by brahn »

Nope, you can't extend the OR between rung 3 and 4. The 4 rung blocks are independent. I assume this was done for performance reasons when evaluating the ladder logic since it updates so often.
JonW
Site Admin
Posts: 1726
Joined: Sun Jul 18, 2010 7:51 am
Bot?: No
Location: Huntington Beach, CA
Contact:

Re: Quick Question About Ladder Logic

Post by JonW »

I was going to suggest the same thing that brahn did. Use registers.

Registers are kind of like variables. They don't directly turn anything on or off, but you can set (assert) them on or off. You can then use their value in the ladder logic to trigger your pump.

In your current config, replace Out8 in the first block with Reg0. Replace Out8 in the second block with Reg1. Create a 3rd block similar to your first two, but this time use Reg0 and Reg1 as the OR conditions and Out8 as the final output.

In psuedo code, the 3 blocks would be interpreted like the following:
Block 1 : IF (Out0 OR Out1 OR Out2 OR Out3) = On THEN Reg0 = On
Block 2 : IF (Out4 OR Out5 OR Out6) = On THEN Reg1 = On
Block 3 : IF (Reg0 OR Reg1) = On THEN Out8=On
fbones
Posts: 12
Joined: Tue Oct 21, 2014 1:03 pm
Bot?: No

Re: Quick Question About Ladder Logic

Post by fbones »

brahn wrote:In the Ladder Logic editor you can choose an "Internal Register", these can be set in various places like processes or ladder logic and then used like a DIN.

I'm not going to set it up all the way, but you should get the idea looking at this:
example.png
You'd need to use 3 of the 4 rung blocks to do this in your setup.
Ok, I "think" I get what you are saying. I will give it a whirl when I get out of work tonight.
JonW
Site Admin
Posts: 1726
Joined: Sun Jul 18, 2010 7:51 am
Bot?: No
Location: Huntington Beach, CA
Contact:

Re: Quick Question About Ladder Logic

Post by JonW »

Here's a screenshot of how it should be setup:
SnipImage.JPG
SnipImage.JPG (50.81 KiB) Viewed 6676 times
fbones
Posts: 12
Joined: Tue Oct 21, 2014 1:03 pm
Bot?: No

Re: Quick Question About Ladder Logic

Post by fbones »

Ok, so this appears to have solved the original problem, however it seems that now the system will not turn off when any of the tanks hit below the hysterisis range. If anyone has any ideas, I would greatly appreciate it, as I have 160 bushels of apples showing up this weekend. I can post the IP for the system if that helps anyone. Thanks in advance for any help!!
Post Reply