04.01.2015 Views

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Section 7. Installation<br />

Scan(5,Sec, 3, 0)<br />

'Serial Out Code<br />

'Transmits string "*27.435,56.789#" out COM1<br />

SerialOpen(Com1,9600,0,0,10000)<br />

'Build the output string<br />

SerialOutString = "*" & TempOut & "," & RhOut & "#"<br />

'Output string via the serial port<br />

SerialOut(Com1,SerialOutString,"",0,100)<br />

'Open a serial port<br />

'Serial In Code<br />

'Receives string "27.435,56.789" via COM2<br />

'Uses * and # character as filters<br />

SerialOpen(Com2,9600,0,0,10000)<br />

'Open a serial port<br />

'Receive serial data as a string<br />

'42 is ASCII code for "*", 35 is code for "#"<br />

SerialInRecord(Com2,SerialInString,42,0,35,"",01)<br />

'Parse the serial string<br />

SplitStr(InStringSplit(),SerialInString,"",2,0)<br />

NextScan<br />

EndProg<br />

7.8.8.6 Testing Applications<br />

7.8.8.6.1 Configure HyperTerminal<br />

A common problem when developing a serial I/O application is the lack of an<br />

immediately available serial device with which to develop and test programs.<br />

Using HyperTerminal, a developer can simulate the output of a serial device or<br />

capture serial input.<br />

Note HyperTerminal is provided as a utility with Windows XP and earlier<br />

versions of Windows. HyperTerminal is not provided with later versions of<br />

Windows. HyperTerminal automatically converts binary data to ASCII on the<br />

screen. Binary data can be captured, saved to a file, and then viewed with a<br />

hexadecimal editor. Other terminal emulators are available from third-party<br />

vendors that facilitate capture of binary or hexadecimal data.<br />

Create a HyperTerminal instance file by clicking Start | All Programs |<br />

Accessories | Communications | HyperTerminal. The windows in the figures<br />

HyperTerminal Connection Description (p. 212) through HyperTerminal ASCII<br />

Setup (p. 213) are presented. Enter an instance name and click OK.<br />

211

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!