define_combine and level_events
dnahman
Posts: 28
Hi all,
Does you need to do combine_levels *in addition* to combine_devices? The netlinx help file is ambiguous in this respect, but I can't believe I'm the first person running into this. What am I missing?
With the code attached below:
1. The button event works.
2. The send_level to the virtual device works.
3. The level_event from the virtual device doesn't work.
Device notifications show the following when manipulating the bargraph on the panel
Line 272 (10:51:34):: Level Value From [10001:1:1] - Level 1 Value= 112
Line 273 (10:51:34):: Level Value To [34001:1:1] - Level 1 Value= 112
Line 274 (10:51:34):: Level Value To [10001:1:1] - Level 1 Value= 112
Line 275 (10:51:34):: Level Value From [10001:1:1] - Level 1 Value= 112
Shouldn't I see a Level Value to [34001:1:1]?
Running on an NI-3100 v3.41.414 and and NXT-CV7
Thanks,
David
<snip>
PROGRAM_NAME='test.combine'
define_device
dvTP = 10001:1:0
virtualTP = 34001:1:0
define_start
combine_devices(virtualTP, dvtp)
define_program
define_event
level_event [virtualTP, 1] {
send_string 0, 'level event on virtual'
}
button_event [virtualTP, 1] {
push: {
send_string 0, 'button event on virtual'
send_level virtualTP, 1, 128
}
}
level_event [dvTP, 1] {
send_string 0, 'level event on device'
}
Does you need to do combine_levels *in addition* to combine_devices? The netlinx help file is ambiguous in this respect, but I can't believe I'm the first person running into this. What am I missing?
With the code attached below:
1. The button event works.
2. The send_level to the virtual device works.
3. The level_event from the virtual device doesn't work.
Device notifications show the following when manipulating the bargraph on the panel
Line 272 (10:51:34):: Level Value From [10001:1:1] - Level 1 Value= 112
Line 273 (10:51:34):: Level Value To [34001:1:1] - Level 1 Value= 112
Line 274 (10:51:34):: Level Value To [10001:1:1] - Level 1 Value= 112
Line 275 (10:51:34):: Level Value From [10001:1:1] - Level 1 Value= 112
Shouldn't I see a Level Value to [34001:1:1]?
Running on an NI-3100 v3.41.414 and and NXT-CV7
Thanks,
David
<snip>
PROGRAM_NAME='test.combine'
define_device
dvTP = 10001:1:0
virtualTP = 34001:1:0
define_start
combine_devices(virtualTP, dvtp)
define_program
define_event
level_event [virtualTP, 1] {
send_string 0, 'level event on virtual'
}
button_event [virtualTP, 1] {
push: {
send_string 0, 'button event on virtual'
send_level virtualTP, 1, 128
}
}
level_event [dvTP, 1] {
send_string 0, 'level event on device'
}
0
Comments
*Fixed Combined Levels event error induced in build 414.
Regards,
David
I see issue 3. still pertains in the latest firmware 4.1.404.
Level_Events don't trigger from the virtual device, but they do from the real panel. I'm seeing this issue on a site that was programmed years ago with the define_combine command. The guy who programmed it used old-school axcess style programming for it (no virtual device) So I attempted to fix it with a virtual device, but ran in to this issue.
define_device
dvRealTP = 10001:1:1
vdvFakeTP = 33001:1:1
define_variable
dev dvTP = {vdvFakeTP, dvRealTP}
define_event
level_event[dvTP, somelevel]
{
some code here
}