ports or codes extension
John Paul
Posts: 143
I usually use different ports in tpd4 file per device so that i can start each codes of the device from 1. I want to know if this is a good practice since sometimes due to the amount of devices, the ports have grown up to 60 but i may be using only 50 functions per device. Which process is processor intensive?
0
Comments
I've *never* been a fan of using different ports for different devices. Below is how do control devices; something like this will allow you to expand your system without having to grow very much code, especially in the control portion. When I leave a job I want to be able to expand it, if the client requests, with minimal changes. This is not only beneficial to the client because it won't take very long, but for the company as well. If I have to add two more cable boxes, I modify two structure in my code and I'm done; I don't have to change anything in the panel in terms of the control side of things.
Zone, and Panel are both structures that store important information and are modified prior to this section of code being used.
1 for 1-way controlled devices (cable box, satellite, bluray, appletv, etc)
and then 1 per sub system or devices with 2-way feedback (security, lights, sirius, kscape, etc).
My typical projects are around 6 - 11 ports per touch panel - and these are full distributed a/v systems that are anywhere from 8-36 rooms of audio and 8-16 video displays.
I tried to follow AMXs conventions on standard buttons, Like 'Play' is channel 1, etc....
I then tracked what panel was controlling what device in code. It made everything so much simpler over time. Adding a new device became rather easy. The device-by-port method ran out of room pretty fast and you were'nt really organizing/consolidating code never really happened.
Like Vining, I wish I knew then what i knew now. I hear that a lot...
I do the exact same thing. I've never encountered any issues doing it this way.
Paul
.
The problem is once you go down the easy path and then realize the benefits that are available on the path less taken it's hard to convert. Quite frankly when I started out I was only exposed to PI & PII, didn't know about this forum and had no other programmers to learn from and the single port approach never dawned on me and probably would have been over my head. Still is a little bit.
+1
(and some characters)
Performance wise I don't have an understanding of what happens in the firmware layer but from my observations I have not noted any significant performance penalty / benefit with either of theses approaches. However, any impact would likely be more memory intensive rather than processing intensive.
That all being said the framework is there and flexible enough to allow you to utilize whatever approach works best for you and the developers that you work with. Just for the love of all things good if you are going to use one approach at least stick to it for that entire project.