Problems with the delay
m.quinti
Posts: 16
Dear all,
I am working with a Ademco Vista Security System and a AMX system which control the lighting of the house.
I send, by AMX, in each 5 seconds, a string by serial interface to the Ademco Vista requesting the report of all zones of the security system.
Like this:
IF (WAITING=0)
{
WAITING=1
SEND_STRING ALARME_RS,"'08zs004B',13"
WAIT 50
{WAITING=0}
}
Here I get the report and divide it for show the status of the windows and doors in Modero panels, if open, closed...etc
The problem is that 5 seconds is a big delay for the answer in the panels, and if I use a lower time for send the request, the lighting of the house has a big dalay too...I think is that the AMX is so busy...I think so
Someone has some ideia for eliminate the delay to request the status of the zones without to harm the lighting system?
Thank you very much
I am working with a Ademco Vista Security System and a AMX system which control the lighting of the house.
I send, by AMX, in each 5 seconds, a string by serial interface to the Ademco Vista requesting the report of all zones of the security system.
Like this:
IF (WAITING=0)
{
WAITING=1
SEND_STRING ALARME_RS,"'08zs004B',13"
WAIT 50
{WAITING=0}
}
Here I get the report and divide it for show the status of the windows and doors in Modero panels, if open, closed...etc
The problem is that 5 seconds is a big delay for the answer in the panels, and if I use a lower time for send the request, the lighting of the house has a big dalay too...I think is that the AMX is so busy...I think so
Someone has some ideia for eliminate the delay to request the status of the zones without to harm the lighting system?
Thank you very much
0
Comments
So there is some polling that needs to be done, but you need to be careful. Test the alarm liberally, if you poll it too much it will interfere with the alarm's ability to dial out. This is what happens when you put RS-232 control into your product as an afterthought, IMHO.
WAIT 50 SEND_STRING Dev,'blah'
shrinks the code you have down by several lines and works the same...
- Chip
creepy...
Would you please tell us, Which section is this code added to?
If in Define_Program, I think your master is suffering a never ending nightmare.
DEFINE_PROGRAM
IF (ASKPROJ = 0)
{
ASKPROJ = 1
WAIT 50
{
SEND_STRING dvLCDProjector,"$00,$85,$00,$00,$01,$01,$87"
ASKPROJ = 0
}
}
This seems to work just fine and doesnt seem to completely gum up the processing speed, but I would love to be able to get away from making an IF comparative every time it runs through the main line of code. Any ideas?
Although there is no reason to dislike this( as Joe Hebert mentioned ), but I don't like it t00 , so I create a timeline to poll all devices status every 5 or 10 seconds
WAIT 50
{
SEND_STRING dvLCDProjector,"$00,$85,$00,$00,$01,$01,$87"
}
So , What would prevent the wait from being added to the list?
That being said, most of the time there is only about a 1-2 second delay from the time a motion sensor is tripped until the time it is reported by the panel. I have noticed that occasionally an event is lost when there are multiple events happening at once. I am toying with the idea of polling every 5-15 minutes just to catch those occasional misses, but as was said earlier, polling definitely breaks any dial out communication. I am also thinking that I might be able to monitor for call back requests and program mode entry/exits that will disable the polling to help alleviate some of the problems caused by polling.
If the alarm panel is not sending the information automatically, you either have the old firmware, or the settings on the alarm panel aren't correct. Make sure that the following are set:
*05 = 1
*14 = 1
1*78 = 1
1*79 = 1
2*30 = 0
3*19 = 1
Those are the settings I normally use and they work well.
Ohhh, also be sure to make your own serial wire. I just tried an FBP250 on my test bench with the wires that are included and it wouldn't work until I put a custom cable in the mix.
Jeff
No, this is not right, the wait will be added to the list no matter what, I have tried it by my self, If you are right , then tell me how can NetLinx identify if this wait already there or not. and support your idea with a document
DEFINE_PROGRAM
WAIT 50 SEND_STRING 0, 'AMXJeff is correct!'
http://www.amx.com/techsupport/techNote.asp?id=208
You could also name the WAIT statement which allows you to pause and cancel the WAIT in addition to only executing one instance of the wait:
A queue is fine if you have the time to set it up.
I just name the wait and then CANCEL_WAIT before sending a command.
Polling will start again next time through main line.
Quick, dirty, simple, and works.
You only have to code your queue include once; then you can use it as many times as you like for the rest of your career.
I'll Check and reply back in a different thread, we are already off topic
Thanks Jeff
If that were not the case, the classic "blink" code from the dawn of forever would not work:
When ErrorStateExists is non-zero, the button on TP with channel ErrorButton will blink on and off with half-second cycles. If what you believe was in reality correct, the button would blink extremely erratically.
- Chip
furthermore, do what others have said. Only check status when entering the "security" page
As for using Timelines, maybe its just me but i cant stand using them. At least in the form that I have used them, by creating timeline arrays, and constants. It just seems to go a bit overly complicated for something as simple as repeating a RS232 String.