<?xml version="1.0"?>

<FunctionDefinitions>
	<version>1</version>

	<function>
		<defn name="ac" desc="Sets the text colour" />
		<parameter name="exp1" desc="An 8-bit number (0-255) representing colour state" />
		<description>
<![CDATA[

The value exp1 is made up of 4 pairs of 2-bit numbers to form an 8-bit number from 0 to 255. Each bit pair is a green and red bit. The bit pair used is determined by local tally inputs T1 and T2. Set all 4 pairs the same for fixed color (color not affected by tally state).



Calculate value exp1 by adding values from the following table:



Color		Active Local Tallies

		None	T1	T2	T1 & T2



Blank		0	0	0	0

Red		1	4	16	64

Green		2	8	32	128

Amber		3	12	48	192



Fixed red is 85 (1 + 4 + 16 + 64)

Fixed green is 170 (2 + 8 + 32 + 128)

Fixed amber is 255 (3 + 12 + 48 + 192)



Example:



	AC(85)RED AC(255)AMBER AC(170)GREEN



The result is RED AMBER GREEN in their respective colors.

]]>
		</description>
	</function>

	<function>
		<defn name="add" desc="Returns the sum of exp1 and exp2" />
		<parameter name="exp1" desc="The first numeric value" />
		<parameter name="exp2" desc="The second numeric value" />
		<description>
<![CDATA[

The result is the sum of the numeric value exp1 and exp2

Example:



	SV(!X,ADD(V(!X),1))



Increment the value of temporary variable X by 1.

]]>
		</description>
	</function>

	<function>
		<defn name="af" desc="Sets the current character set" />
		<parameter name="exp1" desc="The character set selector value" />
		<description>
<![CDATA[

The value exp1 is a character set selector as follows:



0	fixed spacing (default)

1	large proportional spacing

2	medium proportional spacing

3	small

4	wide proportional spacing

5	block proportional spacing



Add 16 for dot reverse. Add 8 for vertical orientation. Some character sets may not be available on all remote display units.



Example:



	AF(19)123 AF(0)LARGE



The result is 123 in small reversed characters and LARGE in fixed spaced characters.

]]>
		</description>
	</function>

	<function>
		<defn name="aj" desc="Sets the current justification mode" />
		<parameter name="exp1" desc="The justify mode selector value" />
		<description>
<![CDATA[

The value of exp1 is a justify mode selector as follows:



0	left (default)

1	centre

2	right

3	full-width



Use more than one mode but always in order of left, center, and right. Full-width mode cannot be used with other modes.



Example:



	AJ(1)CENTERAJ(2)RIGHT



The result is CENTER in the middle of display and RIGHT on the right side.

]]>
		</description>
	</function>

	<function>
		<defn name="and" desc="Return 1 if exp1 and exp2 are not zero.  0 otherwise." />
		<parameter name="exp1" desc="The first condition or expression to evaluate" />
		<parameter name="exp2" desc="The second condition or expression to evaluate" />
		<description>
<![CDATA[

If both exp1 and exp2 are not zero the result is 1, otherwise the result is zero.



Example:



	SV(!Z,AND(V(!X),V(!Y)))



If the temporary variable X is not zero and the temporary variable Y is not zero, set the value of temporary variable Z to 1, otherwise set the value of temporary variable Z to zero.

]]>
		</description>
	</function>

	<function>
		<defn name="at" desc="Enables the timer/counter to appear on the display" />
		<parameter name="exp1" desc="The name of the timer/counter" />
		<description>
<![CDATA[

Enables the timer/counter named exp1 to appear in the display. Subsequent SP() functions refer to digits of the last selected timer/counter. Select up to 4 timers per display.



Example:



	AT(T1)SP(1)SP(2):SP(3)SP(4)



The result is hours and minutes for timer named T1 in HH:MM format.

]]>
		</description>
	</function>

	<function>
		<defn name="b2n" desc="Return a list of the bits set in a decimal number" />
		<parameter name="number" desc="A decimal number" />
		<parameter name="offset" desc="A value added to each bit number before list is returned" />
		<description>
<![CDATA[

Return a list of numbers of a decimal value that represents the bits set. The numbers will begin from specified 'offset' bit number.

If 'offset' is omitted, a value of zero of assumed.

Non-numeric expressions or the number 0 in 'number' return an empty string.

Numbers in the list are separated by commas.



Example:

	B2N(7,0) 	returns 0,1,2

	B2N(7,1)	returns 1,2,3



This function is useful for converting a number to a list of inputs for output controls.





See also N2B Function.

]]>
		</description>
	</function>

	<function>
		<defn name="ba" desc="Perform bitwise-AND of two values" />
		<parameter name="exp1" desc="The first value" />
		<parameter name="exp2" desc="The second value" />
		<description>
<![CDATA[

Each bit within the result value is 1 if the corresponding bits in the numeric values exp1 and exp2 are both 1, otherwise that result bit is zero. The result bits are combined to produce the result value.



Example:



	SV(!X,BA(V(!Y),15))



The value of the temporary variable X is set to the least significant four bits of temporary variable Y.

]]>
		</description>
	</function>

	<function>
		<defn name="bn" desc="Perform bitwise-NOT of two values" />
		<parameter name="exp1" desc="The first value" />
		<parameter name="exp2" desc="The second value" />
		<description>
<![CDATA[

Each bit within the result value is the inversion of the corresponding bit in the value exp1 (ones complement).



Example:



	SV(!X,BN(V(!X))



Inverts the value of the temporary variable X.

]]>
		</description>
	</function>

	<function>
		<defn name="bo" desc="Perform bitwise-OR of two values" />
		<parameter name="exp1" desc="The first value" />
		<parameter name="exp2" desc="The second value" />
		<description>
<![CDATA[

Each bit within the result value is 1 if either of the corresponding bits in the numeric values exp1 and exp2 are 1, otherwise that result bit is zero. The result bits are combined to produce the result value.



Example:



	SV(!X,BO(V(!X),1))



The value of the temporary variable X is set to nearest odd value.

]]>
		</description>
	</function>

	<function>
		<defn name="bx" desc="Perform bitwise-XOR of two values" />
		<parameter name="exp1" desc="The first value" />
		<parameter name="exp2" desc="The second value" />
		<description>
<![CDATA[

Each bit within the result value is 1 if the corresponding bits in the numeric values exp1 and exp2 are different, otherwise that result bit is zero. The result bits are combined to produce the result value.



Example:



	SV(!X,BX(V(!X),255))



The least significant eight bits of the value of the temporary variable X are inverted.

]]>
		</description>
	</function>

	<function>
		<defn name="ch" desc="Shows a timer/counter digit" />
		<parameter name="exp1" desc="The timer/counter digit selector" />
		<description>
<![CDATA[

The result is a timer/counter digit for selector exp1, from 1 to 69. This function provides access to timer/counter digits regardless of the currently selected timer. Usually, this is not needed, and access to timer/counter digits is accomplished using AT and SP functions.



Example:



	CH(1)CH(2):CH(3)CH(4)



The result is the hours and minutes digits of the first timer/counter.

]]>
		</description>
	</function>

	<function>
		<defn name="chr" desc="Displays a single character with the specified ASCII value" />
		<parameter name="value" desc="The ASCII value of the character" />
		<description>
<![CDATA[

The result is a single character having a specified ASCII value.



Example:



	SV(!X,CHR(61)CHR(62)CHR(63))



The temporary variable X is set to ABC.

]]>
		</description>
	</function>

	<function>
		<defn name="date" desc="Shows the current date" />
		<parameter name="timer" desc="The timer used to adjust the current date (optional)" />
		<description>
<![CDATA[

The result is a sample of the day, month, year, and day of week adjusted for the timer named 'timer', or the local date (unadjusted) if 'timer' is omitted.



Example:



	SV(!D,SS(DATE(),1,4)))



The temporary variable D is set to the local year.

]]>
		</description>
	</function>

	<function>
		<defn name="d2h" desc="Returns the hexadecimal value of a decimal number" />
		<parameter name="value" desc="The decimal number" />
		<description>
<![CDATA[

Return the hexadecimal equivalent of a specified decimal number. The returned number is an ASCII representation of a hexadecimal number.



Example:



	D2H(10)



Returns A.



See also H2D function

]]>
		</description>
	</function>

	<function>
		<defn name="div" desc="Divides a second numeric value by the first" />
		<parameter name="exp1" desc="The first numeric value" />
		<parameter name="exp2" desc="The second numeric value" />
		<description>
<![CDATA[

The result is the division of the numeric value exp1 and exp2. The remainder is discarded. If exp2 is zero, the result is also zero.

Example:



	SV(!X,DIV(V(!X),10))



The temporary variable X is divided by 10.

]]>
		</description>
	</function>

	<function>
		<defn name="do" desc="Repeatedly evaluates an expression until a condition is reached" />
		<parameter name="cond" desc="The condition in which the loop run" />
		<parameter name="exp1" desc="The expression to be evaluated" />
		<description>
<![CDATA[

Repeatedly return the result of evaluating 'exp1' until 'cond' is zero or a maximum of 100 iterations is reached.

For effective use, evaluating 'exp1' must cause 'cond' to eventually change to zero.



Example:



	SV(!X,0)DO(LT(V(!X),5),SV(!X,ADD(V(!X),1))V(!X)" ")



The result is the numbers from 1 to 5 separated by spaces.

]]>
		</description>
	</function>

	<function>
		<defn name="dur" desc="Sets the amount of delay before displaying previous lines" />
		<parameter name="value" desc="The duration length (in hundredths of seconds)" />
		<description>
<![CDATA[

Specifies the amount of time, in hundredths of a second, to display the previously selected lines (use the LIN function to select lines).

All displays have three separate lines that are displayed in sequence, each for their programmed duration.

A line duration of zero prevents the line from appearing.

If the duration of all lines are zero, the first line appears continuously.



Example:



	LIN(1)DUR(100)ON-AIRLIN(2)DUR(50)STUDIO 1



Flash ON-AIR for 1 second and STUDIO 1 for one-half second.

]]>
		</description>
	</function>

	<function>
		<defn name="eq" desc="Compares a set of values to see if they are equal" />
		<parameter name="exp1" desc="The first expression to compare" />
		<parameter name="exp2" desc="The second expression to compare" />
		<parameter name="exp3" desc="The third expression to compare" />
		<parameter name="exp4" desc="The fourth expression to compare" />
		<parameter name="..." desc="The n-th expression to compare" />
		<description>
<![CDATA[

The result is 1, 2, 3, ... if exp1 is equal to exp2, exp3, exp4, ..., respectively.

The result is zero if exp1 is not equal to any of exp2, exp3, exp4, ... .



Example:



	EQ(V(!X),JOHN,BOB,JIM,DAVE)



The result is 1, 2, 3, or 4, for values JOHN, BOB, JIM, or DAVE of temporary variable X.

]]>
		</description>
	</function>

	<function>
		<defn name="fn" desc="Calls a global function" />
		<parameter name="fn_name" desc="The name of the global function" />
		<description>
<![CDATA[

The value of the variable named 'fn_name' is inserted and evaluated as if it appears in place of the FN function. Use this function to apply common portions of control text to many displays at once. Create a global subroutine containing the common text fragment as its value and re-use the fragment where needed using the FN function with the name of the global message.



Example:



	SV(!Y,"SV(!X,ADD(V(!X),1))")SV(!X,0)FN(!Y)V(!X) FN(!Y)V(!X) FN(!Y)V(!X)



The result is 1 2 3.

]]>
		</description>
	</function>
	
	<function>
		<defn name="gc" desc="Selects a graphic character" />
		<parameter name="value" desc="The graphic character selection (1-9)" />
		<description>
<![CDATA[

The result is a graphic character for selector 'value', from 1 to 9. If the graphic character is not defined, the result is the empty string.



Example:



	IF(IV(0),PLAYGC(1),STOPGC(2))



The result is PLAY and graphic charcter 1 if GPI input 0 is on, otherwise the result is STOP and graphic character 2.

]]>
		</description>
	</function>

	<function>
		<defn name="ge" desc="Compares if one value is greater than or equal to the other" />
		<parameter name="exp1" desc="The first expression to compare" />
		<parameter name="exp2" desc="The second expression to compare" />
		<description>
<![CDATA[

If 'exp1' is greater than or equal to 'exp2' the result is 1, otherwise the result is zero.

If either of 'exp1' or 'exp2' are non-numeric, the strings are compared lexically in ASCII order (ACC is greater than ABC).



Example:



	IF(GE(V(!X),10),ALARM OVERFLOW,V(!X) ALARMS)



If the temporary variable X has a value of 10 or more, the IF function evaluates to the text 'ALARM OVERFLOW', otherwise the IF function evaluates to the text 'n ALARMS', where n is the value of temporary variable X.

]]>
		</description>
	</function>

	<function>
		<defn name="gpm" desc="Gets the system parameter mode for a timer/counter" />
		<parameter name="timer" desc="The name of the timer/counter" />
		<description>
<![CDATA[

Gets the system parameter mode of the timer/counter named 'timer'.



Example:



	ON(EQ(SS(GPM(T1),6,2),24,29),OTHER,PAL,NTSC)



The result is PAL, NTSC, or OTHER if the timer named T1, counts in 25, 30, or some other number of frames per second.

]]>
		</description>
	</function>

	<function>
		<defn name="gpv" desc="Gets the system parameter value for a timer/counter" />
		<parameter name="timer" desc="The name of the timer/counter" />
		<description>
<![CDATA[

Gets the system parameter value of the timer/counter named 'timer'.



Example:



	SV(!X,SS(GPV(T1),1,2))



Set the temporary variable X to the current hour of the timer named T1.

]]>
		</description>
	</function>

	<function>
		<defn name="gt" desc="Compares if one value is greater than the other" />
		<parameter name="exp1" desc="The first expression to compare" />
		<parameter name="exp2" desc="The second expression to compare" />
		<description>
<![CDATA[

If 'exp1' is greater than 'exp2' the result is 1, otherwise the result is zero.

If either of 'exp1' or 'exp2' are non-numeric, the strings are compared lexically in ASCII order (ACC is greater than ABC).



Example:



	IF(GT(V(!X),10),ALARM OVERFLOW,V(!X) ALARMS)



If the temporary variable X has a value of more than 10, the IF function evaluates to the text 'ALARM OVERFLOW', otherwise the IF function evaluates to the text 'n ALARMS', where n is the value of temporary variable X.

]]>
		</description>
	</function>


	<function>
		<defn name="h2d" desc="Returns the decimal number of a hexadecimal value" />
		<parameter name="value" desc="The hexadecimal value" />
		<description>
<![CDATA[

Return the decimal equivalent of a specified hexadecimal number. The returned number is an ASCII representation of a decimal number.



Example:



	H2D(A0)



Returns 160.



See also D2H function

]]>
		</description>
	</function>

	<function>
		<defn name="hex" desc="Returns the decimal number of a hexadecimal value" />
		<parameter name="value" desc="The hexadecimal value" />
		<description>
<![CDATA[

Same as H2D function. Return the decimal equivalent of a specified hexadecimal number. The returned number is an ASCII representation of a decimal number.



Example:



	HEX(A0)



Returns 160.



See also H2D and D2H functions

]]>
		</description>
	</function>

	<function>
		<defn name="i2n" desc="Convert active GPI inputs into a list of numbers" />
		<parameter name="address" desc="The starting GPI input address (0-based)" />
		<parameter name="length" desc="The number of GPI inputs to monitor" />
		<parameter name="offset" desc="The starting number to return" />
		<description>
<![CDATA[

Converts a set of active GPI inputs to a list of numbers. Value 'address' is the first GPI input number. Value 'length' is the number of consecutive GPI inputs. Value 'offset' is the first number of a sequence that corresponds with the first GPI input.

This function is commonly used to implement a multiple source output of a resource device. The I2N function is specified in the control text of one of the resource outputs of the device.



Example:



	I2N(40, 20, 1)



The result is the numbers from 1 to 20 separated by spaces that correspond to active GPI inputs from 40 to 59.

]]>
		</description>
	</function>

	<function>
		<defn name="id" desc="Returns the serial number of the display" />
		<description>
<![CDATA[

The result is the serial number of up to 6 characters followed by the section number 1, 2, or 3 of the display section that is accessing this function.



Example:



	ON(SS(ID(),LEN(ID()),1),,LEFT,CENTRE,RIGHT)



The result is LEFT, CENTRE, or RIGHT depending on the display section.

]]>
		</description>
	</function>

	<function>
		<defn name="if" desc="Conditionally perform an operation" />
		<parameter name="exp1" desc="The condition to check" />
		<parameter name="exp2" desc="The resulting expression returned if exp1 evaluates to true" />
		<parameter name="exp3" desc="The resulting expression returned if exp1 evaluates to false" />
		<description>
<![CDATA[

If exp1 is not zero, the result is exp2, otherwise the result is exp3.



Example:



	IF(IV(0),"ALARM 1","NO ALARMS")



If GPI input number 0 is active, the IF function evaluates to the text "ALARM 1". If GPI input number 0 is not active, the IF function evaluates to the text "NO ALARMS".

]]>
		</description>
	</function>

	<function>
		<defn name="igm" desc="Multi-selects GPI inputs and returns the selection as a list of numbers" />
		<parameter name="channel" desc="The starting GPI input address (0-based)" />
		<parameter name="length" desc="The number of GPI inputs to monitor" />
		<parameter name="offset" desc="The starting number to return" />
		<parameter name="transition" desc="Detection style of transition state" />
		<parameter name="cascade" desc="An input list to be appended" />
		<description>
