Alarm State

Suggestions, Problems, Availability, etc. Everything is up for discussion.
Post Reply
Kent
Posts: 46
Joined: Mon Oct 31, 2011 12:54 pm
Bot?: No

Alarm State

Post by Kent »

I am using a Grant, with a float setup. So I cycle between one state to circulate and one state to stop circulate when the grant gets to low. In each of those states I am set up to go to a third state when my mash time is up.

My question is, is there a simple way to set up an alarm that only goes off when I go to the 3rd state? Right now I am wasting a state and a timer with 1 second to fire the alarm. There is a few places I want the program to alert me that I need to do something and it isn't just the pump stopping to allow the grant to catch up. Do I need to try to figure out ladder logic?

I guess this might be a wish, that we could have an alarm on entering a state. It seems almost more useful, since states can have multiple reasons for exiting.

Or am I missing something simple that does what I need?
JonW
Site Admin
Posts: 1726
Joined: Sun Jul 18, 2010 7:51 am
Bot?: No
Location: Huntington Beach, CA
Contact:

Re: Alarm State

Post by JonW »

You're not missing anything.... that's the way alarms work. They trigger on exit condition only.
brahn
Posts: 543
Joined: Thu Dec 13, 2012 11:01 am
Bot?: No

Re: Alarm State

Post by brahn »

You say you're "wasting" a state and a timer to trigger the alarm. Do you need that state for something else? If not, you're not really wasting anything. If you don't like the timer, you could use temp >= 0F and it would exit within 100ms.

I'd have to think this through a bit more, but I bet you could use ladder logic to cycle the pump for your grant rather than using 2 states. That could save you 2 states since you wouldn't need the alarm trigger state either. But unless you really need that state for some other purpose, I think your solution is simpler and better.

There's no reason we couldn't trigger an alarm when entering a state, but I think it makes more sense to trigger on exit.

On the other hand, I think the fact that process spawn/kill happens on exit is really strange.
Kent
Posts: 46
Joined: Mon Oct 31, 2011 12:54 pm
Bot?: No

Re: Alarm State

Post by Kent »

Thanks to both of you.
You are correct, I do have plenty of states available. Probably for no good reason I was trying to keep all the Mash stuff in one Process, and I have run out of states in that process. I guess part of the issue is since adding the grant and its float, there is a number of places I need to add the pump, no pump, and alarm states, and when I do that, I need to recreate all the states that come after it. It would be nice to copy and paste states or else be able to "Insert" a state, which would bump all the states below it down one.

At one time I had started to write a program that would allow that type of editing to the *.cfg files, but I never could quite figure out what every delimited item was for.
brahn
Posts: 543
Joined: Thu Dec 13, 2012 11:01 am
Bot?: No

Re: Alarm State

Post by brahn »

In that case, I'd say you do need the state for something else. You should be able to keep all the mash stuff in one process.

I think your best bet would be to use ladder logic to control the pump while you're in the grant state. I think you could do it with something like this. This assumes that the float switch is Discrete Input 2, and your pump is on Output 2. You would tell the grant state to turn on register 2 and the register works like a gate to prevent this logic from triggering if you aren't in the grant state.
ladder.png
ladder.png (5.68 KiB) Viewed 5237 times
It depends on how your float switch is set up, it may need to be NC instead of NO to trigger the pump correctly.

I agree completely about the API / .cfg files being hard to figure out. That's why we're in the process of rewriting the API from scratch!
Kent
Posts: 46
Joined: Mon Oct 31, 2011 12:54 pm
Bot?: No

Re: Alarm State

Post by Kent »

Thanks again,

Ok, so I am trying to figure out how to use ladder logic. I can drag the various items out, but I can't seem to figure out how to hook up the line between them. Not trying to be a pain, but things like this is where a step by step in the wiki would be really helpful. Please forgive me if I am missing it
JonW
Site Admin
Posts: 1726
Joined: Sun Jul 18, 2010 7:51 am
Bot?: No
Location: Huntington Beach, CA
Contact:

Re: Alarm State

Post by JonW »

There is a section in the Wiki on it : http://wiki.embeddedcc.com/index.php/Ladder_Logic

When using multiple lines of logic that are linked together, you can click on the connector multiple times to change the type of link.
Kent
Posts: 46
Joined: Mon Oct 31, 2011 12:54 pm
Bot?: No

Re: Alarm State

Post by Kent »

Thanks Jon,

I must have read right over that line thinking it had to do with adding lines in the boxes. Makes sense now.
Post Reply