Home AMX User Forum NetLinx Studio
Options

define_combine and level_events

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'
}

Comments

  • Options
    Joe HebertJoe Hebert Posts: 2,159
    dnahman wrote: »
    3. The level_event from the virtual device doesn't work.
    What version firmware does your Netlinx master have? Firmware version .422 lists this as one of the new features:

    *Fixed Combined Levels event error induced in build 414.
  • Options
    dnahmandnahman Posts: 28
    Thank you! That was the exact problem.

    Regards,
    David
  • Options
    Jorde_VJorde_V Posts: 393
    Joe Hebert wrote: »
    What version firmware does your Netlinx master have? Firmware version .422 lists this as one of the new features:

    *Fixed Combined Levels event error induced in build 414.


    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.
  • Options
    erikm101erikm101 Posts: 2
    Jorde_V, what you should do to get this to work is as follows. Once wrapped into the dev variable, the level event will work. No need for define_combine for this to work. If you need to change combine-like dynamically, then you will need to specify an array size for the dev variable (example - dev dvTP[5]), populate teh array in code using virtual device first, then call rebuild_event().

    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
    }
Sign In or Register to comment.