<![CDATA[

("Input Group Mixer") multi-selects GPI inputs, returning a list of relative numbers representing the selected GPI inputs in a group of consecutive GPI inputs. In a typical application, hitting buttons on an RCP panel programmed with the IGM function allows more than one button to be selected at the same time. IGM returns a list of comma-separated numbers starting from 'offset'. Depending on the value of the 'transition' parameter, IGM selects buttons on the button press, on the button release, or either.



Channel: The starting GPI input address



Length: The number of consecutive addresses monitored, including the starting address. Default: 1



Offset: The value returned when the first GPI input of the group is selected. Other returned values are consecutive. This allows control of the starting value of the returned list. Default: 0



Transition:



	A value of "1" enables detection of a off-to-on transition.

	A value of "2" enables detection of an on-to-off transition.

	A value of "3" enables detection of both transition edges.

	A value of "0" causes the function to return an empty string. Default: 1 (off-to-on transition).



Cascade: This allows another input list to be appended to the list returned by IGM. This is useful for cascading IGM functions for the handling of disjointed ranges of inputs. Default: no list.



Example 1: IGM(4,3,1) multi-selects GPI inputs 4,5,6 and returns some combination of the numbers "1","2","3".



Example 2: IGM(1,3,1,1,IGM(11,3,4,1)) multi-selects GPI inputs 1,2,3 along with GPI inputs 11,12,13. and returns some combination of the numbers "1","2","3","4","5","6". Note that the "cascaded" IGM function is for 4 in order provided a consecutive set of return values.



See also IGS Function

]]>
		</description>
	</function>

	<function>
		<defn name="igs" desc="Single-selects GPI inputs and returns a single number" />
		<parameter name="channel" desc="The starting GPI input address (0-based)" />
		<parameter name="length" desc="The number of GPI inputs to monitor" />
		<parameter name="offset" desc="The starting number to return" />
		<parameter name="transition" desc="Detection style of transition state" />
		<parameter name="cascade" desc="An input list to be appended" />
		<parameter name="userbit" desc="Unique # for monitoring inputs with multiple IGS functions (0-7)" />
		<parameter name="staticvar" desc="Static variable for tracking GPI input changes" />
		<description>
<![CDATA[

("Input Group Select") single-selects GPI inputs returns a single value - the relative number of the most-recently-changed GPI input. In a typical application, pressing a button on an RCP panel selects the last-pressed button in a group of buttons, allowing one button to be selected at a time, while automatically canceling previous selections.



Channel: The starting GPI input address



Length: The number of consecutive addresses monitored, including the starting address. Default: 1



Offset: The value returned when the first GPI input of the group is selected. Other returned values are consecutive. This allows control of the starting value of the returned list. Default: 0



Transition:



	A value of "1" enables detection of a off-to-on transition.

	A value of "2" enables detection of an on-to-off transition.

	A value of "3" enables detection of both transition edges.

	A value of "0" causes the function to return an empty string. Default: 1 (off-to-on transition).



Cascade: This allows another input list to be appended to the list returned by IGM. This is useful for cascading IGM functions for the handling of disjointed ranges of inputs. Default: no list.



User bit: A value of 0 to 7 allows more than one IGS function to monitor the same GPI input. A unique user bit value would be used in each instance of IGS functions that monitor overlapping ranges of GPI inputs in a given tally system configuration. For example if IGS(0,2,1) and IGS(0,3,1) (overlapping GPI inputs 0 and 1), then IGS(0,2,1,,,0,*S) and IGS(0,3,1,,,1,*S) would be programmed, where the user bit numbers are 0 and 1 respectively. Default: 0



Variable: This static variable is required for working memory for detecting and tracking GPI input changes. IGS functions used in the same display, GPI output or output control must have different static variable names. Default: none; a static variable name, starting with the asterisk character, must be supplied.



Example: IGS(0,3,1,,,,*S) would single-select one of GPI inputs 0, 1 and 2, returning one of numbers 1, 2 or 3, depending on which GPI input was last toggled from the off to the on state.



See also IGM Function

]]>
		</description>
	</function>

	<function>
		<defn name="iv" desc="Returns the active state of a GPI input" />
		<parameter name="address" desc="The GPI input address (0-based)" />
		<description>
<![CDATA[

The result is 1 if GPI input at specified 'address' is active, otherwise the result is zero. Value exp1 must be numeric from 0 to 511.



Example:



	SV(!X,EQ(IV(0)IV(1)IV(2),100,110,111))



Sets temporary variable X to 1 if GPI input 0 is on and inputs 1 and 2 are off.

Sets temporary variable X to 2 if GPI inputs 0 and 1 are on and input 2 is off.

Sets temporary variable X to 3 if GPI inputs 0, 1, and 2 are on.

For any other conditions of GPI inputs 0, 1, and 2, set temporary variable X to 0.

]]>
		</description>
	</function>

	<function>
		<defn name="ivc" desc="Returns a 1 if a GPI input change is detected" />
		<parameter name="channel" desc="The starting GPI input address (0-based)" />
		<parameter name="length" desc="The number of GPI inputs to monitor" />
		<parameter name="transition" desc="Detection style of transition state" />
		<parameter name="userbit" desc="Unique # for monitoring inputs with multiple IGS functions (0-7)" />
		<description>
<![CDATA[

Returns a value of 1 when a change is detected on a given set of GPI inputs. The 1 is returned for only one evaluation of the expression; subsequent evaluations without another transition on the set of GPI inputs will return 0. Therefore this function must usually be used in conjunction with a variable in order to trap GPI input transitions.



Channel: The starting GPI input address



Length: The number of consecutive addresses monitored, including the starting address. Default: 1



Transition:



	A value of "1" enables detection of a off-to-on transition.

	A value of "2" enables detection of an on-to-off transition.

	A value of "3" enables detection of both transition edges.

	A value of "0" causes the function to return an empty string. Default: 1 (off-to-on transition).



User bit: A value of 0 to 7 allows more than one IVC function to monitor the same GPI input. A unique user bit value would be used in each instance of IVC functions that monitor overlapping ranges of GPI inputs in a given tally system configuration.



Example: sv(COUNT,if(ivc(0,4,1,0),add(v(COUNT)1,),v(COUNT))) will increment variable COUNT each time any of GPI inputs 0 to 3 toggle from the off to the on state.



See also IVT Function

]]>
		</description>
	</function>

	<function>
		<defn name="ivt" desc="Returns the modulus of transition counts on a GPI input change" />
		<parameter name="channel" desc="The starting GPI input address (0-based)" />
		<parameter name="transition" desc="Detection style of transition state" />
		<parameter name="modulus" desc="Limit range of transition count between 0 and one less than modulus" />
		<description>
<![CDATA[

Returns a modulus of the count of the number of transitions detected on a given GPI input. In a typical application this can be used to toggle through a set of numbers by repeated presses of a key on an RCP panel.



Channel: The starting GPI input address



Transition:



	A value of "1" enables detection of a off-to-on transition.

	A value of "2" enables detection of an on-to-off transition.

	A value of "3" enables detection of both transition edges.

	A value of "0" causes the function to return an empty string. Default: 1 (off-to-on transition).



Modulus: Causes the returned transition count to be limited to the range zero to one less than the 'modulus' parameter value. Default value: 2 (this causes the IVT function to return 0 or 1 on alternating transitions, making the returned value behave as an on-off toggle).



Example: IVT(0,1,4) returns one of values 0, 1, 2, 3, in that order, on each transition of GPI input 0 to from the off to the on state.



See also IVC Function

]]>
		</description>
	</function>

	<function>
		<defn name="lc" desc="Converts upper case letters to lower case" />
		<parameter name="exp" desc="The expression to convert" />
		<description>
<![CDATA[

Any upper case letters in 'exp' are converted to lower case in the result.



Example:



	UC(SS(V(!X),1,1))LC(SS(V(!X),2,50))



Returns a string where the first character stored in temporary variable X is upper case and the remaining characters are lower case.

]]>
		</description>
	</function>

	<function>
		<defn name="le" desc="Compares if one value is less than or equal to the other" />
		<parameter name="exp1" desc="The first expression to compare" />
		<parameter name="exp2" desc="The second expression to compare" />
		<description>
<![CDATA[

If 'exp1' is less than or equal to 'exp2' the result is 1, otherwise the result is zero.

If either of 'exp1' or 'exp2' are non-numeric, the strings are compared lexically in ASCII order (ABC is less than ACC).



Example:



	IF(LE(V(!X),10),"IN RANGE","OUT OF RANGE")



If the temporary variable X has a value of more than 10, the IF function evaluates to the text "OUT OF RANGE", otherwise the IF function evaluates to the text "IN RANGE".

]]>
		</description>
	</function>

	<function>
		<defn name="len" desc="Returns the length of an expression" />
		<parameter name="exp" desc="The expression to evaluate" />
		<description>
