OmniPro II- Security flag Counter using voice

spark480

New Member
I am trying to create a voice countdown on my Omni Pro II for my auto arming of my security. I currently have an "auto arm flag"  for our warehouse because we use the HAI access control card swipe for employees.  The card access overrides the security arming temporary in shop until no motion or doors are "not secure" for 15 minutes then security arms itself. I use a "Flag Set" of 15 minutes when a motion or door is tripped and decrement  every minute of no trips until 15 minutes elapse and security arms.
 
I want to initiate a voice over the speakers through my 2 way voice module and speakers at the  5 min, 4 min, 3 min, 2 min, 1 min. mark of the flag countdown, to alert employees if there in a part of shop that has no motion or they have not been moving for 15 minutes. I cannot figure out how to initiate the voice in the line of programming at the flag counter values of 5,4,3,2,1. I have tried the following and cannot get the voice to initiate. 
 
41. WHEN SHOP
AND IF SHOP ACCESS GRANTED
THEN PROGRAM DISARM
 
12. WHEN REAR DOOR C NOT READY
THEN SET AUTO ARM TO 15
 
13. WHEN MOTION C SHOP  NOT READY
THEN SET AUTO ARM TO 15
 
14. EVERY MINUTE
 
AND IF REAR DOOR C SECURE
AND IF MOTION C SHOP SECURE
THEN DECREMENT AUTO ARM
 

15. WHEN AUTO ARM ON
AND IF AUTO ARM CURRENT VALUE IS 5 
THEN SAY ARMED IN FIVE MINUTES
 

16. WHEN AUTO ARM OFF
THEN PROGRAM ARM AWAY
 
 
 
 
Hi:
 
Welcome.  The secret is to not to try to do too many things in one action. So maybe one flag will be a minute timer and another to actually count down, and then another to do the speaking. 
 
Here is a little trick to do several tests in one action.  So for example, you have a flag with a number, 1,2,3,4,or,5 and you want to speak, how do you do that?  Use a button and use the unnamed buttons that start at 129. 
 
So lets say you flag is called "flag" and it contains the number to speak.  Unfortunately you will need 5 speak messages because the Omni can't speak a number, but buttons can help.
So create 5 messages, Armed in 5 minutes, Armed in 4 minutes, etc.
 
Then create 5 buttons, 129, 130, 131, 132, and 133.  For each one, create something like:  If flag equals 1 then say Armed in 1 Minutes. For the next flag:  If flag equals 2 then say Armed in 2 Minutes.  Do this for all 5.
 
Now, with one action that trips every minute, just call each flag in succession, so four of the buttons will do nothing, but the one that matches the flag value will speak.  Call the action 5 times once per minute and decrement the flag value.
 
That isn't the full solution, but should get you started.
 
So, can the Omni recognize the value "number more than 0"  of a flag that is in decrement.  Or will it just recognize ( when its counting down which is in its on state)  or when its " 0  or off state"? Because my testing so far has the Omni speaking whenever its at any value more than "0".  Even though I give it a command to speak ONLY when the flag value is equal to a certain number "value" like 5. 
 
What code are you using?
Up you can test for on, off, greater than, less than and equal to, not equal to a specific value.
You can only use on/off as triggers, so you need to use something as a trigger to test for the value.

In block 15 you are using the ON trigger and testing for a value of 5
Since this block ONLY executes when the flag is first turned on, and you turn it on to a value of 5 it will NEVER execute.
Actually, I need to test this.
Since you are using the SET TO a value function, it may not even generate a WHEN ON event.
When you set a flat to a value of 0 it does not generate a WHEN OFF trigger, but I'm not sure if it works the other way.
Either way, as written, block 15 will never execute.


Instead of setting the flag to a value like you do in 12 above, you can set it as an actual timer, on for 15 minutes.

You could also use two flags, use one as a timer and one as a counter.
This prevents you from having to use then WHEN EVERY MINUTE statement which executes every minute of every day regardless.
Set the timer flag to ON FOR 1 MINUTE, and your counter flag to 15 (or whatever you want)
When the timer gets to 0 and turns off, you decrement the counter and turn the timer flag back on to 1 minute.
Then you can also test for the counter value each time the timer gets to 0 and perform different actions based on the counter flag value.
 
Thanks, this worked below.    What i have learned is you can not trigger an action based off of a number value of a trigger.  But you can use a flag on or off status to trigger an action with a condition of a flag numeral value. Using a timer and a counter simultaneously gets it done.
 
1. WHEN SHOP MOTION NOT READY
THEN SET Counter TO 15
 
2. WHEN SHOP MOTION NOT READY
THEN timer ON FOR 1 MINUTE
 
3. WHEN timer OFF
THEN DECREMENT Counter
THEN timer ON FOR 1 MINUTE
 
4. WHEN timer OFF
AND IF Counter CURRENT VALUE IS 5 
THEN SAY ARMED IN 5 MINUTES
 
5. WHEN timer OFF
AND IF Counter CURRENT VALUE IS 4 
THEN SAY ARMED IN 4 MINUTES 
 
.............

16. WHEN COUNTER OFF
THEN PROGRAM ARM AWAY
 
 
spark480 said:
Thanks, this worked below.    What i have learned is you can not trigger an action based off of a number value of a trigger.  But you can use a flag on or off status to trigger an action with a condition of a flag numeral value. Using a timer and a counter simultaneously gets it done.
 
1. WHEN SHOP MOTION NOT READY
THEN SET Counter TO 15
 
2. WHEN SHOP MOTION NOT READY
THEN timer ON FOR 1 MINUTE
 
3. WHEN timer OFF
THEN DECREMENT Counter
THEN timer ON FOR 1 MINUTE
 
4. WHEN timer OFF
AND IF Counter CURRENT VALUE IS 5 
THEN SAY ARMED IN 5 MINUTES
 
5. WHEN timer OFF
AND IF Counter CURRENT VALUE IS 4 
THEN SAY ARMED IN 4 MINUTES 
 
.............

16. WHEN COUNTER OFF
THEN PROGRAM ARM AWAY
 
If you want to be compressed its better to not have many actions with the same trigger. Every trigger slows the programming just a tiny bit.  So you could combine all these actions into one like I described previously. 
 
Just make each test and action into a button. So:
WHEN BUTTON 129
THEN DECREMENT Counter
THEN timer ON FOR 1 MINUTE
 
WHEN BUTTON 130

AND IF Counter CURRENT VALUE IS 5 
THEN SAY ARMED IN 5 MINUTES
 

WHEN BUTTON 131

AND IF Counter CURRENT VALUE IS 4 
THEN SAY ARMED IN 4 MINUTES

 
etc. 
 
Then just put it all in one action:
 
When Timer OFF
THEN BUTTON 129
THEN BUTTON 130
THEN BUTTON 131
etc.
 
So this ONE action will call all the other buttons, and each button can have a test and an action.
 
Back
Top