Experimental Physics and Industrial Control System
Hi David,
I'll try and catch some of the things Ralph didn't mention and add to
his ideas as well...
David Dudley wrote:
I'm currently starting to work on adding support into my modbus
device driver for Analog Arrays. Is there any documentation on the
AAI and AAO records?
Not that I'm aware of. I think the original author was Johnny Tang
<[email protected]> when he was working at JLAB, and either he or they
might have some (if you're lucky). You can always just look at the
aa*Record.dbd file and the associated .c file (in base/src/rec) to get
some idea what they do.
If anyone wants to resurrect the AAI/AAO records, at minimum they need
soft device support and some documentation. Personally I want to
overhaul our complete set of record types, but I think that's a big task
that might best wait for any changes we make to the record support API.
It has been suggested before that perhaps I should consider the
Waveform record, but I have a little problem. I need to read a
string of 16 bit registers in a single group (sort of a 'simultaneous
sample' thing), and I don't see the capability of doing this will a
standard AI record (do I need to write special device support for
Waveform? Maybe that's the problem).
You should be able to do this in your AI device support if you are so
inclined - look at the technique in directNetAsyn where I batch together
a number of input operations from adjacent or nearby addresses and put
the result into a cache from which any of the input records can read
without kicking off another I/O operation (if they're quick enough).
Alternatively there's a technique that is used in the AllenBradley
support where the I/O operation for the block is done by a Waveform
record and there are individual input records that extract data from the
waveform data.
Also, even if I generate whatever is needed for Waveform records for
input, how do I manage output? I need to be able to write a 120
register block out at the same time in order to insure consistency.
Seems to me, that's an Analog Array Output (AAO) record, if I ever
saw one.
Again this might be a device support implementation - you would have one
special address that causes the block to be written out, and all of the
other related output records just write data to the memory block. You
could do this with a waveform record again -- I don't think there would
be any signficicant point in using the AAO record since the two are
basically very similar, and neither give you the ability to say anything
like 'put this value into the 13th array element'.
On an unrelated note, I'm curious about a few things. I don't see
any way to do tests with the database. I have a need to do things
like "read an input - Test for a value - output a trigger if true",
as a simple grouping. I don't see any way to programmatically decide
whether or not to execute a FWDLNK, which I think is what I want to
do (or is that what the SEQ block can do? Documentation is kind of
weak.).
Look at the calcout record for conditional processing, and don't forget
the SDIS link for disabling processing of your trigger record.
Finally, I don't see any way to do 'discrete PID' controls. Guess I
should just shut up and write blocks to do what I want, which I think
consist of the following (any way to do these already would be
appreciated).
Ralph mentioned the PID record; the latest and best version of that is
probably the epid which is part of the synApps/std package at
http://www.aps.anl.gov/aod/bcda/synApps/std/std.html (with documentation
too!).
1. Multiplex a input array into a single value (think I found that in
the SEL block, but why is the limit 12 on so many of these blocks?).
That's a good question, my guess is that they were made as big as the
original author needed, or they started from some common record type
that only had 12 and so the meme just spread.
2. Demultiplex a value to a selected FWDLNK (don't see this one,
unless the SEQ block does it. But it doesn't have multiple FWDLNKs).
In addition to the SEQ record (point its ten OUTx links to the .PROC
fields of the target records if you don't them want to pass a value),
the fanout record can very easily be extended to almost as many forward
links as you desire (if you want more than 16, change the SELN field to
a DBF_ULONG; if you need more than 32 you'll have to take out the
bit-mask mechanism).
3. IF or other conditional test block (if condition meets criteria,
do FWDLNK, else don't).
See the SDIS mechanism - you always do the forward link, but the target
doesn't always process if it's been disabled.
4. PID Control with Discrete output controls (jog up/jog down, for
PID Control).
I guess I'm not completely sure what you're after here, but you should
look at the capabilities of the motor record (another part of synApps
which is shipped separately), which may do some of what you need:
http://www.aps.anl.gov/upd/people/sluiter/epics/modules/mechanism/motor/index.html
5. DB Log command to output current value to a database point.
Hmm, not sure if you're talking about an archive here - check out the
Channel Archiver, or expand on your needs.
Also, is there any structure built into the system to provide a
'orderly startup / orderly shutdown' operation? The stuff I have
background with all provide the capability of loading an initial
state and storing the current state when the system is started up and
shut down, as well as the capability of doing a 'checkpoint' type
operation. Need that to do continuous control type operations.
Can't have a remote IOC defaulting everything to invalid conditions
if it has a short power failure or other problem that causes a
reload.
This sounds like a combination of one or more sequence programs and the
autosave/restore subsystem, another part of synApps (find all of it at
http://www.aps.anl.gov/aod/bcda/synApps/) which you configure to
checkpoint the current value of selected fields at programmed intervals
and which can restore those values at IOC initialization time.
Lastly, do most IOC's have the SEQUENCER software incorporated in
them? Seems to me that a lot of the things I would expect to do in
combinational-logic don't seem to *exactly* exist in the DB. Do all
logic things need SEQ support?
Probably a large proportion of IOCs have sequencers in them. However
the sequencer is better for doing state transition logic; interlocks and
the like are probably best done in the database itself. The calc record
can do combinatorial logic, and also see the transform record for more
complex expressions. There was a PAL record in R3.13 which could take
the JEDEC file for a PAL16V8 or PAL22V10 chip and implement the logic
found therein, but I don't think it was ever used outside of Los Alamos.
You can also write your logic in subroutine record code, and you
should also look at the gensub record for whole-array handling.
Hope this helps,
- Andrew
--
The right to be heard does not automatically include
the right to be taken seriously. -- Hubert H. Humphrey
- References:
- AAI and AAO Record support David Dudley
- Navigate by Date:
- Prev:
Re: AAI and AAO Record support Korhonen Timo
- Next:
RE: StreamDevice and checksum Phillip A. Sorensen
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
<2007>
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
- Navigate by Thread:
- Prev:
Re: AAI and AAO Record support Korhonen Timo
- Next:
Re: AAI and AAO Record support Dirk Zimoch
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
<2007>
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025