Timeline Time
TUTech
Posts: 70
I'm working on the Programmer 2 practical exam. Learning a lot of new things. I put a feedback timeline in and it locked up the system.
VOLATILE LONG lFBTime [] = {300} That should be 30 seconds but it's not. I changed it to {3000} and now it triggers every 3 seconds.
I checked two other programs that I did and set the feedback time for 300 and it triggers every 30 seconds.
On another part of the program, I have a relay on for 2.5 seconds. I set the time for 25 and that works correctly.
VOLATILE LONG lFBTime [] = {300} That should be 30 seconds but it's not. I changed it to {3000} and now it triggers every 3 seconds.
I checked two other programs that I did and set the feedback time for 300 and it triggers every 30 seconds.
On another part of the program, I have a relay on for 2.5 seconds. I set the time for 25 and that works correctly.
0
Comments
Timeline 1 second = 1000
Wait 1 second = 10
You can check the help files for further explanation.
I went back and looked at another program where the feedback happens at 30 seconds and the timeline is 300. I noticed that I put a Wait of 300 in the Timeline Event. I guess the feedback is happening every 30.3 seconds. How did I do that?
I think the better question might be - Why did I do that?
I ask myself that very thing when I read some of my code.
Like Joe said, when using timelines the time resolution is 1ms, which I think is clearly explained in the help. So your example lFBTime [] = {300} time is 0,3 seconds.
If you use WAIT 300 it will be 30 seconds.
Good luck with your exam!
Originally I put the Feedback part of the program in Define_Program I put a WAIT 300 and it worked. Then I learned how to do timelines and moved the whole feedback statement into the timeline (including the WAIT)but I only made the timeline 300 but it didn't matter because it still had the WAIT 300 in there.
Thanks on the exam. Now I'm on to parsing projector data.
You would put a Timeline_Event in Define_Event. that will ask your devices if they are on or what their inputs are or whatever other information you want. (Send_String dv_device "Are you on?"
Then have a Data_Event in your Define_Event to look at the information sent back from the device. Look at my other post on Projector Feedback.
Feedback running in Define_Program (or anything running in Def_Prog for that matter) is really left over legacy functionality that made it easier to transition projects that were written in Axcess (back in the 1990s). The idea being you could take an Axcess program, copy/paste it into Netlinx, change the formatting of device addresses, compile and go. The current "Best Practice" is to avoid using Def_Prog which, as you say, you don't do. There is still a little debate as to ways one can still use it without ill effects. But with the new NX processors it really should be avoided. The problem that now remains is old Netflix modules where we cannot see the source code that may have Def_Prog in them.
One thing that happened to me recently which I find really peculiar, I was using the TiVo duet module in my home system, we bought our home not too long ago, ran all my wires and quickly got the system up and running. I threw the TiVo modules in for the sake of time knowing I'll get to it later. We also have two motorola cameras that we use for our two young sons. They were working pretty poorly, takes forever to connect, blah, blah blah. I finally get around to making my own module for the TiVo's, deploy it and get it running. After that update (which was the only update) the cameras started to work way way way better, like a huge improvement. Knowing that was the only change what in the world was going on in that module to affect my network like that...