ck colors4 ready p Pid; hello bitmap screen (3, 3) 'Need to get p' red TO p Figure 2.23 Output to a Pid 2.3.11 Decision A decision is used to branch according to the value of an expression. In Figure 2.24, the decision tests the value of n: if n > 3, then the left branch is executed, else the right branch. 2.3.12 Timers In SDL, the expression NOW contains the current value of the global time. Figure 2.25 shows an example of a timer used to monitor a response. First, the timer T201 is declared (right part). Then after output IAM, T201 is started using SET: timer T201 will time out at NOW+15.0. 20 Validation of Communications Systems with SDL process DLC ( 3 ) SABME n:= n + 1 waitUA Figure 2.24 Decision example block SS7 process OLE TIMER T201; wait4ACM SET (NOW + 15.0, SIGNAL RESET(T201) retry T201) IAM, ACM; wait4ACM ready Figure 2.25 Timer example From state wait4ACM, we either input the response to IAM, ACM, and we stop the timer using RESET, or we input the timer signal T201 because ACM arrived more than 15.0 time units after SET. 2.4 DATA TYPES 2.4.1 Predefined data Predefined data types in SDL are Boolean: True, False Character: 'A', '8', etc. String: generic string (not only a string of characters) Charstring: 'Example of charstring' Integer: -45, 0, 36700, etc. Natural: null or positive Integer Real: 23.5 etc. Array: generic array Powerset: generic set to identify process instances Duration, Time: used in timers. Quick Tutorial on SDL 21 2.4.2 Array The Array generator is used to create arrays containing any element type and indexed by any type2. Example: /* An array of 5 Integers: * / NEWTYPE intTable Array (itIndex, Integer) ENDNEWTYPE; SYNTYPE itIndex = Integer CONSTANTS 0 : 4 ENDSYNTYPE; DCL t intTable, X Integer; TASK t:= (. 13 .) ; /* puts 13 into the 5 array elements. * / TASK t (2) : = 127; TASK X:= t (4) i 2.4.3 Synonym and syntype Synonyms are used to define constants. Example: SYNONYM maxCount Natural = 127; SYNONYM Yes Boolean = True; SYNONYM No Boolean = False; Syntypes are often used to defin