Programming Doubt
vijaykumar
Junior Member
Hi guys.,
just i am giving how can i do the program for amx devices,,present i am having a modules Met-Ecom , Matrix audio controller and csg-544 SIP ...Etc
in my Netlinx project ..for every module main file code..i am copying and paste in my Main(Master file) Project File,for that one in my project master file having the lot of code..
IS THEIR ANY OTHER WAY TO INSERT THOSE MODULES WITHOUT COPY OR EDIT IN MY PROJECT ..
just i am giving how can i do the program for amx devices,,present i am having a modules Met-Ecom , Matrix audio controller and csg-544 SIP ...Etc
in my Netlinx project ..for every module main file code..i am copying and paste in my Main(Master file) Project File,for that one in my project master file having the lot of code..
IS THEIR ANY OTHER WAY TO INSERT THOSE MODULES WITHOUT COPY OR EDIT IN MY PROJECT ..
Comments
-
There are a number of ways you can structure your code so that it a lot more maintainable / readable / functional. Copying and pasting from the demo implementation that comes with modules is not one of them.
All that you need to utilize the modules is to instantiate them using 'define_module', you will then communicate with them via string, command and channel events on the attached virtual device as defined in the module API doc. From there you can separate functionality out into include files etc and utilize functions for handling repeated tasks to maximize code re-use and/or provide a further level of abstraction from the module API. -
The "Main" files that come with modules are just there to tell you what is needed to make the module run, and how you put it in your program is entirely up to you. The better written ones only have the necessary variable and device declarations besides the define_module line itself. I generally like to organize my programs so variables for modules have their own spot I can easily go to, and I rename them so it's clear what they are for. For example, almost every module out there has a pane named dvTP or just TP - if you put them all in unchanged, the compiler will barf, but even one like that might leave you scratching your head two months later when you don't remember what module it belongs to.
Leave a Comment
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums