Download D4110 User`s Manual
Transcript
SECTION 5 PROGRAMMING REFERENCE ________________________________________________________________________________ 5.2.4 sfunc04:ASCII string load command System function 04 is used to convert the characters in an ASCII string to their equivalent ASCII codes and store these codes in consecutive byte addresses in variable memory (Bxxx variables) or external non-volatile memory (addresses 1900H-1fefH). System function 04 is typically used in conjunction with the display sfunc18 write (update) system function to write ASCII strings to the display. General form: sfunc04(dest,"string"); Parameters: dest = The address where the first ASCII character of the string will be stored. The remaining ASCII characters will be stored in consecutive byte addresses following the first byte address. Variable types: 'B' or constant 1900-ffffH. string = The string is from one to 60 printable characters. These characters will be converted to their equivalent ASCII codes and stored in consecutive byte addresses starting at the dest byte address. Note: The string must be enclosed with double quotes as shown (these double quotes are not stored as part of the string, but are simply used as delimiters for the string). Any printable character can be incorporated in the string with the exception of the double quote " or back slash \. If these two characters are to be incorporated in the string, they must be preceded with the back slash (i.e. \" will incorporate the " only and \\ will incorporate just one \). Return Value: none Type: suspended Valid Files: Initialization, Main Program, Timed Interrupt and user functions Examples 1) sfunc04 (B100, "example #1"); The above example will load the following byte addresses with the corresponding ASCII codes (numbers): B100 = 101 B101 = 120 B102 = 97 B103 = 109 B104 = 112 B105 = 108 B106 = 101 B107 = 32 B108 = 35 B109 = 49 (101 = ASCII code for 'e') (120 = ASCII code for 'x') (97 = ASCII code for 'a') (109 = ASCII code for 'm') (112 = ASCII code for 'p') (108 = ASCII code for 'l') (101 = ASCII code for 'e') (32 = ASCII code for space) (35 = ASCII code for '#') (49 = ASCII code for '1') D4110 User’s Manual SYSTEMS Electronics Group - 26 -