Timeline Always Run for One Second
TurnipTruck
Junior Member
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?
Comments
-
Hmmm is right. That?s a 10 second timeline you got there. Is this your module? Might there be a duplicate Timeline ID in the there? You didn?t post much code and I don?t know how you know it?s going off once a second so I can?t be of much more help other than post code that verifies your snippet fires once every ten seconds.
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.Line 1 :: Timeline Created - 22:28:30 Line 2 :: Timeline Triggered - 22:28:40
TurnipTruck wrote: »This codes exists within a module. The timeline event always happens after one second regardless of the value of lTL1_10SecVOLATILE LONG lTL1_10Sec[1]={10000} TIMELINE_CREATE (1,lTL1_10Sec,1,TIMELINE_RELATIVE,TIMELINE_ONCE) TIMELINE_EVENT [1]
Hmmmm? -
TurnipTruck wrote: »This codes exists within a module. The timeline event always happens after one second regardless of the value of lTL1_10Sec
VOLATILE LONG lTL1_10Sec[1]={10000} TIMELINE_CREATE (1,lTL1_10Sec,1,TIMELINE_RELATIVE,TIMELINE_ONCE) TIMELINE_EVENT [1]
Hmmmm?
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... -
It already is an array, the square brackets indicate that. It?s an array of 1 but none the less an array. I use single element arrays all the time for timelines. Although I would do it like this instead - VOLATILE LONG lTL1_10Sec[]={10000} and let the compiler figure out the size. Either way is perfectly legal.ericmedley wrote: »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. -
Complete code related to the timline in question:
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. -
Help me help you....
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?TurnipTruck wrote: »Complete code related to the timline in question:
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. -
Joe Hebert wrote: »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. -
Is nUI declared as an integer?
TimelineID's need to be Longs so maybe that's what is screwing things up. -
I tested the code as written...Timeline triggers after tens seconds...So it works for me...
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' }(0000019651) test, start (0000029661) test, hit
-
Just for test purposes, comment out the stacked TIMELINE_EVENTs so only one can possibly trigger. I strongly suspect they are interfering with each other. It's been my experience that constructions that work with regular devchans don't always do as expected in a timeline, most likely due to something under the hood in the handler functions.
-
Problem is solved. I had another timeline being created elsewhere in the module with one of the numbers in the stack of ten timeline events. This module was the combination of what used to be a seperate comm and UI. I overlooked it in the marraige of the the two modules.
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!
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