Home AMX User Forum NetLinx Studio
Options

Ports

adysadys Posts: 395
Can some please give a short eplain /example about port use in netlinx?

What is the command port/channel port/address port/string port for?




Thanks

Ady

Comments

  • Options
    REBUILD_EVENTREBUILD_EVENT Posts: 127
    on a tp,
    - command port is where you get BUTTON_EVENT in netlinx source and switching ON/OFF a 'general' button
    - address port is for writing a text to a button or setting a 'multi-state general/bargraph' button to a specified state
    - level port is where you get LEVEL_EVENT of a 'bargraph' button or SEND_LEVEL to a bargraph button

    if your tp has device number 10001, then use

    10001:2:0 in netlinx source for all port 2 in tp design and so on, we usually use ports from 1 up to port 10 for different modules.
  • Options
    adysadys Posts: 395
    so the command port is only and extra digit to use with with the command code?

    For every channel code there is a channel port only be expand the number?

    is there any smart use to do with it?
  • Options
    ericmedleyericmedley Posts: 4,177
    adys wrote:
    so the command port is only and extra digit to use with with the command code?

    For every channel code there is a channel port only be expand the number?

    is there any smart use to do with it?

    One thing is that it gives you the ability for a device to have a huge amount of channels. For example, a modero panel allows for 3,999 buttons per port.

    But since you can have more than one port you multiply that 3,999 by how many ports your using.

    I use the ports to differentiate between certain types of control.

    For example I always put touch panel navigation buttons on port 1. The AMX MAX is on Port 4. Lutron Lighting controls are on port 5. My Lutron controls use over 1000 buttons.

    The theory is similar to ports on an IP device in that a single box can communicate over different ports simultaneously and in completely different ways.
  • Options
    DHawthorneDHawthorne Posts: 4,584
    Every port on a touch panel is like a completely (well, almost) independent panel. Except for simple IR controlled devices, I tend to define a separate port for each controlled device in the system; like Eric, I put all my navigation and meta functions on port 1.

    With separate ports, and separate modules underlying them, you don't have to re-write your entire project whenever there is a device update, or a new device altogether. You just swap modules and change that port appropriately.
  • Options
    adysadys Posts: 395
    thanks guys

    I got it

    for example, if I have 2 dvd from the same kind, instead of giving new channel codes for every dvd and catch them in seperate code, all I need to do is to give a unique channel port for each of them, and :

    1. get them in a seperate code for each dvd
    2. make the code handle multiple port

    Can anyone show me how to implement the 2 option?

    thanks
  • Options
    REBUILD_EVENTREBUILD_EVENT Posts: 127
    you write a module file with one of the parameter called DEV dvTP,

    then you call this module file in the main file two times like this

    DEFINE_MODULE mdlDvdLivingRoom(dvTP___1, nDvdChannelCodes,...)
    DEFINE_MODULE mdlDvdBedroom(dvTP___2, nDvdChannelCodes,...

    the first module will handle all the events coming from your first port, the second all channels from the second port.

    ok
  • Options
    adysadys Posts: 395
    Thanks

    how to do it without a modlue use?

    I don't have time to move all written code to modules...
  • Options
    NMarkRobertsNMarkRoberts Posts: 455
    Moving code into modules in a modest system would take only a short time.

    Working out how modules work would of course take much longer but you only have to do that once.
  • Options
    HedbergHedberg Posts: 671
    Very briefly(and needing completion to work):

    [code]
    define_device

    dvTP1 = 10001:11:0 //device for dvd1
    dvTP2 = 10001:12:0 //device for dvd2
    dvDVD1 = 5001:9:0
    dvDVD2 = 5001:10:0

    define_variable

    dev vdvTP_DVD[]= {dvTP1,dvTP2}
    dev vdvDVD[]= {dvDVD1,dvDVD2}

    integer nDVDBtns[] = //put your ordered list of dvd buttons herre
    integer nDVDChans[] = //put your ordered list of dvd channels here

    define_event

    button_event[vdvTP_DVD,nDVDBtns
    {
  • Options
    HedbergHedberg Posts: 671
    Very briefly(and needing syntax checking and completion to work):
    define_device
    
    dvTP1 = 10001:11:0   //device for dvd1
    dvTP2 = 10001:12:0   //device for dvd2
    dvDVD1 = 5001:9:0
    dvDVD2 = 5001:10:0
    
    define_variable
    
    dev vdvTP_DVD[]= {dvTP1,dvTP2}
    dev vdvDVD[]= {dvDVD1,dvDVD2}
    dev dvSelectedDVD
    
    integer nDVDBtns[] ={} //put your ordered list of dvd buttons here
    integer nDVDChans[] ={} //put your ordered list of dvd channels here
    
    define_event
    
    button_event[vdvTP_DVD,nDVDBtns]
    {
       push:
       {
          stack_var integer i
          i = get_last (nDVDBtns)
          to[button.input]
          dvSelectedDVD = vdvDVD[2]  
          if(button.input.device = vdvTP_DVD[1])
          {
             dvSelectedDVD = vdvDVD[1]
          }
          pulse[dvSelectedDVD,nDVDChans[i]]
       }
    }
    
  • Options
    adysadys Posts: 395
    thanks for the samples

    I know how to write modules, I just finished a Kramer module today.

    But I have a lot of devices that are not modules, and I don't have time to make huge changes.
    I preffer to duplicate the code/make it bigger to handle multiple devices

    Ady

    P.s

    Are you usualy duplicating screens in TPdesign when using duplicated ports?
Sign In or Register to comment.