EasyManuals Logo

Campbell CR1000 User Manual

Campbell CR1000
678 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #255 background imageLoading...
Page #255 background image
Section 7. Installation
CRBasic Example 53. Receiving an RS-232 String
'This program example demonstrates CR1000 serial I/O features by:
' 1. Simulating a serial sensor
' 2. Transmitting a serial string via COM1 TX.
'The serial string is received at COM2 RX via jumper wire. Simulated
'air temperature = 27.435 F, relative humidity = 56.789 %.
'Wiring:
'COM1 TX (C1) ----- COM2 RX (C4)
'Serial Out Declarations
Public TempOut As Float
Public RhOut As Float
'Declare a string variable large enough to hold the output string.
Public SerialOutString As String * 25
'Serial In Declarations
'Declare a string variable large enough to hold the input string
Public SerialInString As String * 25
'Declare strings to accept parsed data. If parsed data are strictly numeric, this
'array can be declared as Float or Long
Public InStringSplit(2) As String
Alias InStringSplit(1) = TempIn
Alias InStringSplit(2) = RhIn
'Main Program
BeginProg
'Simulate temperature and RH sensor
TempOut = 27.435 'Set simulated temperature to transmit
RhOut = 56.789 'Set simulated relative humidity to transmit
Scan(5,Sec, 3, 0)
'Serial Out Code
'Transmits string "*27.435,56.789#" out COM1
SerialOpen(Com1,9600,0,0,10000) 'Open a serial port
'Build the output string
SerialOutString = "*" & TempOut & "," & RhOut & "#"
'Output string via the serial port
SerialOut(Com1,SerialOutString,"",0,100)
'Serial In Code
'Receives string "27.435,56.789" via COM2
'Uses * and # character as filters
SerialOpen(Com2,9600,0,0,10000) 'Open a serial port
255

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Campbell CR1000 and is the answer not in the manual?

Campbell CR1000 Specifications

General IconGeneral
Power Requirements9.6 to 16 VDC
Data Logger Operating SystemCRBasic
Memory4 MB
Analog Inputs16 single-ended or 8 differential
Analog Input Resolution13 bits
Analog Input Range+/-2.5V
Digital I/O8
Pulse Counters2
Communication PortsRS-232
Operating Temperature-25°C to +50°C
Pulse Channels4

Related product manuals