USB host (USB: drive)

USB host provides portable data storage on a USB thumb drive. A FAT32-formatted USB thumb drive can be inserted into the host port and will show up as a drive (USB:) in file-related operations. Measurement data is stored on USB: as discrete files by using the TableFile() instruction. Files on USB: can be collected by inserting the thumb drive into a computer and copying the files.

USB: can be used in all CRBasic file-access-related instructions. Because of data reliability concerns in non-industrial rated drives, this drive is not intended for long-term unattended data storage. Rather, configure Tablefile() for milking (plug-and-pull) to periodically collect data. Files on USB: are not affected by program recompilation or formatting of other drives.

See the CRBasic Editor help for detailed instruction information and program examples:

https://help.campbellsci.com/crbasic/granite6/

USB host precautions

Observe the following precaution when using an optional USB thumb drive:

  • Do not remove a USB drive while the drive is active, or data corruption and damage to the USB drive may result. Many USB thumb drives have built-in LEDs to indicate when they are active.

Data type collection speed

File type declared in the Tablefile() TFOption parameter can affect plug and pull data-collection speed. Data is buffered in the data logger as binary. While data is collected, the data logger converts the binary data to the declared data type. TOB1 options are binary and require very little processor overhead to convert from the binary buffer. TOA5, CSIXML, and JSON are ASCII options and are much slower since they consume significant processor overhead to convert to ASCII from the binary buffer. CSIXML is especially slow. The effects on collection time will be particularly noticeable if the data logger is running a long or complex program. In short, if large files need collection, using the TOB1 format may save considerable time. Consult the Loggernet manual for options available to convert TOB1 data files on the computer to easier-to-read formats.

Skipped scans

Compile data logger programs in Closedpipeline mode A CRBasic program execution mode wherein instructions are evaluated in groups of like instructions, with a set group prioritization. when possible. Data logger programs compiled in Closedsequential mode A CRBasic program execution mode wherein each statement is evaluated in the order it is listed in the program. require a longer scan interval than programs compiled in pipeline mode to avoid skipped scans. In pipeline mode, increase the Scan() / NextScan BufferOption parameter to prevent skipped scans.

Formatting drives 32 GB or larger

Windows does not support creating a FAT32 partition on a 32 GB or greater drive. The work-around is to use a Windows computer to format the drive as NTFS (NT file system). Then use the data logger to format the drive as FAT32.