Timeline Always Run for One Second
This codes exists within a module. The timeline event always happens after one second regardless of the value of lTL1_10Sec
Hmmmm?
VOLATILE LONG lTL1_10Sec[1]={10000}
TIMELINE_CREATE (1,lTL1_10Sec,1,TIMELINE_RELATIVE,TIMELINE_ONCE)
TIMELINE_EVENT [1]
Hmmmm?
0
Comments
DEFINE_DEVICE dvTP = 10001:1:0 DEFINE_VARIABLE VOLATILE LONG lTL1_10Sec[1]={10000} DEFINE_EVENT BUTTON_EVENT[dvTP,1] { PUSH: { TIMELINE_CREATE (1,lTL1_10Sec,1,TIMELINE_RELATIVE,TIMELINE_ONCE) SEND_STRING 0,'Timeline Created' } } TIMELINE_EVENT [1] { SEND_STRING 0,'Timeline Triggered' }And the output when button 1 is pushed.
Just for grins and giggles, perhaps you can go ahead and make the variable VOLATILE LONG lTL1_10Sec[1]={10000} and array. and see how that behaves.
so,
VOLATILE LONG lTL1_10Sec[2]
lTL1_10Sec[1]=1
lTL1_10Sec[2]=10000
Then just don't do anything on the first timeline event.
See how that behaves...
VOLATILE LONG lTL1_10Sec[1]={10000} BUTTON_EVENT [dUIs,cnChannelProgram] { PUSH: { nUI=GET_LAST(dUIs) nBut=GET_LAST(cnChannelProgram) IF (NOT(TIMELINE_ACTIVE(nUI))) TIMELINE_CREATE (nUI,lTL1_10Sec,1,TIMELINE_RELATIVE,TIMELINE_ONCE) ELSE TIMELINE_SET (nUI,1) SWITCH (nBut) { CASE 1: { OFF[dUIs[nUI],2] ON[dUIs[nUI],1] nChannelProgram[nUI]=1 } CASE 2: { OFF[dUIs[nUI],1] ON[dUIs[nUI],2] nChannelProgram[nUI]=2 } } } } TIMELINE_EVENT [1] TIMELINE_EVENT [2] TIMELINE_EVENT [3] TIMELINE_EVENT [4] TIMELINE_EVENT [5] TIMELINE_EVENT [6] TIMELINE_EVENT [7] TIMELINE_EVENT [8] TIMELINE_EVENT [9] TIMELINE_EVENT [10] { nChannelProgram[TIMELINE.ID]=0 OFF[dUIs[TIMELINE.ID],cnChannelProgram] }Commenting out the variable definition results in a compiler error. Thus I know that there are no confused variables for the timeline time values.
Is it possible to post something that can be compiled? I filled in the blanks as best I could and I still don't see anything wrong with the timeline creation. It fires 10 seconds after the last push. What is your indication that it fires after 1 second no matter what?
If you don't want to post more code then I suggest putting in a SEND_STRING 0 whenever you start the timeline (or set the timeline timer back to 1) and do a SEND_STRING 0 when the timeline fires.
I wish I could be of more help but I don't have enough to go on.
Sorry about that. I didn't realize that you were trying to compile my code. It is from a long-winded module for a specific digital tv tuner. I'll try to post more later.
TimelineID's need to be Longs so maybe that's what is screwing things up.
DEFINE_VARIABLE VOLATILE LONG lTL1_10Sec[1]={10000} DEFINE_START wait 100 { TIMELINE_CREATE (1,lTL1_10Sec,1,TIMELINE_RELATIVE,TIMELINE_once) send_string 0,'test, start' } DEFINE_EVENT TIMELINE_EVENT [1] { send_string 0,'test, hit' }BTW, I use that stacking of timelines all the time and have never yet had a probelm related to it. Works well for making waits related to UIs that can be tracked and managed seperately.
Thanks to all who had a look at the module for me!