beautypg.com

Examples of communication programs – Toshiba Tosvert RS485 User Manual

Page 25

background image

E6581315

24

4.6. Examples of Communication programs

According to the hardware configuration of the computer used, select a serial output port. To use an
RS232C port on the computer, you will have to prepare an RS232C-RS485 conversion unit sepa-
rately.
An USB-RS485 conversion unit (USB0001Z) is available as our standard offering.

Ex. 1: BASIC program for monitoring the output frequency continuously (RS232C, ASCII mode)

(Toshiba version of Advanced BASIC-86 Ver. 3.01.05J)

◊ Monitoring the output frequency continuously
1) Examples of programs

10 OPEN "COM1:9600,E,8,1" AS #1

--- 9600 baud, even parity, 8-bit length, 1 stop bit

20 A$=”FE00”

--- Specifies the communication number for

monitoring the output frequency.

30 PRINT #1,"("+”R”+A$+")"

--- Transmits data to the inverter.

Note: The carriage return code is added

automatically.

40 INPUT#1,B$

--- Receives data returned from the inverter.

50 AAA$=“&H”+MID$(B$,7,4)

--- Extracts only data items from the data re-

turned.

60 F$=LEFT$(STR$(VAL(AAA$)/100),6)

--- Converts data into decimal form.

70 PRINT " Output frequency =";F$+“Hz”

--- Displays the output frequency.

80 GOTO 20

--- Repeats.

2) Examples of program execution results (stop command issued during 80 Hz operation)

Output frequency = 80 Hz ...
Output frequency = 79.95Hz
:
:
Output frequency = 0Hz

This manual is related to the following products: