Timeline ID FAQs
I can use arrays when declaring BUTTON_EVENTs, CHANNEL_EVENTs, DATA_EVENTs, and LEVEL_EVENTs, but it doesn’t seem to work with TIMELINE_EVENTs.
What can I do?
Arrays of timeline ID’s are not yet supported (08/09/2004), but we are considering adding support for them in the future.
However you can “stack” TIMELINE_EVENTS, so that multiple timelines can execute a single code block.
I’ve defined my Timeline ID as a variable, but it doesn’t work. Why not?
Timeline ID as a variable is not yet supported (08/09/2004), but we are considering adding support for this in the future.
Example code for the two questions above:
PROGRAM_NAME='StackedTimelineExample'
DEFINE_VARIABLE
CONSTANT LONG TimelineID_1 = 1
CONSTANT LONG TimelineID_2 = 2
CONSTANT LONG TimelineID_3 = 3
CONSTANT LONG TimelineID_4 = 4
LONG TimeArray[4] =
{
1000, // 1 second
2000, // 2 seconds
3000, // 3 seconds
4000 // 4 seconds
}
DEFINE_START
TIMELINE_CREATE(TimelineID_1,TimeArray,LENGTH_ARRAY(TimeArray),TIMELINE_RELATIVE,TIMELINE_REPEAT)
TIMELINE_CREATE(TimelineID_2,TimeArray,LENGTH_ARRAY(TimeArray),TIMELINE_RELATIVE,TIMELINE_REPEAT)
TIMELINE_CREATE(TimelineID_3,TimeArray,LENGTH_ARRAY(TimeArray),TIMELINE_RELATIVE,TIMELINE_REPEAT)
TIMELINE_CREATE(TimelineID_4,TimeArray,LENGTH_ARRAY(TimeArray),TIMELINE_RELATIVE,TIMELINE_REPEAT)
DEFINE_EVENT
// typical TIMELINE_EVENT statement
TIMELINE_EVENT[TimelineID_1] // capture all events for Timeline 1
{
SEND_STRING 0,"'TL ID = ', itoa(timeline.id),', sequence = ',itoa(timeline.sequence)"
}
// example of "stacked" TIMELINE_EVENT statements
TIMELINE_EVENT[TimelineID_2] // capture all events for Timeline 2
TIMELINE_EVENT[TimelineID_3] // capture all events for Timeline 3
TIMELINE_EVENT[TimelineID_4] // capture all events for Timeline 4
{
SEND_STRING 0,"'TL ID = ', itoa(timeline.id),', sequence = ',itoa(timeline.sequence)"
}
// end
To check execution of this code, open a terminal or telnet session to the master then type:
MSG ON<enter>
Where <enter> means “hit the Enter key”.
What will happen if I attempt to write a TIMELINE_EVENT using an array or variable?
Currently, if you attempt write a TIMELINE_EVENT statement with a variable or an array of constants, the TIMELINE_EVENT will not work and any events declared below it in the code will not work.
Can I use a number such as 1,2,3, etc. as a TIMELINE_ID?
Yes, this works no problem. See the simplistic example below:
DEFINE_VARIABLE
LONG volumeramp[] = {1000}
DEFINE_START
TIMELINE_CREATE(1,volumeramp,1,1,1)
WAIT 1
TIMELINE_CREATE(2,volumeramp,1,1,1)
WAIT 2
TIMELINE_CREATE(3,volumeramp,1,1,1)
WAIT 3
TIMELINE_CREATE(4,volumeramp,1,1,1)
WAIT 4
TIMELINE_CREATE(5,volumeramp,1,1,1)
WAIT 5
TIMELINE_CREATE(6,volumeramp,1,1,1)
WAIT 6
TIMELINE_CREATE(7,volumeramp,1,1,1)
WAIT 7
TIMELINE_CREATE(8,volumeramp,1,1,1)
DEFINE_EVENT
TIMELINE_EVENT[1]
TIMELINE_EVENT[2]
TIMELINE_EVENT[3]
TIMELINE_EVENT[4]
TIMELINE_EVENT[5]
TIMELINE_EVENT[6]
TIMELINE_EVENT[7]
TIMELINE_EVENT[8]
{
SEND_STRING 0,"'TID = ',ITOA(TIMELINE.ID)"
}
// end