
_______________________________________
______________________________________
Instruction Manual MM850099 ed.02a
_________________________________________ 29 ________________________________________
Rx DATA 4
→
Tx DATA 4
Tx char
←
Rx char
Rx CHKSUM
→
Tx CHKSUM
Tx char
←
Rx char
Notes
Instr
DATA1
DATA2
DATA3
DATA4
Output
31
Value Hi
Value Lo
0
0
Value
(Out)
(Out)
In/Out
37
0
0
0
0
Status
36
Selected
0
0
0
The computer must split a 16 bit word into 2 words of 8 bit as follows:
Value Hi (....)
Value Lo (....)= integer value
Higher 8 bit
Lower 8 bit
8.7.6
Communication programs
In this chapter are illustrated two examples of communication programs between the
UniCal mA
and
an IBM or IBM compatible Personal Computer.
Example A:
(Data transfer from
UniCal mA
to PC) (see par. 8.7.4)
Set IDNAME=1 and BAUD RATE=9600 on
UniCal mA
(see 8.7.1).
Connect the
UniCal mA
, through adapter BB530001 (TTL-RS232 converter), to personal computer
communication port COM1.
Set
UniCal mA
in mA measurement mode (IN). Run the program and you will see on the screen of the
computer the actual measured value (once).
Example B:
(PC instructions to
UniCal mA
) (see par. 8.7.5)
Set IDNAME=1 and BAUD RATE=9600 on
UniCal mA
(see 8.7.1).
Connect the
UniCal mA
, through adapter BB530001 (TTL-RS232 converter), to personal computer
communication port COM1.
Set the
UniCal mA
for current OUT mode running the program the
UniCal mA
will be set automatically
to 20 mA.
A:
10 CHAR = 0
20 IDNAME = 1
30 INSTRUCTION = 21
35 OPEN "COM1: 9600, N,8,1,CD,CS,DS,RS" FOR RANDOM AS # 1
40 PRINT #1, CHR$ (IDNAME);
50 WHILE LOC (1) = 0: WEND;
60 IDNAME = ASC (INPUT$ (1, 1));
70 PRINT #1, CHR$ (INSTRUCTION);
80 WHILE LOC (1) = 0: WEND
90 INSTRUCTION = ASC (INPUT$ (1, 1))
100 PRINT #1, CHR$ (CHAR);
110 WHILE LOC (1) = 0: WEND
120 DATA 1 = ASC (INPUT$ (1, 1))
130 PRINT #1, CHR$ (CHAR);