EasyManuals Logo
Home>Omron>Measuring Instruments>K3HB-R

Omron K3HB-R User Manual

Omron K3HB-R
147 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 #44 background imageLoading...
Page #44 background image
1-23
Program Example Section 1-10
CompoWay/F
Communications
1-10 Program Example
N88Basic This program displays the response from the K3HB on the screen when com-
mand data is entered from the keyboard.
Command data from the unit number to the number of elements must be
entered.
The program was created in N88BASIC.
1000
1010
1020
1030
1040
1050
1060
1070
1080
1090
1100
1110
1120
1130
1140
1150
1160
1170
1180
1190
1200
1210
1220
1230
1240
1250
1260
1270
1280
1290
1300
1310
1320
1330
1340
1350
1360
1370
1380
1390
1400
1410
1420
1430
1440
1450
1460
1470
1480
1490
1500
1510
1520
1530
1540
1550
1560
1570
'----------------------------------------------------
'PROGRAM: E5AR/ER Communication Sample Program(CompoWay/F)
'VERSION:1.00
(c)Copyright OMRON Corporation 2003
All Rights Reserved
'----------------------------------------------------
'
'======Communication port (PARITY=EVEN, DATA=7, STOP=2) ======"
'
OPEN "COM:E73" AS #1
'
SENDDATA
'
========= Communication routine==================
'
--------Communication data input----------
INPUT "SEND DATA:",SEND$
'
--------If no input, jump to end routine----------
IF SEND$ = " " THEN EXITSEND
'
-------BCC calculation--------
BCC = 0
SEND$ = SEND$+CHR$(3)
FOR I=1 TO LEN(SEND$)
BCC = BCC XOR ASC(MID$(SEND$, I, 1))
NEXT I
BCC$ = CHR$(BCC)
'
------Send----------
SDATA$ = CHR$(2)+SEND$+BCC$
PRINT #1, SDATA$;
'
========= Receive routine ===========
'
RDATA$ = " "
TIMEOUT = 0
RCVLOOP
-------No response detection-------
TIMEOUT = TIMEOUT+1
IF TIMEOUT > 2000 THEN RESP$ = "No Response":GOTO RCVEND
IF LOC(1) = 0 THEN RCVLOOP
'
-----Check for end character (if no end character, continue reading)
RDATA$ = RDATA$+INPUT$(LOC(1),#1)
IF LEN(RDATA$) <2 THEN RCVLOOP
IF MID$(RDATA$,LEN(RDATA$)-1,1) <> CHR$(3) THEN RCVLOOP
RESP$ = MID$(RDATA$,2,LEN(RDATA$)-2)
RCVEND
'
-------Display received data-----------
PRINT "RESPONSE:";RESP$
GOTO SENDDATA
'
EXITSEND
=========End routine==========
CLOSE #1
END

Table of Contents

Other manuals for Omron K3HB-R

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron K3HB-R and is the answer not in the manual?

Omron K3HB-R Specifications

General IconGeneral
BrandOmron
ModelK3HB-R
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals