Home AMX User Forum AMX General Discussion

forcing an online event

Hello,

i need to know a way to force an online event of a virtual device assigned to a virtual variable.
It is because i need to execute the code at the online event without the need of rebooting the master.

thanks to all!!

Comments

  • AuserAuser Posts: 506
    By virtual device assigned to a virtual variable I assume you mean that the assignment is dynamic and this is why you need to fire an "online event"?

    If this is correct, such an online event can be faked by using a repeating timeline. When the timeline event triggers, check if the variable's current value is different to the value last time the check was carried out. If the values differ odds are you'll not only want to run the same code you would run from the online event (using a function which takes a dev as a parameter should be good for this), but a rebuild_event() statement as well.

    Works well enough for me.
  • DHawthorneDHawthorne Posts: 4,584
    I don't think you can force an online event, and I don't think testing a virtual device for going online is going to work because they go online automatically at startup, but before all of the rest of the code is running. I'm also pretty sure any test of a virtual being online is always going to be true as long as the master itself is online. They get instantiated near the end of the startup process, but certainly before mainline is running.

    Some manner of workaround like Auser suggests is going to be needed.
  • KennyKenny Posts: 209
    One of the great things about a virtual is the fact that it is always online. That is why it is used in combine statements.
  • I can force real devices to perform an online event without rebooting a master. REBOOT(D:P:S) But this doesn't seem to work on virtual devices. If you do REBOOT(5001:3:0) Device 5001 reboots without rebooting the master.
  • MorgoZMorgoZ Posts: 116
    Thanks for your answers,

    the main problem is that this virtual variable is used by many modules, one of them with private code, and inside each module are "online" events, so i can?t make a function to launch all of them, i need a way to trigger an online event of that variable, so all of the online events go on.

    Any idea??????

    Thanks to all!!
  • DHawthorne wrote: »
    I don't think you can force an online event, and I don't think testing a virtual device for going online is going to work because they go online automatically at startup, but before all of the rest of the code is running. I'm also pretty sure any test of a virtual being online is always going to be true as long as the master itself is online. They get instantiated near the end of the startup process, but certainly before mainline is running.

    Some manner of workaround like Auser suggests is going to be needed.

    I've had the AMX tstat module crap out on me before and the virtual device went offline. This is the only time I've seen the issue and it only happened once, but it happened nonetheless (that is unless someone was lying about what was in my water).
  • Joe HebertJoe Hebert Posts: 2,159
    TonyAngelo wrote: »
    I've had the AMX tstat module crap out on me before and the virtual device went offline.
    Was it a Duet module?
    Not all virtual devices are created equally.
    Netlinx virtuals will not go offline, however, Duet virtual devices can (and will) go offline.
  • Joe Hebert wrote: »
    Was it a Duet module?
    Not all virtual devices are created equally.
    Netlinx virtuals will not go offline, however, Duet virtual devices can (and will) go offline.

    You are correct, it was a Duet module.
Sign In or Register to comment.