Home AMX User Forum NetLinx Studio

combine devices

Hi, if i combine two or more devices with a virtual device, in a "button_event[vdvdevice,1]" it's possible know the real devices that generate the event ?

thank's

Daniel.

Comments

  • jjamesjjames Posts: 2,908
    Short answer: I don't think so as vdvdevice triggers the button event, not an actual panel. Combining devices is not the way to go and in my opinion should be removed from the language completely.

    Long answer:
    Why not just use a device array?
    DEFINE_DEVICE
    dvTP1 = 10001:01:00;
    dvTP2 = 10002:01:00;
    
    define_constant
    dev dv_tp[] = {dvTP1, dvTP2}
    
    define_event
    button_event[dv_tp,1]
    {
      push:
      {
        stack_var integer index;
        index = get_last(dv_tp); // This will give you an index pointer of which device in the array triggered the event
        // You can also use:
        // button.input.device - Returns full D:P:S
        // button.input.device.number - Returns just the number (10001, 10002, etc.)
      }
    }
    
  • DHawthorneDHawthorne Posts: 4,584
    Once you've combined the devices, everything reports in as and responds to the virtual. I don't believe you can parse out anything to tell what real device is in play, and if you need to, you should be using a device array, as suggested.

    I think it goes a tad too far to say remove the function altogether, but by all means, don't use it unless nothing else will do the trick. One type of scenario where it is valuable, though, is if you have a variable number of panels accessing the same master or device (let's say, for example, a TPTransfer iOS device that is sometimes on the system, and sometimes not). This allows you to interact with the virtual even if the real panel(s) are offline or off site.
Sign In or Register to comment.