Home NetLinx Studio

Issues With Modules

ondrovicondrovic Junior MemberPosts: 217
I have been working on this program for a client and everything seems to be ok but when I add more instances of the module none of the DMS keypads, or touchpanels will work.

Anyone have any ideas?

I have attached the full workspace.

Thanks Again

Comments

  • Spire_JeffSpire_Jeff Formerly Caffeinated Programmer Posts: 1,917
    You say that you have problems when you add more instances of the module, but I don't see any indication of which module you are adding to cause the problem?

    Are you encountering problems when you define multiple DMS Keypads? Or when you define multiple Z_Tuner modules?

    On a quick look at what you have, it seems that you are defining multiple instances for a single tuner device. There should only be one comm module defined per physical device. I think you may need to split your modules into COMM and UI modules. I think the fact that multiple modules are trying to talk to one device independant of each other is causing your problem.

    There are a couple ways in which you could handle the task. You could use a virtual device for UI interface and combine other interface devices on the fly. You could use device arrays and different ports. I'm sure someone can come up with another way or ways as well.

    If this is the module definition you are refering to, I will try to give you a few more details to try and help.

    Jeff
  • ondrovicondrovic Junior Member Posts: 217
    Sorry about being unclear. The program works fine with all the instances of the modules ( music, z-tuner & request ) with the DMS keypads. It also works fine with one instance ( music, reques & z-tuner ) on one touch panel. It seems when I add the following that the program gets all screwed up :

    Music Module :
    #IF_DEFINED dvTP1
    DEFINE_MODULE 'MusicPresetMod v2' MusicMod_CP4_1	 (
    						    dvTP1,
    						    dvSatM,
    						    nMusic_CP4_Sc_Button,
    						    nMusic_CP4_Buttons,
    						    nMusic_VText,
    						    nCP4_Music_Nav_Fields,
    						    nCP4_Music_Genres,
    						    nCP4_Music_Channels,
    						    nCP4_Enter_Option,
    						    nMusicPreset,
    						    nCur_Music_Preset
    						    );
    #END_IF
    

    ReQuest Module :
    #if_defined arqTP1
    DEFINE_MODULE 'ARQ TP UI v5_0_1' ARQ_TP_1    (arqTP1,			/// Touch Panel Device
                                                  ARQ_UNITS,		/// Virtual AudioReQuest Devices
                                                  ARQ_SELECT,		/// ARQ selection channels
                                                  ARQ_DISCONNECT,		/// ARQ deselection channel
                                                  ARQ_CMDS,			/// Command Channel Array
                                                  ARQ_ADV_CMDS,		/// Advanced Command Channel Array
                                                  ARQ_KEYBOARD_CH,		/// Keyboard Channel Array
                                                  ARQ_NUM_CH,		/// Numbers Channel Array
                                                  ARQ_FB_CH,		/// Variable Text Channel Array
                                                  ARQ_ELAPSED_LVL,		/// Level for Elapsed Time progress bar
                                                  ARQ_DYNAMIC_IMAGES,	/// Dynamic image resource names for Cover Art
                                                  ARQ_LINE_PRESS_DOUBLE,	/// Line Press Type (single or double)
                                                  ARQ_NUM_LINES[6]);	/// Number of lines on Browse page (change array index to 1-8)
    #end_if
    

    Z-Tuner Module :
    #IF_DEFINED dvTP1
    DEFINE_MODULE 'Z-Tuner Mod' TunerMod_CP4_1	(
    						    dvTP1,
    						    dvTuner,
    						    nTuner_Buttons,
    						    nTuner_Preset,
    						    nTuner_VTxt,
    						    nCP4_Tuner_Nav_Fields,
    						    nCP4_Tuner_Max_Pages
    						    );
    #END_IF
    

    These are the only other instances that I need to add because its the only 2-way touchpanel that I have.

    Hope this helps to clear things up

    Thanks again
  • ondrovicondrovic Junior Member Posts: 217
    After doing a little more research into it it seems to be this line that is cause the system to lock up and not work :
    #IF_DEFINED dvTP1
    DEFINE_MODULE 'MusicPresetMod v2' MusicMod_CP4_1	 (
    						    dvTP1,
    						    dvSatM,
    						    nMusic_CP4_Sc_Button,
    						    nMusic_CP4_Buttons,
    						    nMusic_VText,
    						    nCP4_Music_Nav_Fields,
    						    nCP4_Music_Genres,
    						    nCP4_Music_Channels,
    						    nCP4_Enter_Option,
    						    nMusicPreset,
    						    nCur_Music_Preset
    						    );
    #END_IF
    

    The others seem to be working fine.

    Spire_Jeff -- I will try what you suggested about splitting them up into a COMM / TP files to see if that helps. Thanks for the input. If anyone else has any ideas please let me know.

    Thanks
  • viningvining X Member Posts: 4,358
    dvTP1	=	128:1:1		/// Master Bedroom Touch Panel
    dvTP2	=	132:1:1		/// Media Room Touch Panel
    dvTP3	=	136:1:1		/// Kitchen Touch Panel
    
    arqTP1	=	129:1:1		/// ReQuest TP
    arqTP2	=	133:1:1		/// ReQuest TP
    arqTP3	=	137:1:1		/// ReQuest TP
    

    Are there just three touch panels or six? The above would indicate six but I'm thinking you only have three and the arq's should be ports on the TP's not there own TP.
    dvTP1	=	128:1:1		/// Master Bedroom Touch Panel
    dvTP2	=	132:1:1		/// Media Room Touch Panel
    dvTP3	=	136:1:1		/// Kitchen Touch Panel
    
    arqTP1	=	128:2:1		/// ReQuest TP
    arqTP2	=	132:2:1		/// ReQuest TP
    arqTP3	=	136:2:1		/// ReQuest TP
    
  • ondrovicondrovic Junior Member Posts: 217
    vining wrote:
    dvTP1	=	128:1:1		/// Master Bedroom Touch Panel
    dvTP2	=	132:1:1		/// Media Room Touch Panel
    dvTP3	=	136:1:1		/// Kitchen Touch Panel
    
    arqTP1	=	129:1:1		/// ReQuest TP
    arqTP2	=	133:1:1		/// ReQuest TP
    arqTP3	=	137:1:1		/// ReQuest TP
    

    Are there just three touch panels or six? The above would indicate six but I'm thinking you only have three and the arq's should be ports on the TP's not there own TP.
    dvTP1	=	128:1:1		/// Master Bedroom Touch Panel
    dvTP2	=	132:1:1		/// Media Room Touch Panel
    dvTP3	=	136:1:1		/// Kitchen Touch Panel
    
    arqTP1	=	128:2:1		/// ReQuest TP
    arqTP2	=	132:2:1		/// ReQuest TP
    arqTP3	=	136:2:1		/// ReQuest TP
    

    You are correct there are only 3 panels. I will try the above and see if that fixes the issues. But I could have sworn that the way I have it posted is what I have done on a number of jobs without any ill side effects. Thanks for the input I will let you know the results tommorrow.

    Thanks again
  • Spire_JeffSpire_Jeff Formerly Caffeinated Programmer Posts: 1,917
    Ondrovic,

    You are doing it correctly. Based on the addresses, you are using the older G3 panels which don't have the options of different ports. Each touchpanel has the ability to be 1-4 different devices with I think it was 256 channels per device.

    The new G4 touchpanels are much nicer and allow you much more flexibility. The graphics options are also a LOT better :)

    Jeff
  • viningvining X Member Posts: 4,358
    Sorry if I led you astray but I've never touched a G3 panel only the G4s. I did notice the device numbers were in the G3 range but I "assumed" you just were used to that and didn't want to break habit. That probably would have been my next comment "why weren't you using numbers in the 10Ks". Never really being exposed the the G3 and the axcent stuff I often forget they exist.
  • ondrovicondrovic Junior Member Posts: 217
    no worries glad to know that there are some new options for the new products.

    Guess its time to rewrite these modules for use in seperate files. Thanks again guys for the help and input. I will keep you posted
  • ondrovicondrovic Junior Member Posts: 217
    Anyone have any ideas on where to start? I have never written a module file with a seperate comm / touchpanel files?

    Should I do it as include files?

    Thanks for the guidance
  • mpullinmpullin Obvious Troll Account, Marked for Deletion Posts: 949
    ondrovic wrote:
    Anyone have any ideas on where to start? I have never written a module file with a seperate comm / touchpanel files?

    Should I do it as include files?

    Thanks for the guidance

    To conform to the model AMX endorses, you should write two different modules. You should pass your Comm module the port the device is on, and a virtual device you define in your main program.
    You should pass your UI module a touchpanel, and the same virtual device you used for the Comm module, in addition to the channel sets and address sets and whatever else you feel like sending it. That way, if you need to add a touchpanel, you just define another instance of the UI module with another touchpanel.

    example
    DEFINE_MODULE 'VRQ Comm v1_0_2' VRQ_Comm(dv_VRQ, vdv_VRQ, VRQ_IP, VRQ_PORT, (* other stuff *))
    DEFINE_MODULE 'VRQ TP UI v1_0_2' VRQ_TP_1 (dv_VRQ_TP1, vdv_VRQ, (* other stuff *)
    
  • ondrovicondrovic Junior Member Posts: 217
    thanks mpullin
  • alexanboalexanbo Junior Member Posts: 282
    One thing I've noticed if you're adding multiple instances of the same Module they have to be one after another or it causes problems

    For instance this is good

    Define_module 'X' mdl1(vdvDEV,dvDEV)
    Define_module 'X' mdl2(vdvDEV,dvDEV)
    Define_module 'Y' mdl3(vdvDEV,dvDEV)

    This is bad

    Define_module 'X' mdl1(vdvDEV,dvDEV)
    Define_module 'Y' mdl2(vdvDEV,dvDEV)
    Define_module 'X' mdl3(vdvDEV,dvDEV)

    And of course each instance of the same module needs an unique identifier.
  • yuriyuri Junior Member Posts: 861
    i also had this one time. On a reboot, the DMS panels would power up, and display the "Master found, wire is good" page, but nothing after that. Not knowing what to do, i just reloaded the keypad file and resend the program with only a change of the module instance names. That cleared it all out... not sure if that's helpfull, but ok ;)
  • NMarkRobertsNMarkRoberts Junior Member Posts: 455
    alexanbo wrote:
    One thing I've noticed if you're adding multiple instances of the same Module they have to be one after another or it causes problems

    For instance this is good

    Define_module 'X' mdl1(vdvDEV,dvDEV)
    Define_module 'X' mdl2(vdvDEV,dvDEV)
    Define_module 'Y' mdl3(vdvDEV,dvDEV)

    This is bad

    Define_module 'X' mdl1(vdvDEV,dvDEV)
    Define_module 'Y' mdl2(vdvDEV,dvDEV)
    Define_module 'X' mdl3(vdvDEV,dvDEV)

    And of course each instance of the same module needs an unique identifier.

    When I read this I thought "good thing I always do that" but I've just realised that my current project groups modules by room not by name, so it breaks this rule, and it works fine.

    Alexanbo, what problems have you observed?
  • alexanboalexanbo Junior Member Posts: 282
    I had one instance where I didn't have them grouped together and the modules just didn't work at all. Once I grouped them together everything started working fine.
  • NMarkRobertsNMarkRoberts Junior Member Posts: 455
    Tech note 527 refers

    I just found tech note 527 from 2002 that says that you must declare modules in bunches. It seems this advice is now out of date.
  • KariKari Junior Member Posts: 13
    Similar but different?
    Spire_Jeff wrote:

    On a quick look at what you have, it seems that you are defining multiple instances for a single tuner device. There should only be one comm module defined per physical device. I think you may need to split your modules into COMM and UI modules. I think the fact that multiple modules are trying to talk to one device independant of each other is causing your problem.

    Sorry I don't mean to hijack an old thread - but I don't get to read very often!

    I have been creating modules for mixers to control volume/mute status. Usually I'll add one instance for each volume bar I have. This is because I want to reference a particular volume input/output/processing bus/block of the device.

    For Clearone I want the UnitID, Channel number, & Channel Type
    For Biamp I want the UnitID,InstanceID of Block, Type of Block, Index1, Index2

    I'm not really sure how I can get around this as I want to always compare the incoming string to some particular data. Each instance takes a look at the incoming data and asks "are you for me?" Nine may say no - but one may say yes and continue processing the data. Is this bad? Is there some way to pass this information through a UI module and execute only the module I'm concerned with? I don't really have the problem that I'm adding more and more touch panels. I'm adding more and more volume bars.

    Thus far I have not had any issues. My touch panel voluem bars respond just fine with many instances included. I just saw this thread and got concerned that this might cause problems in the future.
  • NMarkRobertsNMarkRoberts Junior Member Posts: 455
    Kari wrote:
    I have been creating modules for mixers to control volume/mute status. Usually I'll add one instance for each volume bar I have. This is because I want to reference a particular volume input/output/processing bus/block of the device.

    Here's how I do this, and never ever let it be said that controlling volume is easy. It seems to me that every installation does it completely differently. I always do volume control last cos it's hard work and every job I do seems to be very different from the last one.

    For every physical device that has volume control write a driver module which, among other things, translates a standard volume control command into whatever that device requires. It can accept this command from anywhere. It knows nothing about the system, just this one device. You can reuse this module in every installation that uses this equipment.

    For each room write a control module which runs the UI and does everything except volume control, apart from passing on volume button pushes and sending system start / stop commands.

    Enumerate the different volume controls somehow, one for each slider / up / down seen on the UI. That could be one per room, or one per zone, or 1 = Master volume and 2 = Mic vol and 3 = "Whichever AV device is currently selected". It totally depends on the nature of the system.

    Write a generic volume control module that controls an array of volumes and knows all about the nuances of volume control for each controlled volume:

    Minimum permitted volume
    Maximum permitted volume
    Default volume
    Current volume
    Number of steps from min to max
    Number of increments per second
    Maximum ramping time to prevent runaway
    Automated unmuting on volume change
    ...and so it goes on

    This module knows nothing about the system, and calls an included volume-setting routine for all system-specific knowledge. You can reuse this module in every installation, and you can make it as clever as you like. You could use multiple instantiation of a module which controls just one volume channel, but I haven't, not sure why!

    Finally, write an include file that knows all about volume control in this system, and when asked by the generic volume control module to set the volume for particular enumerated volume channel, sends the right generic command to the right device module. This code turns out to be very easy to write after you have made all of the investments listed above!
Sign In or Register to comment.