Home AMX User Forum AMX General Discussion

how do u work with netlinx modules!!

i never did so how to add a module and how to call him!!!

i know there a good volume module that simplfy the option to press and as long as pressed the volume goes up and not every press like i do!!

thanks again

Comments

  • DHawthorneDHawthorne Posts: 4,584
    DEFINE_MODULE 'Module Name' <INSTANCE> (<parameters>)

    The <> brackets are not part of it, that's just to show the data in there changes according to your needs and the module itself. The INSTANCE part is if you have multiples of the same module so the compiler can tell them apart. The parameters should be spelled out in the module's documentation.

    You shouldn't need a module just for volume control. If it's an RS-232 device, put a HOLD handler in the button event with a time and the repeat keyword. If it's IR, just use TO on the IR port.
  • galayegalaye Posts: 28
    its r232 device....give example to event!!

    i now prees and every press it work...

    i never tried with hold can u give sample...like u gave with the define strart...

    thanks alot!!
  • dthorsondthorson Posts: 103
    You could also use a LEVEL_EVENT to do your volume commands.
    Here's an example for a BiAmp level control. Just set your volume buttons in TPD4 to increase or decrease a level. Use the "Level Control Type" property of a button.

    LEVEL_EVENT[vdvTPa,1] //PROGRAM VOLUME CONTROL
    {
    IF(iVOLUME_MUTE[1])
    {
    SEND_STRING dvDSP,"'SET 1 FDRMUTE ',sPGM_IDX,' 1 0',$0A"//UNMUTE
    iVOLUME_MUTE[1] = 0
    }
    iVOLUME_LEVEL[1] = LEVEL.VALUE
    SEND_STRING dvDSP,"'SETL 1 FDRLVL ',sPGM_IDX,' 1 ',ITOA (iVOLUME_LEVEL[1]),'0 ',$0A" (* FADER LEVEL IN *)
    }



    Heres the help from NLS on HOLD;

    BUTTON_EVENT [(DEVCHAN[ ])]

    {

    PUSH:

    {

    // Push statements go here

    }

    RELEASE:

    {

    // Release statements go here

    }

    HOLD[TIME]: or HOLD[TIME, REPEAT]:

    {

    // Hold statements go here

    }

    }
  • galayegalaye Posts: 28
    thanks....most helpfull

    thanks i will use it
  • galayegalaye Posts: 28
    I Have Tried?

    and it gives me syntax error ....

    when i wite the sytax:
    BUTTON_EVENT[TP,191]
    PUSH:
    {
    SEND_STRING MIXER,"'SV 4 180',13"
    }
    RELEASE :
    {
    }

    HOLD[5,[REPEAT]]:
    {
    SEND_STRING MIXER,"'SV 4 180',13"
    }


    I DONT know way...

    also it written like the help saies and stil sytax error C10201

    I DONT KNOW WAY

    THANKS
  • jweatherjweather Posts: 320
    galaye wrote:
    HOLD[5,[REPEAT]]:

    HOLD[5,REPEAT]:

    The brackets in the help entry, confusingly, mean that the REPEAT part is optional.

    Jeremy
  • galayegalaye Posts: 28
    yes i know !!

    i have tried without

    try one:
    HOLD[5,REPEAT]:
    try 2:
    HOLD[5]
    try 3:
    release
    {
    }
    {
    HOLD[5]:
    {
    send_string....etc
    }
    }

    and still returns syntax error and i put the sentence out with (* and*) and no errors
  • galayegalaye Posts: 28
    here is my code test!!

    i f u can see and check wht i do rong!!
  • dchristodchristo Posts: 177
    You have the HOLD in the DEFINE_PROGRAM section of the program. A Hold can only be used in a BUTTON_EVENT in the DEFINE_EVENT section.

    --D
  • galayegalaye Posts: 28
    i have tried as well-NOW IT WORKED THANKS...

    Now I Will Try In The Conferance Room And I Will Much Gratefull!!
Sign In or Register to comment.