COMBINE_DEVICES in a Module?
TurnipTruck
Posts: 1,485
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:
Button events within the module from vdvPanels create no events.
Any ideas?
Thanks.
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.
0
Comments
When you say your bringing in a DEV array of panels into the module, is it dPanels[]?
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
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.
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
I did get it working.... 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:
That did not work. Removing the square brackets solved the problem.