System 'snappiness'
a_riot42
Posts: 1,624
I am nearing completion of a decent sized project with an NI4100 that is completely loaded, every comm port, IR port, card slot, couple of card shells etc. There are 13 RS-232 devices in total, 11 Moderos, 8 R4s and 3 DMSs. All Moderos have whole house control of all systems. There are many data intensive modules running, including HVAC, Lutron, Kaleidescapes, iPort, Security, Intellitouch, 2 Autopatch modules, B&K rcvr etc. With my previous employer using their modules/paradigm, I always noticed that jobs of this size made the feedback a little slow, and the system response always seemed 50-100 ms behind the user, not bad but enough to notice. This was always a disappointment to me since this expensive AMX system responded slower than the $20 IR remote. I had assumed it an unavoidable symptom of projects this size.
For this job, I made sure that no module communicates with a touch panel unless it has to, and no code resides in define_program and all feedback is lazy in that no feedback is done unless someone is looking at the page. I have found that I have been rewarded with system 'snappiness' that is much higher than the similar jobs with my previous employer. I have a page that has twenty or so text fields on it that get filled when the page flip happens. I had figured this would be slow enough to notice, but it has not turned out to be the case as it is almost instantaneous. The security system that updates faulted zones to the touch panel is as close to instantaneous as possible. As well, I have a page with 5 IP cameras on it and it appears instantaneously as well, with no delay as opposed to previous projects where they would take a few seconds to show up.
I know many don't agree with me that define_program doesn't slow things down but after this project I am convinced that a carefully programmed system with a goal to keep CPU and memory resource use at a minimum is really worthwhile in the end and results in a much faster responding system. Anyone else experienced this as well?
I wouldn't mention it except that the responsiveness is so noticeable that it bears mentioning. Even VNCing into the panels from 1000 miles away over the internet, the TP responsiveness is noticeably better than jobs I had done with my previous employer with the panel in front of me so I will do all my projects this way from now on. I am just surprised how much difference it made considering others always say writing code in define_program doesn't slow down processing.
Paul
For this job, I made sure that no module communicates with a touch panel unless it has to, and no code resides in define_program and all feedback is lazy in that no feedback is done unless someone is looking at the page. I have found that I have been rewarded with system 'snappiness' that is much higher than the similar jobs with my previous employer. I have a page that has twenty or so text fields on it that get filled when the page flip happens. I had figured this would be slow enough to notice, but it has not turned out to be the case as it is almost instantaneous. The security system that updates faulted zones to the touch panel is as close to instantaneous as possible. As well, I have a page with 5 IP cameras on it and it appears instantaneously as well, with no delay as opposed to previous projects where they would take a few seconds to show up.
I know many don't agree with me that define_program doesn't slow things down but after this project I am convinced that a carefully programmed system with a goal to keep CPU and memory resource use at a minimum is really worthwhile in the end and results in a much faster responding system. Anyone else experienced this as well?
I wouldn't mention it except that the responsiveness is so noticeable that it bears mentioning. Even VNCing into the panels from 1000 miles away over the internet, the TP responsiveness is noticeably better than jobs I had done with my previous employer with the panel in front of me so I will do all my projects this way from now on. I am just surprised how much difference it made considering others always say writing code in define_program doesn't slow down processing.
Paul
0
Comments
The first goal in programming is to get things to work and when you're comfortably at that then you can take the time to make things work better. I think that's where I'm at now and managing feedback is a must and this point. The idea of sending channel or text feedback to an array of TPs none of which are being used or on the page for which the feedback is being sent is in no way effecient or proper use of the processor resources but that's what I and most of us have been doing and what anyone using an AMX module is doing. Unforntunately that means I have to go backwards and re-write some modules. At least when taking two steps forward for each step backward I'm still heading in the right direction. I think?
I thought of using page tracking but I found it too complicated since the strings coming from the panel aren't formatted in a way I would like, and it uses actual page/popup names so it isn't very portable. Have you had good luck with it? I used a different method that uses integers rather than strings and no page or popup names. It really requires very little modification of a module, and is much more efficient so its worth it to me.
Paul
I'm still working on figuring the best way to handle all of this but this is what I'm doing presently. I did try Dave's Combine/Un-combine function but I had problems with the virtual device. I'm sure it was just the way I was using it since I believe Dave has been using it fine for years and I have problems just getting dressed in the morning, socks don't match, shirt inside out....
Yes I understand, I had thought that you meant you were using the page track command. I do somethign very similar without the timeline event and it seems to work well. I never use the combine/uncombine functionality although I have a feeling that if we looked at the code, its probably just a for loop tracking an array
Paul
Sounds like a great project, great to hear it's running smooth.
I've been preaching for years.
http://www.amxforums.com/showpost.php?p=26348&postcount=34
I never saw that post originally, thanks. I use the Kaleidescape module and I think its ok, but it has the slowest button feedback, even though it only provides feedback for panels that are controlling it. Here is the code. I do not like the way this is done and its no surprise its slow.
They make the mistake of calling length_array every single time in the for loop as well...tsk tsk. I will change this around and see if it helps feedback. Having a for loop inside define_program constantly running is bad style in my opinion. How much of the total time is spent hitting button that require feedback? 0.1% of the time, yet it checks constantly.
Paul
You can even create multiple timelines with different instance ids, and tie those ids to different pages that automagically trigger the corresponding timeline for feedback