Omega Speaker Systems VR200 instruction manual Program Examples, Environment

Page 36

7.1 Program to Read Parameter Setting from VR200, Display Them on Screen and Write Them to Disk

Chapter 7 PROGRAM EXAMPLES

Examples of application programs for an IBM PC are shown below.

Environment

Computer used: IBM PC

Mode:

Character length = 8 bits, parity = none, stop bit = 1, baud rate =

 

1200 bps

Handshake:

None

The file name used for writing to and reading from the floppy disk is TEST.DAT.

7.1Program to Read Parameter Settings from VR200, Display Them on Screen and Write Them to Disk

100

‘************************************************************

110

‘**

RS422A Example Program for IBM PC

**

120

‘**

 

**

130

‘**

To input and save parameter settings

**

140

‘**

 

**

150‘************************************************************

160‘**

170

‘**

Baud rate: 1200

Stop bit: 1 bit

180

‘**

Parity: none

Control: OFF/OFF

190

‘**

Data length: 8 bits

Others: LF is sent automatically.

200‘**

210

220OPEN “COM1:1200,N,8,1,LF” AS #1

230OPEN “TEST.DAT” FOR OUTPUT AS #2

240

250 LF$=CHR$(&HA)

:’ Line feed = 0AH

260PRINT #1,CHR$(27)+”O 01"

270PRINT #1,”TS1"

280PRINT #1,CHR$(27)+”T”;

290PRINT #1,”LF01,04"

300LINE INPUT #1,D$

310IF LEFT$(D$,1)=LF$ THEN D$=MID$(D$,2) :’ Remove “LF” of head string

320PRINT D$

330PRINT #2,D$

340IF LEFT$(D$,2)<>”EN” THEN GOTO 300

350

360PRINT #1,CHR$(27)+”C 01"

370CLOSE

380END

7 PROGRAM EXAMPLES

7 - 1

Image 36
Contents User’sGuide Servicing North America Preface TrademarksContents Time Chart Initial Status Errors During RS-422-A Output Transmitting FunctionsProgram Examples Installing the RS-422-A Interface Interface SpecificationsInterface Terminal Terminal Assignment Cable TerminationCommunication Wiring Data ConfigurationStart-stop Asynchronous Communication TextInput Buffer Buffer OverflowSetting up the RS-422-A Communication Interface Setup ProcedureIdentifier ParametersTerminator List of Program Set Commands Setting the Range and ScaleFormat SRp1,mode Example SR01,SKIPFormat SRp1, mode, p2 Example SR01, DI,Format SRp1, mode, p2, p3, p4, p5, p6, p7, p8 Setting Alarms Setting the Unit Setting the Waveform Span Rate TIME/DIVSetting the Clock Copying the Channel SettingsSetting the Discrete Zone Display Setting the Partial Expanded DisplaySetting the Tag Setting the Trip Level Setting the Data File Name FileSetting the LCD Brightness and LCD Saver LCD Setting the Summer/ Winter Time DSTFormat MDp1, p2, p3 Example MD02, ON, onList of Program Control Commands Alarm AcknowledgeStandard Screen Call Initializing the Data MemoryLoading the SET Configuration File Saving the SET Configuration FileSelecting the Output Data Selecting the Output Format for Measured DataMessage Writingfor the VR 200 with style number 2 or higher Execution of Trigger Status OutputRequests for the data to be prepared in the buffer Open Command Close CommandESC O Crlf ESC C CrlfIntroduction to Output Data Formats Sequence see also Sections 2.3.7Output Format of Measured Values in Ascii Mode Output Data FormatsOutput Format of Measured Values in Binary Mode Output Format of Parameter Settings Output Format of Unit and Decimal Point Information Time Chart Initial Status Preventing Errors OutputHow to Request Error Message Output ESC S CR LFTiming of Resetting the Error Status Program Examples EnvironmentOpen TEST.DAT for Input AS #2 Others LF is sent automatically 210 ‘ 220 ‘ Open COM11200,N,8,1,LF AS #1 Print a Appendix Appendix 1 Ascii Code TableAppendix 2 File Naming Rules File Name LengthLowercase/Uppercase Letters System-reserved File NamesIndex Index for Command Reference Warrant Y/ Disclaimer Temperature