Hi Gennaro,
You can do what you want using the asynUInt32Digital support and the
@asynMask INP syntax.
record(mbbo,"Acquire") {
field(DTYP,"asynUInt32Digital")
field(OUT,"@asynMask(myPort , 0, 0x3 , 1.0) ")
field(ZRST,"Start acquire")
field(ONST,"Stop acquire")
field(ZRVL,"0x2")
field(ONVL,"0x3")
}
You can use multiple mbbo/mbbi records to access different adjacent bits in
your register using this technique.
The asyn device support uses the NOBT, SHFT, and MASK fields of the
mbbo/mbbi records documented here:
https://wiki-ext.aps.anl.gov/epics/index.php/RRM_3-14_Multi-Bit_Binary_Output
Mark
________________________________________
From: [email protected] [[email protected]] on
behalf of [email protected] [[email protected]]
Sent: Thursday, March 10, 2016 4:54 AM
To: [email protected]
Subject: mbbo/mbbi and bits subset
Hi,
I'm using mbbo and mbbi record types to write and read
some registers from/to ASYN driver I'm developing;
some registers refers to a single aspect of acquisition
(e.g. channel threshold) and with a simple mbbo record
to write and a mbbi record to read back, everything works
fine...
other registers refers to a setup/control functions
and using the same mbbo/mbbi approach works fine if
the user address (read/write) every time the whole register;
I know mbboDirect for bitwise access of a record value but
is there a method to address (read/write) through a record
a "bits subset" of a "main" mbbo record ?
e.g. acquisition control:
bit[16...2] <don't care>
bit[1...0]
11 stop acquisition
10 start acquisition
01 do something...
00 do something...
which is a simple method to access "directly" bitset [0...1]
in order to have a record I can use to write 11 (3) to stop acquisition,
10 (2) to start acquisiton and so on ?
Thanks in advance,
Gennaro
--
Gennaro Tortone
INFN Napoli
Italy
tel: +39 81 676169
"Computer Science is no more about computers
than astronomy is about telescopes."
- Edsger Dijkstra