Printer Interface Example; Transmit - GSE 60 SERIES Technical Reference Manual

Programmable process controllers
Table of Contents

Advertisement

8-36 Chapter 8

Printer Interface Example

100%s23640%i%e Access Setup Modes,
Allowing Changes
65010%s1%e%e
P65010. dbase Reset
108%s1%e
P101.01 Scl 1 Scale
109%s2%e
P109.02 Scl 1 Enbld
205%s2%e
P205.02 Recv1 Intrp
218%s.000%e
P218.00 RxTrm <NUL>
219%s1%e%e
P219.00 RxIn#1
221%s0%e
P221.00 RxTyp Char
223%s%c%e
P223. RxFmt
.006%e
224%s3%e
P224.03 RxMac 3
219%s2%e%e
P219.00 RxIn#2
221%s0%e
P221.00 RxTyp Char
223%s%c%e
P223. RxFmt
.021%e
224%s4%e
P224.03 RxMac 4
9990%s1%e%e
macro#1
10001%s
80.1P=0%%o%e
copy register
9990%s2%e%e
macro#2
9991%s
PrintBlock%e
10001%s
80.1P==0%o%e
0001 compare
1%%"%e
0005 select port
Ap1%%)%e
0007 flush keys
80.1P=1%%o%e
0009 copy register
5%%&%e
0014 send code
%%N%e
0016 if not
Can'tSend!%
%P%e
0017 pause
%%E%e
0028 end if
9990%s3%e%e
macro#3
10001%s
80.1P==1%%o%e
0001 compare
80.1P=2%%o%e
0006 copy register
1%%Q%e
0011 custom

transmit

%%N%e
0013 if not
80.1P=0%%o%e
0014 copy register
%%E%e
0019 end if
9990%s4%e%e
macro#4
10001%s
80.1P==2%%o%e
0001 compare
1%%"%e
0006 select port
80.1P=1%%o%e
0008 copy register
6%%&%e
0013 send code
GSE Scale Systems
P
RINTER
While there are numerous ways of accomplishing various tasks with the 60
Series instrument. One possible method follows below. This
implementation uses Macro 1, 2, 3 ,4, Custom Transmit 1, and Var#80.1.
Macro 2 is named Print Block so that it can be started from the [F2] key.
Macro 1 which is invoked by setpoint 1 upon controller power-up or after
exiting setup mode clears Var#80.1. Var#1 is used to keep track of the
state of the interface.
1. When macro 2 is executed, it checks Var#80.1 to determine if a print is
in progress. If no print is in progress, <ENQ> is sent out COMM port
#1 to indicate the beginning of a transmission and Var#1 is
incremented to 1 to prevent other transmissions. If a print is in
progress, the message "Can't Send" is displayed if macro 2 is invoked.
2. The input interpreter #1 is set to execute macro 3 when a <ACK>is
received. Macro 3 checks if Var#80.1. If it is, custom transmit 1 is sent
<ACK>^F=06
and Var#1 is set to 2.
3. After the transmission is sent, the printer will respond with either an
<ACK> or a <NAK>. If <ACK> is received at this point (Var#80.1 not
=1) then macro 3 changes Var#1 back to 0. This means another
<NAK>^U=21
transmission could be initiated.
If <AK> is received, the input interpreter #2 will cause macro 4 to run. This
macro will send an <ACK> to the printer and set Var#80.1 to 1. Then step
2 is repeated.
Custom transmit 1 describes the format of a custom transmit using CRCs.
The file, (LRCC8.SET) contains this implementation.
T
RANSMIT
N
UMBER
Table 8-21 shows the format code for transmitting the current scale
number as a single ASCII character.
Table 8-21: Transmit Current Scale Number Format Code
F
ORMAT
C
ODE
.350
Examples
Scale #
1
2
I
NTERFACE
T
HE
(ASCII)
F
UNCTION
Transmit
This format will Transmit the
current
current scale number as a
scale #
single ASCII character
Decimal Value/ASCII character
49 = 1
50 = 2
E
XAMPLE
C
S
URRENT
D
ESCRIPTION
CALE

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents