Campbell Scientific CR3000 CR3000 Micrologger - Page 125
CRBasic Example 9., Data Type Declarations
View all Campbell Scientific CR3000 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 125 highlights
Section 7. Installation Table 12. Data Types Name: Command or Argument Description / Word Size As Boolean BOOLEAN Signed Integer / 4 byte BOOL8 NSEC Integer / 1 byte Time Stamp / 8 byte As String STRING ASCII String / word size varies Where Used Notes Resolution / Range Dim & Public variables Final data storage Final data storage Final data storage Dim & Public variables Final data storage Use to store TRUE or FALSE states, such as with flags and control ports. 0 is always false. -1 is always true. Depending on the application, any other number may be interpreted as true or 0, -1 false. See True = -1, False = 0 (p. 150).To save memory, consider using UINT2 or BOOL8. 8 bits (0 or 1) of information. Uses less space than 32-bit BOOLEAN. Holding the same information in BOOLEAN will 0, -1 require 256 bits. See Bool8 Data Type (p. 232). Divided up as four bytes of seconds since 1990 and four bytes of nanoseconds into the second. Used to record and process time data. See NSEC Data Type (p. 228). 1 nanosecond Size is defined by the CR3000 operating system. 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 non-numeric characters, SplitStr() can be used to parse out the numeric values. See String Operations (p. 241) and Serial I/O (p. 205). Unless declared otherwise, the minimum string size is 16 bytes or characters. Size above 16 bytes increases in multiples of four bytes; for example, String * 18 allocates 20 bytes (19 usable). CRBasic Example 9. Data Type Declarations 'Float Variable Examples Public Z Public X As Float 'Long Variable Example Public CR3000Time As Long Public PosCounter As Long Public PosNegCounter As Long Boolean Variable Examples Public Switches(8) As Boolean Public FLAGS(16) As Boolean 'String Variable Example Public FirstName As String * 16 'allows a string up to 16 characters long 125