<![CDATA[

The result is the number of characters in 'exp'.



Example:



	SS("          ",1,DIV(SUB(20,LEN(V(!X))),2))V(!X)



The result is the contents of temporary variable X centered in a 20-character display area.

]]>
		</description>
	</function>

	<function>
		<defn name="lin" desc="Selects the display lines to be affected by text functions" />
		<parameter name="lin#" desc="The line numbers to affect" />
		<description>
<![CDATA[

Selects the lines to be affected by subsequent text and functions. All displays have three separate lines that are displayed in sequence, each for the duration specified by the DUR function.



Calculate value 'lin#' by adding values from the following table:



Line			Value



First			1

Second			2

Third			4





To select all lines, use a value of 7 (1 + 2 + 4).



Virtual GPIs used with Evertz displays can be set using LIN(16). The format as follows:



	LIN(16)<VGPI#>=<1 or 0>{LIN(1)UMD text control string optional}


Example:



	LIN(7)DUR(200)STATUS: LIN(1)OPENLIN(2)FROM 9 AMLIN(4)TO 5 PM



The result is STATUS: followed by one of OPEN, FROM 9 AM, TO 5 PM, pausing on each for 2 seconds.



	LIN(16)5=IF(EQ(V(!X),100),1,0)



If the temporary variable X is equal to 100, then virtual GPI #5 will be turned on, otherwise it will be set to off.

]]>
		</description>
	</function>

	<function>
		<defn name="lt" desc="Compares if one value is less than the other" />
		<parameter name="exp1" desc="The first expression to compare" />
		<parameter name="exp2" desc="The second expression to compare" />
		<description>
<![CDATA[

If 'exp1' is less than 'exp2' the result is 1, otherwise the result is zero.

If either of 'exp1' or 'exp2' are non-numeric, the strings are compared lexically in ASCII order (ABC is less than ACC).



Example:



	IF(LT(V(!X),10),"BELOW TEN","TEN OR MORE")



If the temporary variable X has a value of 10 or more the IF function evaluates to the text "TEN OR MORE", otherwise the IF function evaluates to the text "BELOW TEN".

]]>
		</description>
	</function>

	<function>
		<defn name="mod" desc="Returns the remainder when exp1 is divided by exp2" />
		<parameter name="exp1" desc="The first condition or expression to evaluate" />
		<parameter name="exp2" desc="The second condition or expression to evaluate" />
		<description>
<![CDATA[

The result is the remainder of the division of the numeric value 'exp1' and 'exp2'. The dividend is discarded. If 'exp2' is zero, the result is also zero.



Example:



	SV(!X,MOD(V(!X),10))



Sets the temporary variable X to a modulo-10 value.

]]>
		</description>
	</function>

	<function>
		<defn name="mul" desc="Returns the remainder when exp1 is multiplied by exp2" />
		<parameter name="exp1" desc="The first condition or expression to evaluate" />
		<parameter name="exp2" desc="The second condition or expression to evaluate" />
		<description>
<![CDATA[

The result is the product of the numeric value 'exp1' and 'exp2'.



Example:



	SV(!X,MUL(V(!X),2))



Doubles the value of the temporary variable X.

]]>
		</description>
	</function>

	<function>
		<defn name="n2b" desc="Returns a decimal number calculated from list of bit numbers" />
		<parameter name="list" desc="The list of bit numbers separated by commas" />
		<parameter name="offset" desc="A value subtracted from each number in the list" />
		<description>
<![CDATA[

Return a decimal number calculated from a list of set bit numbers, where the number 0 is bit 0, number 1 is bit 1 and so on. Where the list of numbers is specified as n1,n2,n3, the returned value is calculated as 2^n1 + 2^n2 + 2^n2.

This function is useful for converting the list of numbers returned from functions I2N, IGS, and IGM to a decimal value.

This is useful for easily programming control multiple consecutive GPI outputs and Image Video RCP-20 and RCP-40 control panels.



Parameter 'list' can be supplied by one of the afore-mentioned functions. If a list of numbers is manually entered the list must be surrounded by double quotes.

Parameter 'offset' is subtracted from each number in the given list before the return value is calculated. 'offset' is assumed to be zero if omitted.



Example:



	N2B("0,1,2") returns "7"



	N2B("1,2,3",1) also returns "7"


	
	N2B(IGM(0,4,0)) applied to a set of 4 RCP buttons starting at GPI input address "0" would return "0" when the first button is selected, "1" when the second button is selected and "3" when the first two buttons are selected simultaneously. This expression could be directly inserted into an output control of size 4 to control the RCP panel LEDs in accordance with the button selections.



See also B2N Function

]]>
		</description>
	</function>

	<function>
		<defn name="name" desc="Gets the name of the display accessing this function" />
		<description>
<![CDATA[

The result is the name of up to 26 characters of the display that is accessing this function.



Example:



	SS(NAME(),SUB(LEN(NAME()),2),3))



The result is the last three characters from the name of the display.

]]>
		</description>
	</function>

	<function>
		<defn name="not" desc="Returns 1 if exp1 is zero. 0 otherwise" />
		<parameter name="exp1" desc="The first condition or expression to evaluate" />
		<description>
<![CDATA[

If 'exp1' is zero the result is 1, otherwise the result is zero.



Example:



	SV(!Y,NOT(EQ(V(!X),5)))



If the temporary variable X is 5, set the value of temporary variable Y to zero, otherwise set the value of temporary variable Y to 1.

]]>
		</description>
	</function>

	<function>
		<defn name="od" desc="Get name of signal origin feeding this input" />
		<parameter name="input" desc="The name of the input to trace (R::N[L] format)" />
		<description>
<![CDATA[

Return name of the signal origin that is feeding this input. The signal original name is returned in <Device::Output> format.

In the formulation <Device::Input>, Device must be the name of a router or production switcher device, as defined in Hardware>Comm Port Setup>Production and M/C Switchers or Hardware>Comm Port Setup>Routers. Input must be the name of an input of said Router or Production switcher device.



This function will return a value if the given input is included in the tally system configuration as one of the ends of a signal interconnection, as defined in either the Tally System Console 2 Source Definitions editor or the Signal Paths editor.



In the legacy Tally System Console, such signal interconnections was defined under Resource>Interconnections. Example OD(SWR::1) will return the destination feeding SWR input 1 (e.g. RTR::DEST1[1]), if SWR::1 is a Signal Path origin and RTR::DEST1[1] is a Signal Path end.

]]>
		</description>
	</function>

	<function>
		<defn name="on" desc="Return a sequence of results when a sequence of conditions are met" />
		<parameter name="exp1" desc="The first condition or expression to evaluate" />
		<parameter name="exp2" desc="The second condition or expression to evaluate" />
		<parameter name="exp3" desc="The third condition or expression to evaluate" />
		<parameter name="exp4" desc="The fourth condition or expression to evaluate" />
		<description>
<![CDATA[

The result is exp2, exp3, exp4, ... if exp1 is 0, 1, 2, ..., respectively. If exp1 is too large, the result is the empty string.



Example:



	ON(V(!X),ZERO,ONE,TWO,THREE,FOUR)



The result is ZERO, ONE, TWO, THREE, or FOUR for values 0, 1, 2, 3, 4 of temporary variable X, respectively.

]]>
		</description>
	</function>

	<function>
		<defn name="onum" desc="No description available" />
		<parameter name="exp1" desc="" />
		<description>
<![CDATA[

Not available.



Example:



	ONUM(R1::VTR02)



]]>
		</description>
	</function>

	<function>
		<defn name="opt" desc="Set options to control behaviour of embedded functions" />
		<parameter name="name" desc="The option name" />
		<parameter name="value" desc="The option value" />
		<description>
<![CDATA[

Set certain options to control the behavior of various embedded functions.



Option Name: "RENT"



Purpose: enable re-entry-limited signal trace for SRC, TSX, and SL functions. This allows destination-tracing UMDs to trace only to and not through re-entry inputs such as production switcher mix-effect buses, thus showing the name of the mix effect bus rather than the source feeding the mix-effect bus. OPT affects only functions that are programmed after the OPT function in the control expression.



Possible values:

	"on", "1" (both enable re-entry-limited signal trace)

	"off", "0 (both disable re-entry-limited signal trace). This option is off by default.



Note: OPT must programmed, either directly or indirectly through a control expression or subroutine for each UMD that is desired to be affected by the OPT expression.



Example:



	OPT("RENT","on")TSX(RTR::MON1[1],A) turns on the re-entry-limited signal trace for following the TSX function.



]]>
		</description>
	</function>

	<function>
		<defn name="or" desc="Return 1 if exp1 or exp2 are not zero.  0 otherwise" />
		<parameter name="exp1" desc="The first condition or expression to evaluate" />
		<parameter name="exp2" desc="The second condition or expression to evaluate" />
		<description>
