36
•
Chapter 7 Application Programming
CDS-3310
‘len1’
len2=( flen &$FF00)/$100
Let variable, ‘len2’ = top byte of flen
len3= len &$000000FF
Let variable, ‘len3’ = bottom byte of len
len4=( len &$0000FF00)/$100
Let variable, ‘len4’ = second byte of len
len5=( len &$00FF0000)/$10000
Let variable, ‘len5’ = third byte of len
len6=( len &$FF000000)/$1000000
Let variable, ‘len6’ = fourth byte of len
MG len6 {S4}
Display ‘len6’ as string message of up to 4 chars
MG len5 {S4}
Display ‘len5’ as string message of up to 4 chars
MG len4 {S4}
Display ‘len4’ as string message of up to 4 chars
MG len3 {S4}
Display ‘len3’ as string message of up to 4 chars
MG len2 {S4}
Display ‘len2’ as string message of up to 4 chars
MG len1 {S4}
Display ‘len1’ as string message of up to 4 chars
EN
This program will accept a string input of up to 6 characters, parse each character, and then display
each character. Notice also that the values used for masking are represented in hexadecimal (as
denoted by the preceding ‘$’). For more information, see section
Sending Message
s
.
To illustrate further, if the user types in the string “TESTME” at the input prompt, the controller will
respond with the following:
T
Response from command MG len6 {S4}
E
Response from command MG len5 {S4}
S
Response from command MG len4 {S4}
T
Response from command MG len3 {S4}
M
Response from command MG len2 {S4}
E
Response from command MG len1 {S4}
Functions
FUNCTION DESCRIPTION
@SIN[n]
Sine of n (n in degrees, with range of -32768 to 32767 and 16-bit fractional resolution)
@COS[n]
Cosine of n (n in degrees, with range of -32768 to 32767 and 16-bit fractional resolution)
@TAN[n]
Tangent of n (n in degrees, with range of -32768 to 32767 and 16-bit fractional resolution)
@ASIN*[n]
Arc Sine of n, between -90
°
and +90
°
. Angle resolution in 1/64000 degrees.
@ACOS* [n}
Arc Cosine of n, between 0 and 180
°
. Angle resolution in 1/64000 degrees.
@ATAN* [n]
Arc Tangent of n, between -90
°
and +90
°
. Angle resolution in 1/64000 degrees
@COM[n]
One’s Complement of n
@ABS[n]
Absolute value of n
@FRAC[n]
Fraction portion of n
@INT[n]
Integer portion of n
@RND[n]
Round of n (Rounds up if the fractional part of n is .5 or greater)
@SQR[n]
Square root of n (Accuracy is +/-.0001)
@IN[n]
Return digital input at general input n (where n starts at 1)
@OUT[n]
Return digital output at general output n (where n starts at 1)
Summary of Contents for CDS-3310
Page 26: ...18 i Chapter 2 Getting Started CDS 3310 THIS PAGE LEFT PLANK INTENTIONALLY...
Page 32: ...24 i Chapter 3 Connecting I O CDS 3310 THIS PAGE LEFT PLANK INTENTIONALLY...
Page 124: ...CDS 3310 Chapter 8 Hardware Software Protection i 63 THIS PAGE LEFT PLANK INTENTIONALLY...
Page 138: ...CDS 3310 Chapter 10 Theory of Operation i 77 THIS PAGE LEFT BLANK INTENTIONALLY...