Timeline Time

TUTechTUTech Junior MemberPosts: 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.

Comments

  • Joe HebertJoe Hebert Junior Member Posts: 2,154
    A Timeline and a Wait are two different things.

    Timeline 1 second = 1000

    Wait 1 second = 10

    You can check the help files for further explanation.

  • TUTechTUTech Junior Member Posts: 70
    Thanks Joe. I understand that Timeline and Wait are two different things. I just read the help and it does say that it is 1/100th of a second.

    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?
  • Joe HebertJoe Hebert Junior Member Posts: 2,154
    TUTech wrote: »
    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.
  • richardhermanrichardherman not-so-junior member Posts: 200
    Not really sure what is confusing you...

    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!
  • TUTechTUTech Junior Member Posts: 70
    Richard, I see what I did and why it actually worked!
    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.
  • MLaletasMLaletas Junior Member Posts: 220
    I dont understand the feedback running off a DEFINE_PROGRAM or better yet even a timeline. Anyone care to explain the benefits, maybe I am missing something? Normally I get my feedback off of events whether thats a TP event, data event from a device or whatever else. Also I try to store all of the pertinent data in a structure or something that way when the TP comes online I can update the TP from that stored data.
  • TUTechTUTech Junior Member Posts: 70
    You would put a Create_Timeline in your Define_Start 30 seconds is recommended.
    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.
  • MLaletasMLaletas Junior Member Posts: 220
    Right I do the same. Sorry I read it one way and automatically thought you were talking about something else. I though it was more of:
    DEFINE_PROGRAM
    
    [TP_1, 99] = nFeedback;
    
  • ericmedleyericmedley Senior Member - 3709 Posts Posts: 4,152
    MLaletas wrote: »
    I dont understand the feedback running off a DEFINE_PROGRAM or better yet even a timeline. Anyone care to explain the benefits, maybe I am missing something? Normally I get my feedback off of events whether thats a TP event, data event from a device or whatever else. Also I try to store all of the pertinent data in a structure or something that way when the TP comes online I can update the TP from that stored data.



    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.
  • MLaletasMLaletas Junior Member Posts: 220
    ericmedley wrote: »
    The problem that now remains is old Netflix modules where we cannot see the source code that may have Def_Prog in them.
    Exactly, and good point. I try to avoid using them as much as possible, with the exceptions of some DSP's and Codec for the sake of time.

    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...

Sign In or Register to comment.