-
Notifications
You must be signed in to change notification settings - Fork 5
/
IP520.html
150 lines (125 loc) · 5.66 KB
/
IP520.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<html>
<head>
<meta http-equiv="Content-Type" content="">
<title>Acromag IP520/521 Module Support</title>
</head>
<body text="#000000" bgcolor="#ffffff" link="#000080" vlink="#707070"
alink="0000080">
<h1>Acromag IP520/521 Module Support</h1>
<h2>Introduction</h2>
<p>
This is a driver for the Acromag IP520 EIA/TIA-232E and IP521 EIA/TIA-422B (supports
EIA-485) Industry Pack communication modules.
</p>
<p>
The driver uses <a href="drvIpac.html">drvIpac</a> for configuration of the
carrier board plus access routines for the underlying dual ST16C554/654 quad
UARTs used in the IP modules. The driver implements a standard VxWorks terminal
port making use of the vxWorks tyLib system library.
</p>
<h2>Configuration Example</h2>
<p>
The following is an example of a startup script (st.cmd) segment that creates
and configures IP carriers, IP520/521 modules, and tty devices. This example is
compatible with both vxWorks and iocsh startup scripts.
</p>
<blockquote>
<pre># Initialize the drvIpac carriers.
# -------------------------------
# carrier#0
ipacAddMVME162 "A:m=0xe0000000,64 l=3,2"
# carrier#1
ipacAddVIPC616_01 "0x6400,0xB0000000"
# carrier#2
ipacAddTVME200 "602fb00"
# Allocate the total number of IP520 and IP521 modules to support.
# ----------------------------------------------------------------
IP520Drv 6
# Initialize IP520/521 modules.
# ----------------------------
# IP520ModuleInit(char *moduleID, char *ModuleType, int irq_num,
# char *carrier#, int slot#)
# moduleID - assign the IP module a name for future reference.
# ModuleType - "232" - for IP520 modules, "422" or "485" - for IP521 modules
# irq_num - interrupt request number.
# carrier# - carrier# assigned from the ipacAdd<i>CarrierType</i>() call.
# slot# - slot number on carrier; slot[A,B,C,D] -> slot#[0,1,2,3].
# Init two IP520 modules from the MVME162 carrier; the 1st module is in
# slot A, the second module is in slot B.
IP520ModuleInit "Mod0", "232", 0x80, 0, 0
IP520ModuleInit "Mod1", "232", 0x81, 0, 1
# Init two IP520 modules from the 1st SBS VIPC616_01 carrier; the 1st
# module is in slot A, the 2nd module is in slot C.
IP520ModuleInit "Mod2", "232", 0x82, 1, 0
IP520ModuleInit "Mod3", "232", 0x83, 1, 2
# Init two IP521 modules from the 2nd SBS VIPC616_01 carrier; the 1st
# module is for 422 in slot B, the second module is for 485 in slot D.
IP520ModuleInit "Mod4", "422", 0x84, 2, 1
IP520ModuleInit "Mod5", "485", 0x85, 2, 3
# Create tty devices.
# ------------------
# IP520DevCreate(char *portname, int moduleID, int port#, int rdBufSize,
# int wrtBufSize)
# portname - assign the port a name for future reference.
# moduleID - moduleID from the IP520ModuleInit() call.
# port# - port number for this module [0-7].
# rdBufSize - read buffer size, in bytes.
# wrtBufSize - write buffer size, in bytes.
# Create two tty ports on Mod0 with <i>portname</i> based on the convention;
# "/tyGS/<i>carrier#,slot#</i>/<i>moduleID</i>/port#".
IP520DevCreate "/tyGS/0,0/0", "Mod0", 0, 512, 512
IP520DevCreate "/tyGS/0,0/1", "Mod0", 1, 512, 512
# Initialze all the remaining uninitialized Mod0 ports; i.e., /tyGS0/0/[2-7].
IP520DevCreateAll "/tyGS/0,0/", "Mod0", 512, 512
# Initialize all the Mod1 ports.
IP520DevCreateAll "/tyGS/0,1/", "Mod1", 512, 512
# Initialize all the Mod2 ports.
IP520DevCreateAll "/tyGS/1,0/", "Mod2", 512, 512
# Configure the ports.
# --------------------
# void IP520Config (char *portname, int baud, char parity, int stop,
# int bits, char flow)
# portname - portname from either the IP520DevCreate() call or
# the IP520DevCreateAll() call.
# baud - baudrate; 1200,2400,4800,9600,19200,38400,57600,115200,230400.
# parity - even - 'E', odd - 'O', or none - 'N'.
# stop - stop bits; 1 or 2.
# bits - data bits; 5,6,7 or 8.
# flow - flow control; hardware - 'H' or none - 'N'.
IP520Config "/tyGS/0,0/0", 38400, 'N', 1, 8, 'N'
# Ports default to 9600, 'N', 1, 8, 'N'
</pre>
</blockquote>
<p>When running EPICS base 3.15 or higher, the iocshLoad command can be used
with the ip520.iocsh script included in this module's top-level iocsh
directory. The following shows an example of such a use.</p>
<blockquote>
<pre>
# Initialize the drvIpac carriers.
# -------------------------------
# carrier#0
ipacAddMVME162 "A:m=0xe0000000,64 l=3,2"
# carrier#1
ipacAddVIPC616_01 "0x6400,0xB0000000"
# carrier#2
ipacAddTVME200 "602fb00"
# Initialize an ip520 module called MOD0 that's located in slot A of
# of the first initialized carrier (MVME162), and then create 8 tty
# ports labeled /tyGS/0,0/0 through /tyGS/0,0/7 on that module.
# Also tell the script that you will be initializing up to 5 more modules.
iocshLoad("$(IPAC)/iocsh/ip520.iocsh", "INSTANCE=MOD0, INT_VEC=0x80, CARRIER=0, SLOT=0, MAX_MODULES=6")
# Initialize the ip520 module in slot B of the MVME162, the tty ports
# created will be labeled /tyGS/0,1/0 through /tyGS/0,1/7
iocshLoad("$(IPAC)/iocsh/ip520.iocsh", "INSTANCE=MOD1, INT_VEC=0x81, CARRIER=0, SLOT=1")
# Init two IP520 modules from the 1st SBS VIPC616_01 carrier; the 1st
# module is in slot A, the 2nd module is in slot C.
iocshLoad("$(IPAC)/iocsh/ip520.iocsh", "INSTANCE=MOD2, INT_VEC=0x82, CARRIER=1, SLOT=0")
iocshLoad("$(IPAC)/iocsh/ip520.iocsh", "INSTANCE=MOD3, INT_VEC=0x83, CARRIER=1, SLOT=2")
# Init two IP520 modules from the 2nd SBS VIPC616_01 carrier; the 1st
# module is in slot B, the second module is in slot D.
iocshLoad("$(IPAC)/iocsh/ip520.iocsh", "INSTANCE=MOD4, INT_VEC=0x84, CARRIER=2, SLOT=1")
iocshLoad("$(IPAC)/iocsh/ip520.iocsh", "INSTANCE=MOD5, INT_VEC=0x85, CARRIER=2, SLOT=3")
</pre>
</blockquote>
</body>
</html>