<![CDATA[

If either exp1 or exp2 are not zero the result is 1, otherwise the result is zero.



Example:



	SV(!Z,OR(V(!X),V(!Y)))



If the temporary variable X is not zero or the temporary variable Y is not zero, set the value of temporary variable Z to 1, otherwise set the value of temporary variable Z to zero.

]]>
		</description>
	</function>

	<function>
		<defn name="pgd" desc="Returns the name of one on-air destination reached by a source" />
		<parameter name="source" desc="The name of the source (R::N[L] format)" />
		<parameter name="priority" desc="The priority of the destination to return" />
		<description>
<![CDATA[

The result is the name of one of the on-air destinations currently reached by the source in the 'source' parameter.



The numeric value 'priority' is:



	0 to get highest priority destination

	1 for next highest

	2 ...and so on.



If the result is the empty string, there are no more on-air destinations reached by that source.



Example:



	S(PGD(R1::VTR002,0),A)



The result is the style A name of the first on-air destination connected to source VTR002 of resource R1.

]]>
		</description>
	</function>

	<function>
		<defn name="pgm" desc="Returns 1 if the source is currently on-air. 0 otherwise" />
		<parameter name="source" desc="The name of the source (R::N[L] format)" />
		<description>
<![CDATA[

The result is 1 if source parameter 'source' is currently on-air, otherwise the result is zero.



Example:



	IF(PGM(R1::CAM001),AC(85),AC(170))CAM 1



The result is CAM 1 in red if the source CAM001 of resource R1 is on-air, otherwise the result is CAM 1 in green.


]]>
		</description>
	</function>

	<function>
		<defn name="pos" desc="Returns the position of a matching string (1-based)" />
		<parameter name="exp1" desc="The first expression" />
		<parameter name="exp2" desc="The second expression" />
		<parameter name="matchpos" desc="Starting matching position" />
		<description>
<![CDATA[

If the value 'matchpos' is positive, the result is the position of string 'exp1' in string 'exp2' starting at position 'matchpos' of string 'exp2'.



If the value 'matchpos' is negative (starts with a minus sign), the result is the position of anything but string 'exp1' in string 'exp2' starting at position 'matchpos' (its absolute value).



The first position is 1. 

Example:



	CAM 3 IF(POS(R2::CAM3,XPT(R2::ISO1)" "XPT(R2::ISO2)" "XPT(R2::ISO3,1)),ISO,IDLE)



The result is CAM 3 ISO if the source CAM3 is selected on destination ISO1, ISO2, or ISO3 of resource R2, otherwise the result is CAM 3 IDLE.

]]>
		</description>
	</function>

	<function>
		<defn name="psd" desc="Returns the name of one next-to-air destination reached by a source" />
		<parameter name="source" desc="The name of the source (R::N[L] format)" />
		<parameter name="priority" desc="The priority of the destination to return" />
		<description>
<![CDATA[

The result is the name of one of the next-to-air destinations currently reached by the source in the 'source' parameter.



The numeric value 'priority' is:



	0 to get highest priority destination

	1 for next highest

	2 ...and so on.



If the result is the empty string, there are no more next-to-air destinations reached by that source.



Example:



	S(PSD(R1::CAM003,0),A)



The result is the style A name of the first next-to-air destination connected to source CAM003 of resource R1.

]]>
		</description>
	</function>

	<function>
		<defn name="pst" desc="Returns 1 if the source is currently next-to-air. 0 otherwise" />
		<parameter name="source" desc="The name of the source (R::N[L] format)" />
		<description>
<![CDATA[

The result is 1 if source parameter 'source' is currently next-to-air, otherwise the result is zero.



Example:



	IF(PST(R1::CAM002),AC(255),AC(170))CAM 2



The result is CAM 2 in amber if the source CAM002 of resource R1 is next-to-air, otherwise the result is CAM 2 in green.

]]>
		</description>
	</function>

	<function>
		<defn name="s" desc="Gets the styled name of a source or destination" />
		<parameter name="exp1" desc="The source or destination (R::N[L] format)" />
		<parameter name="style" desc="The type of style to return" />
		<description>
<![CDATA[

Gets the styled name of the source or destination named 'exp1' using the style selector 'style'.

The format of exp1 is R::N[L], where R is the resource device name, N is the source or destination name, and L is the optional level indicator. N and L are dependent on the type of resource device. Style 'style' is as follows:



Selector	Style



0		primary name

1		secondary name

2		short name

3		long name

A		style A

B		style B



Styles A and B refer to one of the other styles independently for each source and destination. Primary and secondary names refer to the native name within the resource device, which could be a number. Long and short names are user-specified aliases.



Example:



	S(SRC(R1::AUX002,0),3)



The result is the long name of the originating source at destination AUX002 of resource R1.

]]>
		</description>
	</function>

	<function>
		<defn name="seti" desc="Dynamically control signal interconnects" />
		<parameter name="name" desc="The name of the signal interconnect to be modified" />
		<parameter name="origin" desc="The device output to be interconnected to one or more inputs (R::N[L] format)" />
		<parameter name="create" desc="Create interconnect flag" />
		<parameter name="trigger" desc="Disconnect flag for inputs from signal origin" />
		<parameter name="inputlist" desc="List of device inputs to be interconnected to origin output" />
		<description>
<![CDATA[

The interconnection of the given name is set with a signal path originating at the given Destination and ending in one or more device inputs.

If the Create flag is evaluated to a non-zero value, the interconnect will be created within the TSI database if it does not already exist.

The trigger parameter determines if the interconnect is actually written, for example on the basis of a GPI input switch. This allows interconnection to be switched dynamically and is particularly useful for creating certain types of tally maps. When the expression is evaluated and the trigger flag is found to be a non-zero value, all inputs found connected to the given signal origin are disconnected, then all signal ends given in the list of inputs are connected to the given signal origin. Empty entries or inputs specified incorrectly in the input list are ignored.



Name: Name of the Signal Interconnection that is modified by this expression



Origin: Device output (signal source) that will be interconnected to one or more device inputs. This parameter is specified in Device::Output format (e.g. RTR::OUT1[1] or SWR::M/E1)



Create: If this parameter is evaluated to a non-zero value, the interconnect will be created within the TSI database if it does not already exist. If the parameter evaluates to a zero value, and the interconnection does not exist in the tally system database, this expression will have no effect. If the parameter evaluates to a zero value, and the interconnection already exists in the tally system database, this expression will operate as normal.



Trigger: When the expression is evaluated and the trigger flag is found to be a non-zero value all inputs found connected to the given signal origin are disconnected, then all signal ends given in the list of inputs are connected to the given signal origin.



Input list: One or more device inputs to which will be interconnected to the Origin output. Multiple inputs are separated by commas. Inputs are specified in Device::Input format. Empty entries or inputs specified incorrectly in the input list are ignored.



Example:



	SETI(PATH1,RTR::OUT1[1],1, ivc(0,1,3),if(iv(0),SWR::1),if(not(iv(0)),SWR::2))



	SETI(PATH1,RTR::OUT1[1],1, ivc(0,1,3),if(iv(0),SWR::1,SWR::2))



The above expression switches an interconnection between two inputs when GPI input 0 changes state (see IVC function).

]]>
		</description>
	</function>

	<function>
		<defn name="setx" desc="Switches virtual crosspoints" />
		<parameter name="dest" desc="The virtual signal destination to be controlled (R::N[L] format)" />
		<parameter name="create" desc="Create signal destination flag" />
		<parameter name="clear" desc="Deselect all previous crosspoints" />
		<parameter name="trigger" desc="Condition for device input selection to occur" />
		<parameter name="set" desc="Specifies device inputs selection state" />
		<parameter name="process" desc="Flag to delay SETI function crosspoint change till next evalution" />
		<parameter name="dev1" desc="Device input #1" />
		<parameter name="dev2" desc="Device input #2" />
		<description>
