Phytron_MCM01.db 5.67 KB
Newer Older
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
################################################################################
# This database contains records used to monitor status and reset the MCM01
# controller.
################################################################################

################################################################################
#ai record reads controller status from the device, mbbiDirect is used to parse
# the status bits
################################################################################
record(ai, "$(P)-STATUS_")
{
    field(DESC, "Status")
    field(DTYP, "asynInt32")
    field(INP, "@asyn($(PORT), $(ADDR), $(TIMEOUT))CONTROLLER_STATUS")
    field(SCAN, "1 second")
    field(FLNK, "$(P)-STATUS-BITS_")
}

record(mbbiDirect, "$(P)-STATUS-BITS_")
{
    field(DESC, "Status bits")
    field(DTYP, "Raw Soft Channel")
    field(INP, "$(P)-STATUS_")
    field(FLNK, "$(P)-PROGRAM")
}

################################################################################
#Controller status records. See DESC fields
################################################################################
record(bi, "$(P)-PROGRAM")
{
    field(DESC, "Program in local mode")
    field(INP, "$(P)-STATUS-BITS_.B0")
    field(ZNAM, "DONE")
    field(ONAM, "RUNNING")
    field(FLNK, "$(P)-SW-REMOTE")
}

record(bi, "$(P)-SW-REMOTE")
{
    field(DESC, "Software remote")
    field(INP, "$(P)-STATUS-BITS_.B1")
    field(ZNAM, "NO")
    field(ONAM, "YES")
    field(FLNK, "$(P)-LIMIT-SWITCH")
}

record(bi, "$(P)-LIMIT-SWITCH")
{
    field(DESC, "Axis limit switch")
    field(INP, "$(P)-STATUS-BITS_.B2")
    field(ZNAM, "NO")
    field(ONAM, "YES")
    field(FLNK, "$(P)-PS-AXIS-ERR")
}

record(bi, "$(P)-PS-AXIS-ERR")
{
    field(DESC, "Power stage axis error")
    field(INP, "$(P)-STATUS-BITS_.B3")
    field(ZNAM, "NO")
    field(ONAM, "YES")
    field(FLNK, "$(P)-PROG-ERR")
}

record(bi, "$(P)-PROG-ERR")
{
    field(DESC, "Programming error")
    field(INP, "$(P)-STATUS-BITS_.B4")
    field(ZNAM, "NO")
    field(ONAM, "YES")
    field(FLNK, "$(P)-TERM-ACT")
}

record(bi, "$(P)-TERM-ACT")
{
    field(DESC, "Terminal activated")
    field(INP, "$(P)-STATUS-BITS_.B5")
    field(ZNAM, "NO")
    field(ONAM, "YES")
    field(FLNK, "$(P)-INP-SCAN")
}

record(bi, "$(P)-INP-SCAN")
{
    field(DESC, "Input scan running")
    field(INP, "$(P)-STATUS-BITS_.B6")
    field(ZNAM, "NO")
    field(ONAM, "YES")
    field(FLNK, "$(P)-REMOTE")
}

record(bi, "$(P)-REMOTE")
{
    field(DESC, "Remote")
    field(INP, "$(P)-STATUS-BITS_.B7")
    field(ZNAM, "NO")
    field(ONAM, "YES")
    field(FLNK, "$(P)-AXIS-MODULE")
}

record(bi, "$(P)-AXIS-MODULE")
{
    field(DESC, "Axis module availability")
    field(INP, "$(P)-STATUS-BITS_.B8")
    field(ZNAM, "AVAILABLE")
    field(ONAM, "NOT AVAILABLE")
    field(FLNK, "$(P)-AXIS")
}

record(bi, "$(P)-AXIS")
{
    field(DESC, "Axis availability")
    field(INP, "$(P)-STATUS-BITS_.B9")
    field(ZNAM, "AVAILABLE")
    field(ONAM, "NOT AVAILABLE")
    field(FLNK, "$(P)-IO-MODULE")
}

