Galil DMC-2X00 user manual Response from command MG len6 S4

Models: DMC-2X00

1 267
Download 267 pages 56.53 Kb
Page 153
Image 153

flen=$10000* flen

len1=( flen &$00FF)

len2=( flen &$FF00)/$100 len3= len &$000000FF len4=( len &$0000FF00)/$100 len5=( len &$00FF0000)/$10000 len6=( len &$FF000000)/$1000000 MG len6 {S4}

MG len5 {S4} MG len4 {S4} MG len3 {S4} MG len2 {S4} MG len1 {S4}

EN

Shift flen by 32 bits (IE - convert fraction, flen, to integer)

Mask top byte of flen and set this value to variable ‘len1’

Let variable, ‘len2’ = top byte of flen Let variable, ‘len3’ = bottom byte of len Let variable, ‘len4’ = second byte of len Let variable, ‘len5’ = third byte of len Let variable, ‘len6’ = fourth byte of len Display ‘len6’ as string message of up to 4 chars Display ‘len5’ as string message of up to 4 chars Display ‘len4’ as string message of up to 4 chars Display ‘len3’ as string message of up to 4 chars Display ‘len2’ as string message of up to 4 chars Display ‘len1’ as string message of up to 4 chars

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 Messages.

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}

98 Chapter 7 Application Programming

DMC-2X00

Page 153
Image 153
Galil DMC-2X00 user manual Response from command MG len6 S4