Home AMX User Forum AMX General Discussion

Using High Channel Numbers

I'm looking at a module written for a CLO X-arm motorized TV mount, and there are 12 buttons for this device (in, out, tilt up, etc..) but the channel numbers that they used on the touchpanel are in the 3300+ range.

There was talk on a post a long time ago about the resource drain created by using these high numbers and how it was a waste when the previous channels are unused. I was wondering if there was any verdict regarding the memory drain on these high numbers, or is this necessary to take into consideration when programming. If so, do these also take up large memory resources when being used as channels on virtual devices too?

Thanks, and Happy Easter to all those who will be celebrating it!


--John

Comments

  • DHawthorneDHawthorne Posts: 4,584
    If you assign a channel 3300, then the master will allocate resources for channels 1-3299 as well. All of those channels are tracked by the master internally, even if no programming is attached to them. You could get away with it in a small system, but multiply it by a dozen panels, and perhaps a dozen ports, and you will start to see issues. It's simply a bad practice unless there is a real need (like channels 1-3299 are actually in use). The same, by the way, goes for ports. If you assign port 23 to a touch panel page's buttons, the resources for ports 1-22 will also be allocated.

    I don't think it's enough to matter if you've skipped a few ports to allow for growth and keep things organized, or if you have button ranges a hundred or so channels above another set of channels just to keep it neat. But, jumping ahead thousands of channels is a bit much. I would re-assign them if possible (which may not be if it's hard coded into a compiled module).
  • DHawthorne wrote: »
    If you assign a channel 3300, then the master will allocate resources for channels 1-3299 as well. All of those channels are tracked by the master internally, even if no programming is attached to them. You could get away with it in a small system, but multiply it by a dozen panels, and perhaps a dozen ports, and you will start to see issues. It's simply a bad practice unless there is a real need (like channels 1-3299 are actually in use). The same, by the way, goes for ports. If you assign port 23 to a touch panel page's buttons, the resources for ports 1-22 will also be allocated.

    I don't think it's enough to matter if you've skipped a few ports to allow for growth and keep things organized, or if you have button ranges a hundred or so channels above another set of channels just to keep it neat. But, jumping ahead thousands of channels is a bit much. I would re-assign them if possible (which may not be if it's hard coded into a compiled module).

    Thanks for the response Dave. Seeing this particular module which is used to control a device with 12 buttons and almost no feedback caused me to think of that post a few years ago where the port numbers and channel numbers issue was brought up. I guess as a matter of programming practice, it would be more efficient to keep the channel numbers tightened up with room to add some in-betweens if the need arises. It would not be fun to have to go in and re-number several hundreds of buttons on a large project after discovering that they're causing trouble :).

    --John
  • CT-DallasCT-Dallas Posts: 157
    John,
    I control these via IR and have had great success. We have about 10 in the field amongst several houses. I am not a fan of their serial connector, so on my first install we cut back to IR just to make it work and have never looked back. I use preset 1 for the out and center position and preset 2 for the general viewing location. In general, on a mio remote, I will give them one macro button to MoveTV and that is a toggle between preset 2 and the IN/OUT (return to home) buttons. On a touch panel, I give them full control.

    We ran into the port/channel allocation problem recently at a residence with 26 pannels on a NI4000. I added a weather module to port 100. My thought was that moving forward we could always count on that port being free. Another programmer was onsite and noticed what I had done by watching the panel online/offline events in telnet and he caught it. That was the first I had heard about it, but it makes sense. It truly brought the NI to its knees. That combined with another for loop issue crashed the NI. It was funny to watch the equivalent of a Blue Screen of Death happen to the NI.

    In the other sites that I had installed the Weather Module on port 100, they did not have anywhere near the number of panels, so it was not readily apparent. I would agree with Dave that as a matter of programming practices, condensing the port/channel numbers is the way to go. If I had not witnessed the crash, I probably would have never paid any attention to it and would have really fallen into a bad habit.
  • a_riot42a_riot42 Posts: 1,624
    I have a touch panel file that used to use port 38 but I deleted it from all the buttons for this reason. But when the panel comes online it still initializes ports 1-38. Doing a find on port 38 on the file turns up nothing. Ghost ports...bizarre...
    Paul
Sign In or Register to comment.