record(bi, "$(P)-IO-MODULE")
{
    field(DESC, "I/O module availability")
    field(INP, "$(P)-STATUS-BITS_.BA")
    field(ZNAM, "AVAILABLE")
    field(ONAM, "NOT AVAILABLE")
    field(FLNK, "$(P)-IO")
}

record(bi, "$(P)-IO")
{
    field(DESC, "I/O availability")
    field(INP, "$(P)-STATUS-BITS_.BB")
    field(ZNAM, "AVAILABLE")
    field(ONAM, "NOT AVAILABLE")
    field(FLNK, "$(P)-INT-BUS-ERR")
}

record(bi, "$(P)-INT-BUS-ERR")
{
    field(DESC, "Internal data transf. err.")
    field(INP, "$(P)-STATUS-BITS_.BC")
    field(ZNAM, "NO")
    field(ONAM, "YES")
    field(FLNK, "$(P)-INT-MOD-ERR")
}

record(bi, "$(P)-INT-MOD-ERR")
{
    field(DESC, "Internal bus module err.")
    field(INP, "$(P)-STATUS-BITS_.BD")
    field(ZNAM, "NO")
    field(ONAM, "YES")
    field(FLNK, "$(P)-AIOM-MODULE")
}

record(bi, "$(P)-AIOM-MODULE")
{
    field(DESC, "AIOM module availability")
    field(INP, "$(P)-STATUS-BITS_.BE")
    field(ZNAM, "NO")
    field(ONAM, "YES")
    field(FLNK, "$(P)-AIOM-CHANNEL")
}

record(bi, "$(P)-AIOM-CHANNEL")
{
    field(DESC, "AIOM channel availability")
    field(INP, "$(P)-STATUS-BITS_.BF")
    field(ZNAM, "NO")
    field(ONAM, "YES")
    field(FLNK, "$(P)-CON-ERR")
}

record(calc, "$(P)-CON-ERR")
{
    field(INPA, "$(P)-LIMIT-SWITCH")
    field(INPB, "$(P)-PS-AXIS-ERR")
    field(INPC, "$(P)-PROG-ERR")
    field(INPD, "$(P)-INT-BUS-ERR")
    field(INPE, "$(P)-INT-MOD-ERR")
    field(INPF, "$(P)-AXIS-MODULE")
    field(INPG, "$(P)-AXIS")
    field(INPH, "$(P)-IO-MODULE")
    field(INPI, "$(P)-IO")
    field(INPJ, "$(P)-AIOM-MODULE")
    field(INPK, "$(P)-AIOM-CHANNEL")
    field(CALC, "A||B||C||D||E||F||G||H||I||J")
}

################################################################################
# Reset controller
# RESET_ changes value between 0 and 1, so the monitor is posted and the 
# REINIT_ record in Phytron_I1AM01.db is processed
################################################################################
record(bo, "$(P)-RESET")
{
    field(DESC, "Reset controller")
    field(DTYP, "asynInt32")
    field(OUT, "@asyn($(PORT), $(ADDR), $(TIMEOUT))CONTROLLER_RESET")
    field(ONAM, "RESET")
    field(ZNAM, "RESET")
    field(FLNK, "$(P)-RESET_")
}

record(calc, "$(P)-RESET_")
{
    field(DESC, "Reset monitor")
    field(INPA, "$(P)-RESET_")
    field(CALC, "(A=0)?1:0")
}

################################################################################
#Reset controller status
################################################################################
record(bo, "$(P)-RESET-STATUS")
{
    field(DESC, "Reset cont. status")
    field(DTYP, "asynInt32")
    field(OUT, "@asyn($(PORT), $(ADDR), $(TIMEOUT))CONTROLLER_STATUS_RESET")
    field(ONAM, "RESET")
    field(ZNAM, "RESET")
}