do_online_event()
mstocum
Junior Member
Is there a way to trigger the online event handler through code, similar to do_push or do_custom_event? I know I can do a function, and just have my online event call the function, but I'm just curious.
Comments
-
Is there a way to trigger the online event handler through code, similar to do_push or do_custom_event? I know I can do a function, and just have my online event call the function, but I'm just curious.
Hmmm... this may be a case where there's a better way to do whatever you have in mind to do. why would you want to fake an online event??? And, if whatever it is you want to make happen via a fake online_event is going to a function, why not just call the function?
What were you planning on doing code-wise to start the fake online event? whereever that was just call the function and avoid the middle man.
Post some code with your idea and we'll see if we can help.
e -
ericmedley wrote: »Hmmm... this may be a case where there's a better way to do whatever you have in mind to do. why would you want to fake an online event??? And, if whatever it is you want to make happen via a fake online_event is going to a function, why not just call the function?
What were you planning on doing code-wise to start the fake online event? whereever that was just call the function and avoid the middle man.
Post some code with your idea and we'll see if we can help.
e
I'm just looking for a way to send some initialization commands to DXLink devices in response to a REINIT command to a module or when they come online without writing the same code in both sections. As for why I'm looking to emulate the online event, because that's where the code lives, and I'm being lazy.
In general, the ability to control when an online event occurs for modules would be nice. It's always struck me as weird to use the DATA_INITIALIZED channel event, instead of allowing the module to just control the online and offline events, but that's a whole other issue. -
Define_function Fn_Stuff_i_want_to_do(){ // a whole bunch of stuff I only want to code once // } Data_event[vdvDevice]{ Online_event:{ Fn_Stuff_i_want_to_do() } } Chaneel_event[dv_a_device,1]{ On:{ Fn_Stuff_i_want_to_do() } } DEFINE_START WAIT 456{ Fn_Stuff_i_want_to_do() } -
Yeah, that's definitely the right way to do it. Like I said, I was being lazy (my own project, this isn't for anyone external or anything) and then got curious if it was even possible. do_push() can be pretty useful, and it's arguably just as bad as do_online_event() would be.
-
hmmm.. that's interesting. I don't code differently for my personal projects. I typically keep it all consistent. It does evolve over time.
-
I've wondered about that as well, but have never found a way to simulate an online event. If you figure out a way, please post it here.
Paul -
Easiest way to do this is to create a function for your init routine. Pass it whatever you need to from the online event, but make the function your only code in the event. Then when you need it elsewhere, call the function directly.
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums