Toshiba TOSVERT VF-AS1 instruction manual =LENS$ For I=1 to L, Next, Input #1,B$, Goto

Models: TOSVERT VF-AS1 VF-AS1

1 73
Download 73 pages 18.65 Kb
Page 26
Image 26

efesotomasyon.com -Toshiba inverter,drive,servo,plc

E6581315

Ex. 2: BASIC program for executing an input command with checksum (RS232C, ASCII mode) (Toshiba version of Advanced BASIC-86 Ver. 3.01.05J)

Checking if the maximum frequency setting has been changed correctly

1) Examples of programs

 

10

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

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

20

INPUT"Send Data=";A$

--- Reads in data to be sent to the inverter.

30

S$="("+A$+"&"

--- Adds “(“ and “&” to the read data in.

40 S=0

 

50

L=LEN(S$)

 

60

FOR I=1 TO L

Calculates the number of bits (checksum).

70S=S+ASC(MID$(S$,I,1))

80NEXT I

90CHS$=RIGHT$(HEX$(S),2)

100

PRINT #1,"("+A$+"&"+CHS$+")"

--- Sends the data including the checksum result

 

 

to the inverter.

110

INPUT #1,B$

--- Receives data returned from the inverter.

120

PRINT "Receive data= ";B$

--- Displays the data received.

130

GOTO 20

--- Repeats.

2) Examples of program execution results

 

Send Data=? R0011

--- Reads the maximum frequency (0011).

Receive Data= (R00111F40&3D)

--- 1F40 (Maximum frequency: 80 Hz)

Send Data=? W00111770

--- Changes the maximum frequency to 60 Hz

 

 

(1770).

Receive Data= (W00111770&36)

 

Send Data=? R0011

--- Reads the maximum frequency (0011).

Receive Data= (R00111770&31)

--- 1770 (Maximum frequency: 60 Hz)

25

Page 26
Image 26
Toshiba TOSVERT VF-AS1 instruction manual =LENS$ For I=1 to L, Next, Input #1,B$, Goto