<![CDATA[

Switches virtual crosspoints, mimicking a crosspoint change made by an external device, or a virtual crosspoint change made by an Output Control.
 


When the Trigger flag evaluates to a non-zero-value, if the Clear flag has evaluated to a non-zero value, any inputs currently switched by the signal destination are turned off.

Then, if the Trigger flag has evaluated to a non-zero value, and depending on the evaluated state of the Set flag, the listed inputs are either turned on (if Set is non-zero) or turned off (if Set is Zero).

The tally system is informed of the crosspoint change only if the Process flag is set, at which point the various outputs of the tally system (UMDs, GPI outputs etc.) are updated to reflect the new state of the given signal destination. This allows multiple calls of the SETX function to be executed before the tally system reacts to the changes.

The SETX function is ignored if the given signal destination does not exist and the create flag evaluates to zero.

The given signal destination is created as necessary if the create flag is non-zero.



Signal Destination: This is the virtual signal destination that is controlled and switched to different crosspoints. It is specified in the Device::Destination format (e.g. RTR::OUT1)



Create: If the create flag evaluates to a non-zero value, and if the given signal destination does not exist in the tally system database (as defined in, for example, the Device Definition editor) the signal destination is automatically and internally created by the tally system. The automatically created signal destination does not appear as an entry in the Tally System Console tables.



Clear: If the clear flag evaluates to a non-zero value, any and all previously selected crosspoints are turned off (de-selected) before any new crosspoints are selected.



Trigger: When the expression is evaluated and the trigger flag is found to be a non-zero value the specified device inputs are are selected or deselected. This allows the crosspoint selection process to occur only when some specific change has occurred, such as the switching of a GPI input.



Set: When all other conditions for a crosspoint switch to occur are in place, the Set flag determines whether the device inputs specified in the device input list will be selected or deselected. In combination with the Clear flag (which can be set to clear, or not clear, previously selected inputs) this allows specified inputs to be individually turned on or off.



Process: If the process flag evaluates to a zero value, the tally system is kept uninformed of any crosspoint changes made by the SETI function, until the next evaluation of the SETX function that finds the Process flag at a non-zero value. This allows multiple consecutive calls of the SETX function to be executed before the tally system reacts to the changes. For example this would allow one SETX function (with the process flag clear), to select a specific set of device inputs and a second SETX function (with the process flag set) to de-select another specific set of device inputs, before the tally system is called on to process all crosspoint changes made by the two consecutive SETX functions.In the more usual case where only one SETX function is used for a particular signal destination, the Process flag can be simply set to "1".


 
Device Input List: The device inputs that will be selected or de-selected. Device inputs are specified by input name only, as the inputs are assumed to exist within the device specified by the Signal Destination parameter.



Example:



	SETX(VRTR::OUT1,1,1,ivc(0,1,3),1,1,if(iv(0),"IN1"),if(not(iv(0)),"IN2"))



	SETX(VRTR::OUT1,1,1,ivc(0,1,3),1,1,if(iv(0),"IN1","IN2"))



Both of the above expressions create signal destination VRTR::OUT1 and switches the destination between two inputs when GPI input 0 changes state (see IVC function).


 


NOTE: SETX controls only the internal crosspoint status maintained by the TSI. SETX does not cause crosspoint changes to be transmitted to external hardware devices such as signal routing systems. SETX is used with virtual (non-hardware) routers that are created and controlled entirely within the tally system control logic.

]]>
		</description>
	</function>

	<function>
		<defn name="sid" desc="Returns whether a source reaches one or more destinations" />
		<parameter name="source" desc="The source to check (R::N[L] format)" />
		<parameter name="dest1" desc="The first destination (R::N[L] format)" />
		<parameter name="dest2" desc="The second destination (R::N[L] format)" />
		<parameter name="dest3" desc="The third destination (R::N[L] format)" />
		<parameter name="..." desc="Subsequent destinations (R::N[L] format)" />
		<description>
<![CDATA[

The result is 1, 2, 3, ... if the specified source reaches the destinations 'dest1', 'dest2', 'dest3', ..., respectively. Otherwise the result is zero.



Example:



	CAM 3 IF(SID(R2::CAM3,R2::ISO1,R2::ISO2,R2::ISO3),ISO,IDLE)



The result is CAM 3 ISO if the source CAM3 is selected on any of the destinations ISO1, ISO2, or ISO3 of resource R2, otherwise the result is CAM3 IDLE.

]]>
		</description>
	</function>

	<function>
		<defn name="sl" desc="Returns list of styled names of sources reaching a destination" />
		<parameter name="dest" desc="The destination (R::N[L] format)" />
		<parameter name="style" desc="Style selector value" />
		<parameter name="length" desc="Maximum length of source name" />
		<paremeter name="exp1" desc="The expression/string to be evaluated if source is on-air" />
		<paremeter name="exp2" desc="The expression/string to be evaluated if source is next-to-air" />
		<paremeter name="exp3" desc="The expression/string to be evaluated if source is normal usage" />
		<description>
<![CDATA[

The result is a list of zero or more styled names of sources currently reaching the destination named 'dest' using the style selector 'style', with each source name preceded by one of string 'exp1', 'exp2', or 'exp3', depending on the on-air, next-to-air, or normal usage of the source, respectively.



The function limits the total length of source names (including space separators) to the numeric value of 'length' in characters (partial source names are not listed).



The style selector values are as follows:



Selector	Style



0		primary name

1		secondary name

2		short name

3		long name

A		style A

B		style B



Styles A and B refer to one of the other styles independently for each source and destination. Primary and secondary names refer to the native name within the resource device, which could be a number. Long and short names are user-specified aliases.



Example:



	SL(S1::PGMOUTV,A,26,AC(85),AC(255),AC(170))



The result is a list, in 26 characters or less, of style A source names for sources reaching destination PGMOUTV of resource S1. Each on-air, next-to-air, and other sources appear red, amber, and green, respectively.

]]>
		</description>
	</function>

	<function>
		<defn name="sp" desc="Returns the selected timer/counter digit" />
		<parameter name="type" desc="The digit type to show" />
		<description>
<![CDATA[

The result is a timer/counter digit selected by the parameter 'type' for the most recent AT() function. If none were selected, the result is the empty string. You can use any digit more than once in the same display. The numeric value 'type' selects digits as follows:



Selector	Digit



1		tens of hours

2		units of hours

3		tens of minutes

4		units of minutes

5		tens of seconds

6		units of seconds

7		tens of frames

8		units of frames

9		tens of hours (zero-blanking)

10		units of hours (zero-blanking)

11		tens of minutes (zero-blanking)

12		units of minutes (zero-blanking)

13		tens of seconds (zero-blanking)

14		units of seconds (zero-blanking)

15		tens of frames (zero-blanking)

16		tens of hours (12-hour format)

17		units of hours (12-hour format)

18		upper-case A or P for AM/PM indicator

19		lower-case a or p for am/pm indicator





Example:



	AT(T2)SP(1)SP(2):SP(3)SP(4):SP(5)SP(6).SP(7)SP(8)



The result is the hours, minutes, seconds, and frames for the timer named T2 in HH:MM:SS.FF format.

]]>
		</description>
	</function>

	<function>
		<defn name="spm" desc="Sets system parameter mode and value of a timer/counter" />
		<parameter name="timer" desc="The name of the timer/counter" />
		<parameter name="value" desc="The mode and value to assign" />
		<description>
<![CDATA[

Sets the system parameter mode and value of the timer/counter specified by 'timer' parameter to 'value'.



Example:



	SPM(T1,0215000010100--)



Sets the timer named T1 to follow 2 hours and 15 minutes ahead of local time.

]]>
		</description>
	</function>

	<function>
		<defn name="src" desc="Returns the name of the source reaching the specified destination" />
		<parameter name="dest" desc="The destination (R::N[L] format)" />
		<parameter name="priority" desc="The priority of the source to return" />
		<description>
<![CDATA[

The result is the name of one of the originating sources currently reaching the destination named 'dest'.

The numeric value 'priority' is zero to get highest priority source, 1 for next highest, and so on. If the result is the empty string, there are no more sources reaching that destination.



Example:



	S(SRC(R1::VTR001,0),A)



The result is the style A name of the originating source at the destination VTR001 of resource R1.

]]>
		</description>
	</function>

	<function>
		<defn name="ss" desc="Returns a substring of a specified string" />
		<parameter name="s" desc="The original string" />
		<parameter name="position" desc="The starting position of the substring" />
		<parameter name="length" desc="The number of characters of the substring" />
		<description>
<![CDATA[

The result is the part of string 's' starting from position 'position' and containing up to 'length' characters.

The first position is 1.



Example:



	SV(!X,SS(ADD(V(!X),1000),2,3))



The temporary variable X is padded with leading zeros to make it at least 3 characters long.

]]>
		</description>
	</function>

	<function>
		<defn name="sub" desc="Returns the subtracted value of exp2 from exp1" />
		<parameter name="exp1" desc="The first numeric value" />
		<parameter name="exp2" desc="The second numeric value" />
		<description>
<![CDATA[

The result is the remainder of the subtraction of the numeric value 'exp2' from 'exp1'.



Example:



	SV(!Y,EQ(LEN(SUB(V(!X),1)),LEN(V(!X))))



Set the temporary variable Y to zero if the temporary variable X is a power of 10, otherwise set the temporary variable Y to 1.

]]>
		</description>
	</function>
	
	<function>
		<defn name="sv" desc="Saves a value into a variable" />
		<parameter name="exp1" desc="The name of the variable" />
		<parameter name="exp2" desc="The value to save" />
		<description>
<![CDATA[

If the variable named exp1 already exists, the result of this function is to replace its value with exp2, otherwise the function creates a variable named exp1 and gives it the initial value of exp2. The result is always the empty string.



The first character of exp1 determines the type of variable being set.



If exp1 starts with an exclamation point ! the variable is considered temporary. Its value lasts only until the end of the control text in which it appears.



If exp1 start with an asterisk * the variable is considered private to the display section in which it appears. Its value is not available to other displays.



If exp1 starts with any other character, the variable is considered global to all displays. Do not create or modify global variables within the control text of any display section if its value is to be used by other display sections. Instead, change the value of a global variable from within the Tally Logic > Subroutines table.



Example:



	SV(!X,"SV(!Y,MUL(V(!Y),10))V(!Y)")SV(!Y,1)FN(!X) FN(!X) FN(!X)



The result is 10 100 1000 by using the temporary variable X to repeat a set of operations on the temporary variable Y.

]]>
		</description>
	</function>

	<function>
		<defn name="time" desc="Returns a sample of the hour, minute, second, and frame for a timer" />
		<parameter name="timer" desc="The name of the timer" />
		<description>
<![CDATA[

The result is a sample of the hour, minute, second, and frame adjusted for the timer named 'timer', or the local time (unadjusted) if 'timer' is omitted.



Example:



	SV(!T,SS(TIME(),1,2))



Sets the temporary variable T to the local hour.

]]>
		</description>
	</function>

	<function>
		<defn name="tl" desc="Trims a given string by removing leading spaces" />
		<parameter name="s" desc="The string to trim" />
		<description>
<![CDATA[

The result is string 's' with any leading spaces removed.



Example:



	TL(IF(IV(1)," 1",)IF(IV(2)," 2",)IF(IV(3)," 3",))



The result is a list of only the active GPI inputs 1, 2 and 3, removing first space separator.

]]>
		</description>
	</function>

	<function>
		<defn name="tlya" desc="Determines if a given source appears at one or more destinations" />
		<parameter name="source" desc="The source (R::N[L] format)" />
		<parameter name="tally-area#" desc="The tally area # (1-8)" />
		<parameter name="tally-type#" desc="The tally type # (1-8)" />
		<description>
<![CDATA[

TLYA returns 1 if the given source signal source appears at any of the signal destinations defined by the given tally area and tally type. Tally areas are specified as numbers in the range 1 to 8, and tally types are specified as numbers in the range 1 to 8.


NOTE:

TLYA replaces the PGM and PST functions if Tally Areas are defined in the Tally System Console 2 Tally Areas editor.



Example:



	TLYA(SWR::1,1,1)



Returns 1 if input SWR::1 (input 1 of device SWR) is found to be contributing to a signal destination defined in Tally Type 1 of Tally Area 1.



TLYA(SWR::1,<TA>,<TA.PGM>)



Same effect as the first example. Tally System Console 2 replaces <TA> with the number of the tally area specified for the GPI output or UMD for which the example expression is being programmed. This selection is made in the Tally Area column of the GPI output or UMD programming editor of Tally System Console 2.

Tally System Console 2 replaces <TA.PGM> with the number of the tally type defined with name PGM in the Tally Area editor of Tally System Console 2. The various named tally types are numbered starting from 1 according to their top-to-bottom order in the Tally Area editor.



Typically tally types are PGM (tally type 1), PST (tally type 2), EXT (tally type 3).

]]>
		</description>
	</function>

	<function>
		<defn name="tr" desc="Trims a given string by removing trailing spaces" />
		<parameter name="s" desc="The string to trim" />
		<description>
<![CDATA[

The result is string 's' with any trailing spaces removed.



Example:



	TR(IF(IV(1),"1 ",)IF(IV(2),"2 ",)IF(IV(3),"3 ",))



The result is a list of only the active GPI inputs 1, 2 and 3, removing last space separator.

]]>
		</description>
	</function>

	<function>
		<defn name="tsd" desc="Returns the styled name of the destination" />
		<parameter name="dest" desc="The destination (R::N[L] format)" />
		<parameter name="style" desc="Style selector value" />
		<paremeter name="exp1" desc="The expression/string to be evaluated if source is on-air" />
		<paremeter name="exp2" desc="The expression/string to be evaluated if source is next-to-air" />
		<paremeter name="exp3" desc="The expression/string to be evaluated if source is normal usage" />
		<description>
<![CDATA[

The result is the styled name of the destination named 'dest' using the style selector 'style', preceded by one of string 'exp1', 'exp2', or 'exp3', depending on the on-air, next-to-air, or normal usage of that destination, respectively.



The style selector values are as follows:



Selector	Style



0		primary name

1		secondary name

2		short name

3		long name

A		style A

B		style B



Styles A and B refer to one of the other styles independently for each source and destination. Primary and secondary names refer to the native name within the resource device, which could be a number. Long and short names are user-specified aliases.



Example:



	TSD(R1::AUX001[1],3,AC(85),AC(255),AC(0))



The result is the long name for the destination AUX001, level 1, of resource R1. The name appears red, amber, or blank if the destination is on-air, next-to-air, or neither, respectively.

]]>
		</description>
	</function>

	<function>
		<defn name="tsda" desc="Determines if a source on given destination should be tallied" />
		<parameter name="dest" desc="The destination (R::N[L] format)" />
		<parameter name="style" desc="Style selector value" />
		<parameter name="tally-area#" desc="The tally area # (1-8)" />
		<paremeter name="exp1" desc="The non-tallied expression/string to be evaluated" />
		<paremeter name="exp2" desc="Tally type 1 expression/string to be evaluated" />
		<paremeter name="exp3" desc="Tally type 2 expression/string to be evaluated" />
		<paremeter name="..." desc="Tally type n expression/string to be evaluated" />
		<description>
<![CDATA[

Similar to TSD function, but checks up to 8 tally types in the given tally area to determine if the source on the given destination should be tallied.



The style selector values are as follows:



Selector	Style



0		primary name

1		secondary name

2		short name

3		long name

A		style A

B		style B



Styles A and B refer to one of the other styles independently for each source and destination. Primary and secondary names refer to the native name within the resource device, which could be a number. Long and short names are user-specified aliases.



Example:



	TSDA(RTR::MON1,A,<%TA>,ac(NML),ac(PGM),ac(EXT),ac(PST))



The above example displays the name of the given destination in Style A.

Text is shown with the AC(NML) color if the source selected by the given destination is not contributing to any program (on air), preset (next to air) or external destination.

Text is shown with the Tally Type 1 (AC(PGM)) color if the source selected by the given destination is contributing to a program (on air) destination.

Text is shown with the Tally Type 2 (AC(EXT)) color if the source selected by the given destination is contributing to a preset (next to air) destination.

Text is shown with the Tally Type 3 (AC(PST)) color if the source selected by the given destination is contributing to a external destination (typically a program bus in another control room).

Depending on the the type of UMD the AC() commands  NML, PGM, EXT, PST will typically generate white, red, amber, and green colours respectively.



The priority of Tally Types in the above example, have a descending order of priority:

Tally Type 1 (AC(PGM))

Tally Type 2 (AC(EXT))

Tally Type 3 (AC(PST))

Non-tallied expression (AC(NML)).



Because of the above priority rules, if Tally Type 1 and Tally Type 2 are both active, then the Tally Type 1 colour code (AC(PGM)) is shown.


In Tally System Console 2 <%TA> evaluates to a value of 1 through 8, depending on the UMDs > Display Devices > Tally Area column setting for the UMD programmed with this string.

]]>
		</description>
	</function>

	<function>
		<defn name="tss" desc="Returns the styled name of the source" />
		<parameter name="source" desc="The source (R::N[L] format)" />
		<parameter name="style" desc="Style selector value" />
		<paremeter name="exp1" desc="The expression/string to be evaluated if source is on-air" />
		<paremeter name="exp2" desc="The expression/string to be evaluated if source is next-to-air" />
		<paremeter name="exp3" desc="The expression/string to be evaluated if source is normal usage" />
		<description>
<![CDATA[

The result is the styled name of the source named 'source' using the style selector 'style', preceded by one of string 'exp1', 'exp2', or 'exp3', depending on the on-air, next-to-air, or normal usage of that destination, respectively.



The style selector values are as follows:



Selector	Style



0		primary name

1		secondary name

2		short name

3		long name

A		style A

B		style B



Styles A and B refer to one of the other styles independently for each source and destination. Primary and secondary names refer to the native name within the resource device, which could be a number. Long and short names are user-specified aliases.



Example:



	TSS(R1::CAM5,A,AC(85),AC(255),AC(170))



The result is the style A name for the source CAM5 of resource R1. The name appears red, amber.

]]>
		</description>
	</function>

	<function>
		<defn name="tssa" desc="Determines if a given source should be tallied" />
		<parameter name="source" desc="The source (R::N[L] format)" />
		<parameter name="style" desc="Style selector value" />
		<parameter name="tally-area#" desc="The tally area # (1-8)" />
		<paremeter name="exp1" desc="The non-tallied expression/string to be evaluated" />
		<paremeter name="exp2" desc="Tally type 1 expression/string to be evaluated" />
		<paremeter name="exp3" desc="Tally type 2 expression/string to be evaluated" />
		<paremeter name="..." desc="Tally type n expression/string to be evaluated" />
		<description>
