Campbell Scientific CR6 CR6 Measurement and Control System - Page 138
Table 19., Data Types in Variable Memory
View all Campbell Scientific CR6 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 138 highlights
Section 7. Installation Table 19. Data Types in Variable Memory Name Command Description Word Size (Bytes) Notes Resolution / Range Long As Long Signed integer Use to store count data in the range of ±2,147,483,648 Speed: integer math is faster than floating point math. Resolution: 32 bits. Compare to 24 4 bits in IEEE4. -2,147,483,648 to +2,147,483,647 Suitable for storing whole numbers, counting number, and integers in final-data memory. If storing nonintegers, the fractional portion of the value is lost. Boolean As Boolean Signed integer Use to store true or false states, such as states of flags and control ports. 0 4 is always false. -1 is always true. Depending on the application, any other number may be interpreted as True = -1 or any number ≥ 1 False = any number ≥ 0 and < 1 true or false. See the section True = - 1, False = 0 (p. 164). String As String ASCII string Minimum: 3 (4 with null terminator) Default: 24 Maximum: limited only to the size of available CR6 memory. Caution - when using a very long string in a variables declared as Public, the operations of datalogger support software (p. 604) will frequently transmit the entire string over the communication link. If communication bandwidth is limited, or if communication is paid for by they byte, declaring the variable as Dim may be preferred. String size is defined by the CR6 operating system and CRBasic program. When converting from STRING to FLOAT, numerics at the beginning of a string convert, but conversion stops when a non-numeric is encountered. If the string begins with a non-numeric, the FLOAT will be NAN. If the string contains multiple numeric values separated by nonnumeric characters, the SplitStr() instruction can be used to parse out the numeric values. See the sections String Operations (p. 284) and Serial I/O (p. 248). Unless declared otherwise, string size is 24 bytes or characters. String size is allocated in multiples of four bytes; for example, String * 25, String * 26, String * 27, and String * 28 allocate 28 bytes (27 usable). Minimum string size is 4 (3 usable). See CRBasic Editor Help for more information. Maximum length is limited only by available CR6 memory. 138