EasyManuals Logo

Campbell CR850 User Manual

Campbell CR850
566 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 #222 background imageLoading...
Page #222 background image
Section 7. Installation
222
then
TempData(1,1,2) = "TOP", TempData(1,1,3) = "OP", _
TempData(1,1,1) = "STOP"
To handle single-character manipulations, declare the string with a size of 1. That
single-character string can be used to search for specific characters. In the
following example, the first character of a larger string is determined:
Public TempData As String * 1
TempData = LargerString
If TempData = "S" Then
A single character can be retrieved from any position in a string using the third
dimension. To retrieve the fifth character of a larger string, follow this example:
Public TempData As String * 1
TempData = LargerString(1,1,5)
Q: How can I get SerialIn(), SerialInBlock(), and SerialInRecord() to read
extended characters?
A: Open the port in binary mode (mode 3) instead of PakBus-enabled mode
(mode 0).
Q: Tests with an oscilloscope showed the sensor was responding quickly, but the
data were getting held up in the internals of the CR800 somewhere for 30 ms or
so. Characters at the start of a response from a sensor, which come out in 5 ms,
were apparently not accessible by the program for 30 ms or so; in fact, no data
were in the serial buffer for 30 ms or so.
A: As a result of internal buffering in the CR800 and / or external interfaces, data
may not appear in the serial port buffer for a period ranging up to 50 ms
(depending on the serial port being used). This should be kept in mind when
setting timeouts for the SerialIn() and SerialOut() instructions, or user-defined
timeouts in constructs using the SerialInChk() instruction.
Q: What are the termination conditions that will stop incoming data from being
stored?
A: Termination conditions:
TerminationChar argument is received
MaxNumChars argument is met
TimeOut argument is exceeded
SerialIn() does NOT stop storing when a Null character (&h00) is received
(unless a NULL character is specified as the termination character). As a string
variable, a NULL character received will terminate the string, but nevertheless
characters after a NULL character will continue to be received into the variable
space until one of the termination conditions is met. These characters can later be
accessed with MoveBytes() if necessary.
Q: How can a variable populated by SerialIn() be used in more than one
sequence and still avoid using the variable in other sequences when it contains old
data?

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

Campbell CR850 Specifications

General IconGeneral
BrandCampbell
ModelCR850
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals