Category : Science and Education
Archive   : IC735CTL.ZIP
Filename : IC735B.ASC

 
Output of file : IC735B.ASC contained in archive : IC735CTL.ZIP

DECLARE SUB rmem (M!)
DECLARE SUB pfreq ()
DECLARE SUB cbuf ()
DECLARE SUB rmode (mode!)
DECLARE SUB rfreq (d1$, d2$, d3$, d4$)
DECLARE SUB check (rpt!)

'Icom-735 Control Program
'Robert A. Harris
'WB4HRH
'CIS# 74365,162
'VERSION #3
'
'This program was written in Quick Basic Ver. 4.5
'All code is in the Public Domain


DECLARE SUB Memchan (S$, M!)
DECLARE SUB Selectmem (M!)
DECLARE SUB Setfreqs ()
DECLARE SUB Setmode ()
DECLARE SUB Selectvfo ()
DECLARE SUB Mmode (M!)
DECLARE SUB FtM ()
DECLARE SUB MtF ()

SP$ = CHR$(254)
EP$ = CHR$(253)

COMP$ = CHR$(2)
GETFREQ$ = CHR$(3)
RQMODE$ = CHR$(4)
SETMOD$ = CHR$(6)
SETFRQ$ = CHR$(5)
SETVFO$ = CHR$(7)
SETMEMCHAN$ = CHR$(8)
STOREFTOM$ = CHR$(9)
WRITEMTOV$ = CHR$(&HA)

SCREEN 0
COLOR 1, 15

'Set Com: Port
CLS
LOCATE 10, 25
PRINT " WHICH COM: PORT ? ( 1 or 2 )";
DO
FLAG = 1
Z$ = INPUT$(1)
SELECT CASE Z$
CASE "1"
c$ = "COM1:1200,N,8,1"
CASE "2"
c$ = "COM2:1200,N,8,1"
CASE ELSE
FLAG = 0
END SELECT
LOOP WHILE FLAG = 0

ON ERROR GOTO 1

OPEN c$ FOR RANDOM AS #1 LEN = 1000

'type of rig
CLS
LOCATE 5, 30

PRINT " Select ICOM Radio "
LOCATE 9, 25
PRINT "{1} IC-735";
LOCATE 11, 25
PRINT "{2} IC-725";
LOCATE 13, 25
PRINT "{3} IC-7000";
LOCATE 15, 25
PRINT "{4} IC-761";
LOCATE 17, 25
PRINT "{5} IC-781";

r$ = INPUT$(1)

SELECT CASE r$
CASE "1"
icom$ = CHR$(4)
RIG$ = "IC-735"
CASE "2"
icom$ = CHR$(&H40)
RIG$ = "IC-725"
CASE "3"
icom$ = CHR$(8)
RIG$ = "IC-7000"
CASE "4"
icom$ = CHR$(&H30)
RIG$ = "IC-761"
CASE "5"
icom$ = CHR$(&H38)
RIG$ = "IC-781"
CASE ELSE
CLS
LOCATE 10, 30
PRINT "Not a Selection ...."
LOCATE 12, 35
PRINT " BYE"
FOR count = 1 TO 2000
NEXT count

END

END SELECT



CLS
M = 1
'Initialize
'Select Memory Mode 1
PRINT #1, SP$;
PRINT #1, SP$;
PRINT #1, icom$;
PRINT #1, COMP$;
PRINT #1, SETMEMCHAN$;
PRINT #1, CHR$(1);
PRINT #1, EP$;


LOCATE 12, 25
PRINT "Written by R. A. Harris"
LOCATE 14, 32
PRINT "WB4HRH"
FOR count = 1 TO 1500
NEXT count

'MAIN MENU

3 ON ERROR GOTO 2

DO
CLS

CALL check(rpt!)

'GET FREQUENCY
'CALL rfreq(d1$, d2$, d3$, d4$)
CALL pfreq

CALL check(rpt!)
'GET MODE
CALL rmode(mode)
cbuf
CALL rmem(M)
LOCATE 2, 23
PRINT RIG$; " CONTROL PROGRAM";
COLOR 1, 15

LOCATE 7, 10
PRINT "{F} Set Frequency"
LOCATE 9, 10
PRINT "{M} Set Mode"
LOCATE 11, 10
PRINT "{V} Select VFO"
LOCATE 13, 10
PRINT "{C} Select Memory Channel"
LOCATE 15, 10
PRINT "{S} Store Frequency in Memory"
LOCATE 17, 10
PRINT "{W) Write Memory to VFO"
LOCATE 19, 10
PRINT "{U} Update Status"

LOCATE 23, 10
PRINT "{Q} Quit Program"

DO
FLAG = 1
COLOR 0, 15

DO
LOCATE 4, 25
PRINT DATE$; " "; TIME$;
S$ = INKEY$
CALL cbuf
'CALL pfreq

LOOP WHILE S$ = ""


COLOR 1, 15

SELECT CASE S$
CASE "F", "f"
CALL Setfreqs
CASE "M", "m"
CALL Setmode
CASE "V", "v"
CALL Selectvfo
CASE "C", "c"
CALL Selectmem(M)
CASE "S", "s"
CALL FtM
CASE "W", "w"
CALL MtF
CASE "U", "u"
CLS

CASE "Q", "q"
EXIT DO

CASE ELSE
FLAG = 0
END SELECT

LOOP WHILE FLAG = 0
IF S$ = "Q" OR S$ = "q" THEN EXIT DO

LOOP

CLOSE #1

CLS
LOCATE 10, 5
PRINT "Brought to you by WB4HRH"
LOCATE 12, 10
PRINT "R.A.HARRIS"
LOCATE 14, 8
PRINT "CIS# 74365,162"
Z$ = INPUT$(1)

END

1 CLS
LOCATE 10, 5
PRINT "COMMUNICATIONS PROBLEM";
LOCATE 12, 5
PRINT " CHECK ALL CONNECTIONS";
LOCATE 15, 7
PRINT "( PRESS ANY KEY )"

Z$ = INPUT$(1)

END

2 CLOSE #1
OPEN c$ FOR RANDOM AS #1 LEN = 256
RESUME

GOTO 3
END

SUB cbuf

FOR count = 1 TO 10
NEXT count

DO
r$ = INPUT$(LOC(1), #1)
LOOP WHILE NOT EOF(1)


END SUB

SUB check (rpt)

SP$ = CHR$(254)
EP$ = CHR$(253)
SHARED icom$
COMP$ = CHR$(2)
GETFREQ$ = CHR$(3)
SETMOD$ = CHR$(6)
SETFRQ$ = CHR$(5)
SETVFO$ = CHR$(7)
SETMEMCHAN$ = CHR$(8)
STOREFTOM$ = CHR$(9)
WRITEMTOV$ = CHR$(&HA)



FOR count = 1 TO 500

NEXT count

DO
r$ = INPUT$(LOC(1), #1)
IF r$ = CHR$(&HFA) THEN rpt = 1 ELSE rpt = 0
'LOCATE 2, 1
'PRINT r$;
LOOP WHILE NOT EOF(1)

END SUB

SUB FtM

SP$ = CHR$(254)
EP$ = CHR$(253)
SHARED icom$
COMP$ = CHR$(2)
GETFREQ$ = CHR$(3)
SETVFO$ = CHR$(7)
SETMEMCHAN$ = CHR$(8)
STOREFTOM$ = CHR$(9)
WRITEMTOV$ = CHR$(10)

PRINT #1, SP$;
PRINT #1, SP$;
PRINT #1, icom$;
PRINT #1, COMP$;
PRINT #1, STOREFTOM$;
PRINT #1, EP$;

CALL check(rpt)

END SUB

SUB Memchan (S$, M)

SP$ = CHR$(254)
EP$ = CHR$(253)
SHARED icom$
COMP$ = CHR$(2)
GETFREQ$ = CHR$(3)
SETVFO$ = CHR$(7)
SETMEMCHAN$ = CHR$(8)
STOREFTOM$ = CHR$(9)
WRITEMTOV$ = CHR$(10)

IF S$ = "U" OR S$ = "u" THEN M = M + 1
IF M = 13 THEN M = 1

IF S$ = "D" OR S$ = "d" THEN M = M - 1
IF M = 0 THEN M = 12


END SUB

SUB Mmode (M)
SP$ = CHR$(254)
EP$ = CHR$(253)
SHARED icom$
COMP$ = CHR$(2)
GETFREQ$ = CHR$(3)
SETVFO$ = CHR$(7)
SETMEMCHAN$ = CHR$(8)
STOREFTOM$ = CHR$(9)
WRITEMTOV$ = CHR$(10)

'Put in Memory Channel Mode'
PRINT #1, SP$;
PRINT #1, SP$;
PRINT #1, icom$;
PRINT #1, COMP$;
PRINT #1, SETMEMCHAN$;
PRINT #1, EP$;
CALL check(rpt)

M = M
END SUB

SUB MtF

SP$ = CHR$(254)
EP$ = CHR$(253)
SHARED icom$
COMP$ = CHR$(2)
GETFREQ$ = CHR$(3)
SETVFO$ = CHR$(7)
SETMEMCHAN$ = CHR$(8)
STOREFTOM$ = CHR$(9)
WRITEMTOV$ = CHR$(&HA)
SHARED RIG$


'Selct VFO`
CLS
LOCATE 4, 8
PRINT RIG$; " CONTROL PROGRAM"
LOCATE 8, 10
PRINT "{A} Write to VFO A"
LOCATE 10, 10
PRINT "{B} Write to VFO B"

FLAG = 0
DO
S$ = INPUT$(1)
SELECT CASE S$
CASE "a", "A"
vfo = 0
FLAG = 1
CASE "B", "b"
vfo = 1
FLAG = 1
CASE ELSE
FLAG = 0
END SELECT
LOOP UNTIL FLAG = 1

'SEND INPUT TO RADIO
PRINT #1, SP$;
PRINT #1, SP$;
PRINT #1, icom$;
PRINT #1, COMP$;
PRINT #1, SETVFO$;
PRINT #1, CHR$(vfo);
PRINT #1, EP$;

FOR count = 1 TO 500
NEXT count

PRINT #1, SP$;
PRINT #1, SP$;
PRINT #1, icom$;
PRINT #1, COMP$;
PRINT #1, WRITEMTOV$;
PRINT #1, EP$;
CALL check(rpt)

END SUB

SUB pfreq

SP$ = CHR$(254)
EP$ = CHR$(253)
SHARED icom$
COMP$ = CHR$(2)
GETFREQ$ = CHR$(3)
SETMOD$ = CHR$(6)
SETFRQ$ = CHR$(5)
SETVFO$ = CHR$(7)
SETMEMCHAN$ = CHR$(8)
STOREFTOM$ = CHR$(9)
WRITEMTOV$ = CHR$(&HA)

DIM d$(1 TO 17)

PRINT #1, SP$;
PRINT #1, SP$;
PRINT #1, icom$;
PRINT #1, COMP$;
PRINT #1, GETFREQ$;
PRINT #1, EP$;

c = 0
DO
c = c + 1

DO
r$ = INPUT$(LOC(1), #1)
LOOP WHILE r$ = ""
x = ASC(r$)
d$(c) = HEX$(x)

LOOP WHILE c < 16

LOCATE 7, 45


'print on screen
COLOR 2, 0
PRINT " Frequency: ";
PRINT d$(15);
PRINT ".";

IF LEN(d$(14)) = 1 THEN PRINT "0";
PRINT d$(14);

IF LEN(d$(13)) = 1 THEN t$ = "0" ELSE t$ = LEFT$(d$(13), 1)
H$ = RIGHT$(d$(13), 1)
PRINT t$;
PRINT ".";
PRINT H$;

PRINT d$(12);
PRINT " ";
COLOR 0, 15


END SUB

SUB rfreq (d1$, d2$, d3$, d4$)

SP$ = CHR$(254)
EP$ = CHR$(253)
'SHARED icom$
COMP$ = CHR$(2)
GETFREQ$ = CHR$(3)
SETMOD$ = CHR$(6)
SETFRQ$ = CHR$(5)
SETVFO$ = CHR$(7)
SETMEMCHAN$ = CHR$(8)
STOREFTOM$ = CHR$(9)
WRITEMTOV$ = CHR$(&HA)

DIM i$(1 TO 17)
DIM d$(1 TO 17)

PRINT #1, SP$;
PRINT #1, SP$;
PRINT #1, icom$;
PRINT #1, COMP$;
PRINT #1, GETFREQ$;
PRINT #1, EP$;

c = 0
DO
c = c + 1

DO
r$ = INPUT$(LOC(1), #1)
LOOP WHILE r$ = ""

i$(c) = r$
LOOP WHILE c < 16

d1$ = i$(12)
d2$ = i$(13)
d3$ = i$(14)
d4$ = i$(15)


END SUB

SUB rmem (M)
COLOR 2, 0
LOCATE 13, 45
PRINT " Memory Channel: "; M; " "
COLOR 1, 15

END SUB

SUB rmode (mode)

SP$ = CHR$(254)
EP$ = CHR$(253)
SHARED icom$
COMP$ = CHR$(2)
GETFREQ$ = CHR$(3)
RQMODE$ = CHR$(4)
SETMOD$ = CHR$(6)
SETFRQ$ = CHR$(5)
SETVFO$ = CHR$(7)
SETMEMCHAN$ = CHR$(8)
STOREFTOM$ = CHR$(9)
WRITEMTOV$ = CHR$(&HA)

DIM d(17)

PRINT #1, SP$;
PRINT #1, SP$;
PRINT #1, icom$;
PRINT #1, COMP$;
PRINT #1, RQMODE$;
PRINT #1, EP$;


c = 0
DO
c = c + 1
DO
r$ = INPUT$(LOC(1), #1)
LOOP WHILE r$ = ""
d(c) = ASC(r$)
LOOP WHILE c < 13

LOCATE 9, 45

'print on screen
COLOR 2, 0
PRINT " Mode: ";
SELECT CASE d(12)
CASE 0
PRINT "LSB";
CASE 1
PRINT "USB";
CASE 2
PRINT "AM";
CASE 3
PRINT "CW";
CASE 4
PRINT "RTTY";
CASE 5
PRINT "FM";
CASE ELSE
PRINT " ";
END SELECT
PRINT " ";

LOCATE 9, 57

'Bandwidth if present


SELECT CASE d(13)
CASE 1
PRINT "B-width: WIDE";
CASE 2
PRINT "B-width: MEDIUM";
CASE 3
PRINT "B-width: NARROW";
END SELECT

COLOR 1, 15

mode = d(12)



END SUB

SUB Selectmem (M)

SP$ = CHR$(254)
EP$ = CHR$(253)
SHARED icom$
COMP$ = CHR$(2)
GETFREQ$ = CHR$(3)
SETVFO$ = CHR$(7)
SETMEMCHAN$ = CHR$(8)
STOREFTOM$ = CHR$(9)
WRITEMTOV$ = CHR$(10)
SHARED RIG$

d$ = CHR$(25)
U$ = CHR$(24)

'Select Memory Channel

CLS
LOCATE 4, 8
PRINT RIG$; " CONTROL PROGRAM"

LOCATE 8, 10
PRINT "{M} Memory Mode"
LOCATE 10, 10
PRINT "{#} Channel Number"
LOCATE 12, 10
PRINT "{U} Channel UP"
LOCATE 14, 10

PRINT "{D} Channel Down"
LOCATE 22, 10
PRINT "{Q} Return to Menu"

cbuf
pfreq
cbuf
rmode (mode)

COLOR 2, 0
LOCATE 13, 45
PRINT " Memory Channel: "; M; " "
COLOR 1, 15

DO
e = 1
DO
FLAG = 1
S$ = INPUT$(1)

SELECT CASE S$
CASE "1"
M = 1
CASE "2"
M = 2
CASE "3"
M = 3
CASE "4"
M = 4
CASE "5"
M = 5
CASE "6"
M = 6
CASE "7"
M = 7
CASE "8"
M = 8
CASE "9"
M = 9
CASE "-", "_"
M = 11
CASE "0"
M = 10
CASE "=", "+"
M = 12
CASE "U", "u"
CALL Memchan(S$, M)
CASE "D", "d"
CALL Memchan(S$, M)
CASE "M", "m"
CALL Mmode(M)
CASE "Q", "q"
e = 0
EXIT DO
CASE ELSE
FLAG = 0
END SELECT

V$ = CHR$(M)
IF M = 10 THEN V$ = CHR$(&H10)
IF M = 11 THEN V$ = CHR$(&H11)
IF M = 12 THEN V$ = CHR$(&H12)

LOOP WHILE FLAG = 0
IF e = 0 THEN EXIT DO

'Select Memory Mode
PRINT #1, SP$;
PRINT #1, SP$;
PRINT #1, icom$;
PRINT #1, COMP$;
PRINT #1, SETMEMCHAN$;
PRINT #1, V$;
PRINT #1, EP$;

CALL check(rpt)
CALL pfreq
CALL cbuf
CALL rmode(mode)

COLOR 2, 0
LOCATE 13, 45
PRINT " Memory Channel: "; M; " "
COLOR 1, 15

LOOP

END SUB

SUB Selectvfo

SP$ = CHR$(254)
EP$ = CHR$(253)
SHARED icom$
COMP$ = CHR$(2)
GETFREQ$ = CHR$(3)
SETVFO$ = CHR$(7)
SETMEMCHAN$ = CHR$(8)
STOREFTOM$ = CHR$(9)
WRITEMTOV$ = CHR$(10)
SHARED RIG$

'Selct VFO`
CLS
LOCATE 4, 8
PRINT RIG$; " CONTROL PROGRAM"
LOCATE 8, 10
PRINT "{A} Select VFO A"
LOCATE 10, 10
PRINT "{B} Select VFO B"
LOCATE 22, 10
PRINT "{Q} Return to Main Menu"

FLAG = 0
DO
S$ = INPUT$(1)
SELECT CASE S$
CASE "A", "a"
vfo = 0
FLAG = 1
CASE "B", "b"
vfo = 1
FLAG = 1
CASE ELSE
FLAG = 0
END SELECT
LOOP UNTIL FLAG = 1

'SEND INPUT TO RADIO
PRINT #1, SP$;
PRINT #1, SP$;
PRINT #1, icom$;
PRINT #1, COMP$;
PRINT #1, SETVFO$;
PRINT #1, CHR$(vfo);
PRINT #1, EP$;

END SUB

SUB Setfreqs
SHARED RIG$

'FREQUENCY INPUT MODULE
CLS
LOCATE 4, 8
PRINT RIG$; " CONTROL PROGRAM"

DIM i$(8)
SP$ = CHR$(254)
EP$ = CHR$(253)
SHARED icom$
COMP$ = CHR$(2)
GETFREQ$ = CHR$(3)
SETFRQ$ = CHR$(5)
SETVFO$ = CHR$(7)
SETMEMCHAN$ = CHR$(8)
STOREFTOM$ = CHR$(9)
WRITEMTOV$ = CHR$(&HA)
BS$ = CHR$(8)
CR$ = CHR$(13)

LOCATE 8, 6
PRINT "INPUT FREQUENCY : "
LOCATE 10, 6
PRINT "Press ENTER to end";
COLOR 2, 0

LOCATE 8, 23
PRINT " "

'ENTER AND PRINT
N = 1
DO 'MAIN ROUTINE
IF N = 0 THEN N = 1
DO 'INPUT ROUTINE
FLAG = 1
i$(N) = INPUT$(1)

IF i$(N) < "0" THEN FLAG = 0
IF i$(N) > "9" THEN FLAG = 0
IF i$(1) > "2" THEN FLAG = 0
IF i$(N) = BS$ THEN
FLAG = 1
N = N - 1
i$(N) = " "
END IF
IF i$(N) = CR$ THEN FLAG = 1

LOOP WHILE FLAG = 0
IF i$(N) = CR$ THEN EXIT DO

LOCATE 8, 24
PRINT " "

LOCATE 8, 24

IF N = 1 THEN PRINT i$(1) + " " + ".";
IF N = 2 THEN PRINT i$(1) + i$(2) + ".";
IF N = 3 THEN PRINT i$(1) + i$(2) + "." + i$(3);
IF N = 4 THEN PRINT i$(1) + i$(2) + "." + i$(3) + i$(4);
IF N = 5 THEN PRINT i$(1) + i$(2) + "."; i$(3) + i$(4) + i$(5) + ".";
IF N = 6 THEN PRINT i$(1) + i$(2) + "." + i$(3) + i$(4) + i$(5) + "." + i$(6);
IF i$(N) = " " THEN N = N ELSE N = N + 1

LOOP WHILE N < 7


N = N - 1

FOR x = N + 1 TO 6
i$(x) = "0"
NEXT x
N = 6

'SEND INPUT TO RADIO
PRINT #1, SP$;
PRINT #1, SP$;
PRINT #1, icom$;
PRINT #1, COMP$;
PRINT #1, SETFRQ$;
PRINT #1, CHR$(&H0);
x = N
FOR x = N TO 1 STEP -2
P = 0
IF x = 1 THEN
TWO$ = "&H" + i$(x)
ELSE
TWO$ = "&H" + i$(x - 1) + i$(x)
END IF
d = VAL(TWO$)
PRINT #1, CHR$(d);
NEXT x
PRINT #1, EP$;
COLOR 1, 15

END SUB

SUB Setmode

'Set the mode

SP$ = CHR$(254)
EP$ = CHR$(253)
SHARED icom$
COMP$ = CHR$(2)
GETFREQ$ = CHR$(3)
SETFRQ$ = CHR$(5)
SETMOD$ = CHR$(6)
SETVFO$ = CHR$(7)
SETMEMCHAN$ = CHR$(8)
STOREFTOM$ = CHR$(9)
WRITEMTOV$ = CHR$(10)
SHARED RIG$

CLS
LOCATE 4, 8
PRINT RIG$; " CONTROL PROGRAM"
LOCATE 8, 10
PRINT "{U} USB"
LOCATE 10, 10
PRINT "{L} LSB"
LOCATE 12, 10
PRINT "{A} AM"
LOCATE 14, 10
PRINT "{F} FM"
LOCATE 16, 10
PRINT "{C} CW"


DO
FLAG = 1
S$ = INPUT$(1)
SELECT CASE S$
CASE "u", "U"
mode = 1
CASE "L", "l"
mode = 0
CASE "A", "a"
mode = 2
CASE "F", "f"
mode = 5
CASE "C", "c"
mode = 3

CASE ELSE
FLAG = 0
END SELECT

LOOP WHILE FLAG = 0

'SEND INPUT TO RADIO
PRINT #1, SP$;
PRINT #1, SP$;
PRINT #1, icom$;
PRINT #1, COMP$;
PRINT #1, SETMOD$;
PRINT #1, CHR$(mode);
PRINT #1, EP$;

END SUB