Campbell-scientific CR3000 Micrologger Uživatelský manuál Strana 212

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 590
  • Tabulka s obsahem
  • ŘEŠENÍ PROBLÉMŮ
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 211
Section 7. Installation
212
Does the record have a delimiter character, e.g. ",", spaces, or tabs? These
delimiters are useful for parsing the record into usable numbers.
Will the sensor be sending multiple data strings? Multiple strings usually
require filtering before parsing.
How fast will data be sent to the CR3000?
Is power consumption critical?
Does the sensor compute a checksum? Which type? A checksum is useful to
test for data corruption.
2. Open a serial port (SerialOpen() instruction).
Example:
SerialOpen(Com1,9600,0,0,10000)
Designate the correct port in CRBasic.
Correctly wire the device to the CR3000.
Match the port's baud rate to the baud rate of the device in CRBasic.
o Use a fixed baud rate (rather than autobaud) when possible.
3. Receive serial data as a string (CRBasic SerialIn() or SerialInRecord()
command).
Example:
SerialInRecord(Com2,SerialInString,42,0,35,"",01)
Declare the string variable large enough to accept the string.
o Example:
Public SerialInString As String * 25
Observe the input string in the input string variable in software numeric
monitor.
Note SerialIn() and SerialInRecord() receive the same data. SerialInRecord()
is generally used for data streaming into the CR3000, while SerialIn() is used for
data that is received in discrete blocks.
4. Parse (split up) the serial string (CRBasic SplitStr() command).
Separates string into numeric and / or string variables.
Example:
SplitStr(InStringSplit,SerialInString,"",2,0)
Declare an array to accept the parsed data.
o Example:
Public InStringSplit(2) As String
o Example:
Public SplitResult(2) As Float
Zobrazit stránku 211
1 2 ... 207 208 209 210 211 212 213 214 215 216 217 ... 589 590

Komentáře k této Příručce

Žádné komentáře