Home AMX User Forum NetLinx Studio

COMBINE_DEVICES in a Module?

Greetings,

I am bringing a DEV array of panels into a module. I am also bringing in a virtual device. Within the module I am trying to combine as shown:
COMBINE_DEVICES (vdvPanels,dPanels[])

Button events within the module from vdvPanels create no events.

Any ideas?

Thanks.

Comments

  • ericmedleyericmedley Posts: 4,177
    Greetings,

    I am bringing a DEV array of panels into a module. I am also bringing in a virtual device. Within the module I am trying to combine as shown:
    COMBINE_DEVICES (vdvPanels,dPanels[])
    

    Button events within the module from vdvPanels create no events.

    Any ideas?

    Thanks.

    When you say your bringing in a DEV array of panels into the module, is it dPanels[]?
  • TurnipTruckTurnipTruck Posts: 1,485
    ericmedley wrote: »
    When you say your bringing in a DEV array of panels into the module, is it dPanels[]?

    Yes, should have clarified.
  • ericmedleyericmedley Posts: 4,177
    Yes, should have clarified.

    not knowing the module makes it a bit tough.

    However, typically when you 'bring in' a virtual device into a module, you're declaring how the module will communicate with main program. For exapmle: vdv_module_device might have a preset bunch of channels. Like ch 255 will be on when the device is in communication with the NI-processor. channel 21 might be the power state of the thing hooked up to the processor. A command would be sent to the virtual device such as POWER=1 which will tell the module to send the power on command for that device.

    A lot of the Duet modules have button pushes for commands to the real device.

    So, it doesn't make sense to tie the virtual device with the User Interfaces.

    If your dealing with an UI module, then you shouldn't need to tie the UIs together. They would have already done that when you passed the User Interface device numbers into the module at compile time.

    If you can put some code up including your module declaration, it might help to ferret the problem out.
    e
  • TurnipTruckTurnipTruck Posts: 1,485
    It may be easier to explain what I am trying to accomplish as it is a module that I am creating.

    I have some panels that have active touch bargraphs on them. To prevent offline events from the panels from triggering a level event with a zero value, I have combined the actual panels with virtual devices and my code wathces the virtual devices for the level events.

    I would like to bring a dev array of all of the panels into a module and do a combination of the dev array of actual panels with the virtual device within the module.

    I've tried COMBINE_DEVICES and DEFINE_COMBINE within the module. I only see the level events from the actual devices in notifications, not the virtual device. I have only used combination statements in the main program before, not in a module.
  • dthorsondthorson Posts: 103
    I've done the virtual thing to get around it, but it's just a work around. I'm also getting into using dev arrays more for TP's and would be interested in your solution.

    I would be happy if the Levels did not go to zero during an offline event. Is there a way to prevent this from happening at all? Wouldn't the master be setting all to zero since the TP is offline and can't communicate?


    Couldn't you just add the panels one-by-one based on how many are in your dev array.

    something like this
    For ( array_length )
    {
     COMBINE_DEVICES (vdvPanels,dPanels[1],dPanels[2],dPanels[3])
    }
    
  • TurnipTruckTurnipTruck Posts: 1,485
    I don't want to add one-by-one as I like to make my modules as reusable as possible. I like to bring in a DEV array of panels form the main program so that the module need not be touched for system modifications.

    I did get it working....
    DEFINE_COMBINE (vdvPanels,dPanels)
    
    Where vdvPanels is the virtual device to watch for level events and dPanels is an array of actual panels. The combine statement is in the module. The DEV array of panels is defined in the main program.

    I had tried:
    DEFINE_COMBINE (vdvPanels,dPanels[])
    

    That did not work. Removing the square brackets solved the problem.
Sign In or Register to comment.