<![CDATA[

Similar to TSS function, but checks up to 8 tally types in the given tally area to determine if the given source should be tallied.



The style selector values are as follows:



Selector	Style



0		primary name

1		secondary name

2		short name

3		long name

A		style A

B		style B



Styles A and B refer to one of the other styles independently for each source and destination. Primary and secondary names refer to the native name within the resource device, which could be a number. Long and short names are user-specified aliases.



Example:



	TSSA(RTR::MON1,A,<%TA>,ac(NML),ac(PGM),ac(EXT),ac(PST))



The above example displays the name of the given destination in Style A.

Text is shown with the AC(NML) color if the selected source is not contributing to any program (on air), preset (next to air) or external destination.

Text is shown with the Tally Type 1 (AC(PGM)) color if the selected source is contributing to a program (on air) destination.

Text is shown with the Tally Type 2 (AC(EXT)) color if the selected source is contributing to a preset (next to air) destination.

Text is shown with the Tally Type 3 (AC(PST)) color if the selected source is contributing to a external destination (typically a program bus in another control room).

Depending on the the type of UMD the AC() commands  NML, PGM, EXT, PST will typically generate white, red, amber, and green colours respectively.



The priority of Tally Types in the above example, have a descending order of priority:

Tally Type 1 (AC(PGM))

Tally Type 2 (AC(EXT))

Tally Type 3 (AC(PST))

Non-tallied expression (AC(NML)).



Because of the above priority rules, if Tally Type 1 and Tally Type 2 are both active, then the Tally Type 1 colour code (AC(PGM)) is shown.


In Tally System Console 2 <%TA> evaluates to a value of 1 through 8, depending on the UMDs > Display Devices > Tally Area column setting for the UMD programmed with this string.

]]>
		</description>
	</function>
	
	<function>
		<defn name="tsx" desc="Shows styled source name reaching a destination" />
		<parameter name="dest" desc="The destination (R::N[L] format)" />
		<parameter name="style" desc="Style selector value" />
		<parameter name="exp1" desc="The expression shown preceding source name if on-air" />
		<parameter name="exp2" desc="The expression shown preceding source name if next-to-air" />
		<parameter name="exp3" desc="The expression shown preceding source name if non-tallied" />
		<description>
<![CDATA[

The result is the styled name of the source currently reaching the destination named 'dest' using the style selector 'style', preceded by one of string exp1, exp2, or exp3, depending on the on-air, next-to-air, or normal usage of that source, respectively. The format of 'dest' and 'style' is described with S function.



The value of 'style' is a style selector value as follows:



0	primary name

1	secondary name

2	short name

3	long name

A	style A

B	style B



Example:



	TSX(R2::004[2],A,AC(85),AC(255),AC(170))



The result is the style A name for the source 004, level 2, of resource R2. The name appears red, amber, or green if the source is on-air, next-to-air, or neither, respectively.

]]>
		</description>
	</function>

	<function>
		<defn name="tsxa" desc="Shows styled source name reaching a destination for a tally area" />
		<parameter name="dest" desc="The destination (R::N[L] format)" />
		<parameter name="style" desc="Style selector value" />
		<parameter name="tally-area#" desc="The tally area number containing the destination(s) [1-8]" />
		<parameter name="exp1" desc="The expression shown preceding source name if non-tallied" />
		<parameter name="exp2" desc="The expression shown preceding source name for tally type 0" />
		<parameter name="exp3" desc="The expression shown preceding source name for tally type 1" />
		<parameter name="..." desc="The expression shown preceding source name for tally type n" />
		<description>
<![CDATA[

Similar to TSX function, but checks up to 16 tally types in the given tally area to determine if the source on the given destination should be tallied.



The value of 'style' is a style selector value as follows:



0	primary name

1	secondary name

2	short name

3	long name

A	style A

B	style B



Example:



	TSXA(RTR::MON1,A,<%TA>,ac(NML),ac(PGM),ac(EXT),ac(PST))



The above example displays the name of the source selected by given the given router or switcher destination, in Style A.

Text is shown with the AC(NML) color if the source selected by the given destination is not contributing to any program (on air), preset (next to air) or external destination.

Text is shown with the Tally Type 1 (AC(PGM)) color if the source selected by the given destination is contributing to a program (on air) destination.

Text is shown with the Tally Type 2 (AC(EXT)) color if the source selected by the given destination is contributing to a preset (next to air) destination.

Text is shown with the Tally Type 3 (AC(PST)) color if the source selected by the given destination is contributing to a external destination (typically a program bus in another control room).

Depending on the the type of UMD the AC() commands  NML, PGM, EXT, PST will typically generate white, red, amber, and green colours respectively.



The priority of Tally Types in the above example, have a descending order of priority: 

	Tally Type 1 		(AC(PGM))

	Tally Type 2 		(AC(EXT))

	Tally Type 3 		(AC(PST))

	Non-tallied expression 	(AC(NML)).



Because of the above priority rules, if Tally Type 1 and Tally Type 2 are both active, then the Tally Type 1 colour code (AC(PGM)) is shown.



In Tally System Console 2, <%TA> evaluates to a value of 1 through 8, depending on the UMDs>Display Devices>Tally Area column setting for the UMD programmed with this string.

]]>
		</description>
	</function>

	<function>
		<defn name="uc" desc="Converts lower case letters to upper case" />
		<parameter name="exp" desc="The expression to convert" />
		<description>
<![CDATA[

Any lower case letters in 'exp' are converted to upper case in the result.



Example:



	UC(SS(V(!X),1,1))LC(SS(V(!X),2,50))



Returns a string where the first character stored in temporary variable X is upper case and the remaining characters are lower case.

]]>
		</description>
	</function>

	<function>
		<defn name="us" desc="Returns the number of dots in the width of display section" />
		<description>
<![CDATA[

The result is the number of dots there are in the width of the display section that is accessing this function.



Example:



	SV(!X,DIV(US(),6))



Sets the temporary variable X to the number of fixed spacing characters that fit in the display section.

]]>
		</description>
	</function>

	<function>
		<defn name="v" desc="Returns the value of a variable" />
		<parameter name="exp1" desc="The name of the variable" />
		<description>
<![CDATA[

The result is the contents of the variable named exp1. The contents are not re-evaluated. Use the FN() function to evaluate the contents of a variable. If the variable does not exist, the result is the empty string.



The first character of exp1 determines the type of variable. Variable types are described with the SV() function.



Example:



	SV(!X,:)AT(T1)SP(1)SP(2)V(!X)SP(3)SP(4)V(!X)SP(5)SP(6)



Using the temporary variable X to specify the separator as a colon, the result is the hours, minutes, seconds for the timer named T1 in HH:MM:SS format.

]]>
		</description>
	</function>

	<function>
		<defn name="val" desc="Returns the numeric ASCII value of the first character in specified string" />
		<parameter name="s" desc="The string" />
		<description>
<![CDATA[

The result is the numeric ASCII value of the first character of the string 's'.



Example:



	IF(LT(VAL(UC(V(!X))),VAL(N)),A-M,N-Z)



The result is A-M if the first character of temporary variable X has a value less than that of the letter N, otherwise the result is N-Z.

]]>
		</description>
	</function>

	<function>
		<defn name="xor" desc="Return 0 if exp1 and exp2 are not zero, or both are zero.  1 otherwise." />
		<parameter name="exp1" desc="The first condition or expression to evaluate" />
		<parameter name="exp2" desc="The second condition or expression to evaluate" />
		<description>
<![CDATA[

If both exp1 and exp2 are not zero, or both exp1 and exp2 are zero, the result is zero, otherwise the result is 1.



Example:



	SV(!Z,XOR(V(!X),V(!Y)))



If the temporary variable X is not zero and the temporary variable Y is zero, or the temporary variable X is zero and the temporary variable Y is not zero, set the value of temporary variable Z to 1, otherwise set the value of temporary variable Z to zero.

]]>
		</description>
	</function>

	<function>
		<defn name="xpt" desc="Returns the name of the source reaching a destination" />
		<parameter name="dest" desc="The destination (R::N[L] format)" />
		<description>
<![CDATA[

The result is the name of the source currently reaching the destination exp1. The format of exp1 is R::N[L], where R is the resource device name, N is the destination name, and L is the optional level indicator. N and L are dependent on the type of resource device.



Use this function instead of the SRCEFDescSRC function when you are interested in the closest but not necessarily originating source for a destination.



Example:



	S(XPT(R1::VTR001),2)



The result is the short name for the source reaching the destination VTR001 of resource R1.

]]>
		</description>
	</function>

</FunctionDefinitions>
