A few questions...
jcerecke
Posts: 40
Hey,
So I would like to be able to check if a timeline has been paused or not. Timeline_active only tells me if it's been created or not right? Everytime I pause it, do I need to track that with a variable and check the variable or can I go something like "IF (TIMELINE_PAUSE(TL_QUEUE))".
Also can I get the time a timeline has been running from outside a timeline event? I have a timeline that just runs for 10 minutes and has only the one event, but before it's reached that event, can I find out how long it's been running for?
And the same with IP_CLIENT_OPEN, how do I check if it's open or closed? Again do I need to track it with variables on the online/offline events, and if so I have another question: If it is online, and then I pull the network plug I assume it triggers an ONERROR event, but will it also trigger an offline event aswell?
And is there any opensource piece of code around that is just opening and closing IP comms and trying to keep them open? I've built IP into a module based off a technote I read and downloaded, but it didn't have much in the way of reopening the connection on error, or stop trying to connect if it fails x number or times etc.
Cheers
Joshua
So I would like to be able to check if a timeline has been paused or not. Timeline_active only tells me if it's been created or not right? Everytime I pause it, do I need to track that with a variable and check the variable or can I go something like "IF (TIMELINE_PAUSE(TL_QUEUE))".
Also can I get the time a timeline has been running from outside a timeline event? I have a timeline that just runs for 10 minutes and has only the one event, but before it's reached that event, can I find out how long it's been running for?
And the same with IP_CLIENT_OPEN, how do I check if it's open or closed? Again do I need to track it with variables on the online/offline events, and if so I have another question: If it is online, and then I pull the network plug I assume it triggers an ONERROR event, but will it also trigger an offline event aswell?
And is there any opensource piece of code around that is just opening and closing IP comms and trying to keep them open? I've built IP into a module based off a technote I read and downloaded, but it didn't have much in the way of reopening the connection on error, or stop trying to connect if it fails x number or times etc.
Cheers
Joshua
0
Comments
I don´t know much about timelines but here is a code I generally use for IP devices
I suppose you could make a counter for the number of "trying to connect". I don´t see the point honestly. But then again I don´t turn IP connections on an off when sending commands. If the device is there, it should be connected and if it is offline, the Master should be trying to connect to it and if he can´t, then let someone know so it can be fixed. Thats how I do it.
When you pull the cable, the online variable will equal false. It may take a few moments though.
Yes you can with TIMELINE_GET()
Regarding the IP_CLIENT_OPEN(), Thorleifur's code is pretty good, a little improvement may be to track also a third state "Trying to connect", so you can find out if there's a IP_CLIENT_OPEN() in progress or not, like
Try this..
Cheers