Hold event bug
a_riot42
Posts: 1,624
If I have two or more of the same module defined, and then print out what the virtual device number is on a push, I see two strings in diagnostics that print out the two virtual devices that get passed to the 2 modules. However, on a hold of the same button, only one string appears of one virtual, and its always the first one to get declared. So even through both modules hold events should execute just like both pushes did, only one executes and its always the first to be declared. Can someone load this demo code and see if they are seeing the same behavior? I saw this on the latest v4 firmware and also the last v3.
Thanks,
Paul
Thanks,
Paul
0
Comments
HOLDS are imputed, not explicit, the NetLinx OS calculates that a HOLD occurred if enough time passes after a PUSH before a RELEASE. Since the HOLD is a conclusion made by the OS and not an externally detectable state, it may not process through your dual code as you might expect, the first instance may clear the hold so the second never sees it. You may need to make a HOLD detection process and pass that as a state explicitly to both parts of the following code.
If you change your code a bit it seems to work fine: MAIN: MODULE:
Paul
That works as expected, and a TP should be the same.
Paul
define_module 'Generic Module' mdlModule1 (vdvDevice1, dvTP)
define_module 'Generic Module 2' mdlModule2 (vdvDevice2, dvTP)
Line 1 (11:17:25.484):: Push button Sanity Check. vdvDevice = 33001:1:0
Line 2 (11:17:25.484):: Push button Sanity Check. vdvDevice = 33002:1:0
Line 3 (11:17:25.515):: Release button Sanity Check. vdvDevice = 33001:1:0
Line 4 (11:17:25.515):: Release button Sanity Check. vdvDevice = 33002:1:0
Line 5 (11:17:28.437):: DDD.handleDynamicDevice(): new DPD - 10.40.62.93
Line 6 (11:17:28.734):: Push button Sanity Check. vdvDevice = 33001:1:0
Line 7 (11:17:28.734):: Push button Sanity Check. vdvDevice = 33002:1:0
Line 8 (11:17:29.234):: Hold button Sanity Check. vdvDevice = 33001:1:0
Line 9 (11:17:29.234):: Hold button Sanity Check. vdvDevice = 33002:1:0
Line 10 (11:17:29.734):: Hold button Sanity Check. vdvDevice = 33001:1:0
Line 11 (11:17:29.734):: Hold button Sanity Check. vdvDevice = 33002:1:0
Line 12 (11:17:30.234):: Hold button Sanity Check. vdvDevice = 33001:1:0
Line 13 (11:17:30.234):: Hold button Sanity Check. vdvDevice = 33002:1:0
Line 14 (11:17:30.734):: Hold button Sanity Check. vdvDevice = 33001:1:0
Line 15 (11:17:30.734):: Hold button Sanity Check. vdvDevice = 33002:1:0
Line 16 (11:17:31.234):: Hold button Sanity Check. vdvDevice = 33001:1:0
Line 17 (11:17:31.234):: Hold button Sanity Check. vdvDevice = 33002:1:0
Line 18 (11:17:31.734):: Hold button Sanity Check. vdvDevice = 33001:1:0
Line 19 (11:17:31.734):: Hold button Sanity Check. vdvDevice = 33002:1:0
Line 20 (11:17:32.234):: Hold button Sanity Check. vdvDevice = 33001:1:0
Line 21 (11:17:32.234):: Hold button Sanity Check. vdvDevice = 33002:1:0
Line 22 (11:17:32.484):: Release button Sanity Check. vdvDevice = 33001:1:0
Line 23 (11:17:32.484):: Release button Sanity Check. vdvDevice = 33002:1:0
That just looks like a bug to me. Clearly the firmware can do what is needed, but for some reason an instantiation of the same module breaks it.
Paul
This means that you can't even set a variable in the hold, start a timeline, or even check if a hold was run in a module, since it simply doesn't exist. I would never have predicted this in a million years and find it hard to believe I haven't run across it before but there it is. The point of a module is to reuse code but it can't be done if you ever need a hold event to run, which I often do. I hope they can fix this, but the bug must be deep in the bowels of the firmware. Yikes!
Paul
That does seem a bit dark, but thanks for the suggestion. I think I might try starting a timeline in the push and killing it in the release. Wasn't much point in fixing get_last to work in hold events considering this behavior in modules.
Paul