Skip to content

Commit

Permalink
Merge 93902bd into 4b848ef
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphlange committed May 20, 2020
2 parents 4b848ef + 93902bd commit bb908de
Show file tree
Hide file tree
Showing 21 changed files with 393 additions and 188 deletions.
99 changes: 63 additions & 36 deletions modules/database/src/ioc/db/dbCommonInput.pod
Expand Up @@ -85,56 +85,72 @@ support read routine normally returns the status from C<dbGetLink()>.

=head3 Input Simulation Fields

The B<SIMM> field controls simulation mode. It has either the value YES or NO.
By setting this field to YES, the record can be switched into simulation mode
of operation. While in simulation mode, input will be obtained from SIOL
instead of INP.
The B<SIMM> field controls simulation mode.
By setting this field to YES or RAW, the record can be switched into
simulation mode of operation.
While in simulation mode, input will be obtained from SIOL instead of INP.

Ths B<SIML> specifies the simulation mode location. This field can be a
The B<SIML> field specifies the simulation mode location. This field can be a
constant, a database link, or a channel access link. If SIML is a database or
channel access link, then SIMM is read from SIML. If SIML is a constant link
then SIMM is initialized with the constant value but can be changed via
dbPuts.
then SIMM is initialized with the constant value, but can be changed via
database or channel access puts.

Ths B<SVAL> field contains the simulation value. This is the record's input
The B<SVAL> field contains the simulation value. This is the record's input
value, in engineering units, when the record is switched into simulation mode,
i.e. when SIMM is set to YES.
i.e., SIMM is set to YES or RAW. If the record type supports conversion,
setting SIMM to RAW causes SVAL to be written to RVAL and the conversion to
be done.

The B<SIOL> field is a link that can be used to fetch the simulation value. The
link can be a constant, a database link, or a channel access link. If SIOL is a
database or channel access link, then SVAL is read from SIOL. If SIOL is a
constant link then SVAL is initialized with the constant value but can be
changed via dbPuts.
changed via database or channel access puts.

The B<SIMS> field specifies the simulation mode alarm severity. When this
field is set to a value other than NO_ALARM and the record is in simulation
mode, it will be put into alarm with this severity and a status of SIMM.
mode, it will be put into alarm with this severity and a status of SIMM_ALARM.

=head3 Simulation Mode for Input Records
The B<SDLY> field specifies a delay (in seconds) to implement asynchronous
processing in simulation mode. A positive SDLY value will be used as delay
between the first and second phase of processing in simulation mode.
A negative value (default) specifies synchronous processing.

An input record can be switched into simulation mode of operation by setting
the value of SIMM to YES or RAW. During simulation, the record will be put
into alarm with a severity of SIMS and a status of SIMM_ALARM. While in
simulation mode, input values will be read from SIOL instead of INP:
The B<SSCN> field specifies the SCAN mechanism to be used in simulation mode.
This is specifically useful for 'I/O Intr' scanned records, which would
otherwise never be scanned in simulation mode.

-- (SIMM = NO?) INP (if supported and directed by device support, -> RVAL -- convert -> VAL), (else -> VAL)
/
=head3 Simulation Mode for Input Records

An input record can be switched into simulation mode of operation by setting
the value of SIMM to YES or RAW.
During simulation, the record will be put into alarm with a severity of SIMS
and a status of SIMM_ALARM.

-- (SIMM = NO?)
/ (if supported and directed by device support,
/ INP -> RVAL -- convert -> VAL),
(else INP -> VAL)
SIML -> SIMM

\
-- (SIMM = YES?) SIOL -> SVAL -> VAL
-- (SIMM = YES?) SIOL -> SVAL -> VAL
\
-- (SIMM = RAW?) SIOL -> SVAL -> RVAL -- convert -> VAL

A record can be switched into simulation mode of operation by setting the
value of SIMM to YES. During simulation, the record will be put into alarm
with a severity of SIMS and a status of SIMM_ALARM. While in simulation mode,
input values, in engineering units, will be obtained from SIOL instead of INP.
Also, while the record is in simulation mode, there will be no raw value
conversion and no calls to device support when the record is processed.
If SIMM is set to YES, the input value, in engineering units, will be obtained
from SIOL instead of INP and directly written to the VAL field.
If SIMM is set to RAW, the value read through SIOL will be truncated and
written to the RVAL field, followed by the regular raw value conversion.
While the record is in simulation mode, there will be no calls to device
support when the record is processed.

Normally input records contain a private readValue() routine which performs
If SIOL contains a link, a TSE setting of "time from device" (-2) is honored
in simulation mode by taking the time stamp from the record that SIOL points
to.

Normally input records contain a private C<readValue()> routine which performs
the following steps:

=over
Expand All @@ -159,19 +175,30 @@ return code, and return.

=item *

If SIMM is YES, then call C<dbGetLink()> to read the input value from SIOL
into SVAL. If success, then set VAL to SVAL and UDF to FALSE and set status to
2 (don't convert) if input record supports conversion. If SIMS is greater than
zero, set alarm status to SIMM and severity to SIMS. Set status to the return
code from recGblGetLinkValue and return.
If SIMM is YES or RAW, then

=over

=item *

If SIMM is RAW, then call C<dbGetLink()> to read the input value from SIOL
into SVAL. If success, then set RVAL to SVAL and UDF to FALSE and set status
to 0 (convert) if input record supports conversion. If SIMS is greater than
zero, set alarm status to SIMM and severity to SIMS. Set status to the return
code from recGblGetLinkValue and return.
Set alarm status to SIMM_ALARM and severity to SIMS,
if SIMS is greater than zero.

=item *

If the record simulation processing is synchronous (SDLY < 0) or the record is
in the second phase of an asynchronous processing, call C<dbGetLink()>
to read the input value from SIOL into SVAL.
Set status to the return code from C<dbGetLink()>.
If the call succeeded and SIMM is YES, write the value to VAL and set the
status to 2 (don't convert),
if SIMM is RAW and the record type supports conversion, cast the value to RVAL
and leave the status as 0 (convert).

Otherwise (record is in first phase of an asynchronous processing), set up a
callback processing with the delay specified in SDLY.

=back

=item *

Expand Down
50 changes: 39 additions & 11 deletions modules/database/src/ioc/db/dbCommonOutput.pod
Expand Up @@ -142,27 +142,36 @@ If IVOA not one of the above, an error message is generated.
=back


=head3 Simulation Fields
=head3 Output Simulation Fields

The B<SIMM> field controls simulation mode. It has either the value YES or NO.
By setting this field to YES, the record can be switched into simulation mode
of operation. While in simulation mode, output will be forwarded through SIOL
instead of OUT.

Ths B<SIML> specifies the simulation mode location. This field can be a
The B<SIML> field specifies the simulation mode location. This field can be a
constant, a database link, or a channel access link. If SIML is a database or
channel access link, then SIMM is read from SIML. If SIML is a constant link
then SIMM is initialized with the constant value but can be changed via
dbPuts.
then SIMM is initialized with the constant value, but can be changed via
database or channel access puts.

The B<SIOL> field is a link that the output value is written to when the record
is in simulation mode.

The B<SIMS> field specifies the simulation mode alarm severity. When this
field is set to a value other than NO_ALARM and the record is in simulation
mode, it will be put into alarm with this severity and a status of SIMM.
mode, it will be put into alarm with this severity and a status of SIMM_ALARM.

=head3 Simulation Mode
The B<SDLY> field specifies a delay (in seconds) to implement asynchronous
processing in simulation mode. A positive SDLY value will be used as delay
between the first and second phase of processing in simulation mode.
A negative value (default) specifies synchronous processing.

The B<SSCN> field specifies the SCAN mechanism to be used in simulation mode.
This is specifically useful for 'I/O Intr' scanned records, which would
otherwise never be scanned in simulation mode.

=head3 Simulation Mode for Output Records

An output record can be switched into simulation mode of operation by setting
the value of SIMM to YES. During simulation, the record will be put into alarm
Expand Down Expand Up @@ -198,14 +207,33 @@ return code, and return.

=item *

If SIMM is YES, then call C<dbPutLink()> to write the output value from VAL or
OVAL to SIOL. Set alarm status to SIMM and severity to SIMS, if SIMS is
greater than zero. Set status to the return code from C<dbPutLink()> and
return.
If SIMM is YES, then

=over

=item *

Set alarm status to SIMM_ALARM and severity to SIMS,
if SIMS is greater than zero.

=item *

If the record simulation processing is synchronous (SDLY < 0) or the record is
in the second phase of an asynchronous processing, call C<dbPutLink()>
to write the output value from VAL or OVAL to SIOL.

Otherwise (record is in first phase of an asynchronous processing), set up a
callback processing with the delay specified in SDLY.

=item *

Set status to the return code from C<dbPutLink()> and return.

=back

=item *

If SIMM not one of the above, a SOFT alarm with a severity of INVALID is
If SIMM is not YES or NO, a SOFT alarm with a severity of INVALID is
raised, and return status is set to -1.

=back
17 changes: 13 additions & 4 deletions modules/database/src/std/rec/aaiRecord.dbd.pod
Expand Up @@ -127,11 +127,20 @@ into the array.

=fields VAL, BPTR, NORD

The following fields are used to operate the array analog input record in the
simulation mode. See L<Simulation Mode> for more information on the simulation
mode fields.
=head3 Simulation Mode Parameters

=fields SIOL, SIML, SIMM, SIMS
The following fields are used to operate the record in simulation mode.

If SIMM (fetched through SIML) is YES, the record is put in SIMS
severity and the value is fetched through SIOL.
SSCN sets a different SCAN mechanism to use in simulation mode.
SDLY sets a delay (in sec) that is used for asynchronous simulation
processing.

See L<Input Simulation Fields|dbCommonInput/Input Simulation Fields>
for more information on simulation mode and its fields.

=fields SIML, SIMM, SIOL, SIMS, SDLY, SSCN

=begin html

Expand Down
17 changes: 13 additions & 4 deletions modules/database/src/std/rec/aaoRecord.dbd.pod
Expand Up @@ -127,11 +127,20 @@ the output,

=fields VAL, BPTR, NORD

The following fields are used to operate the array analog output record in the
simulation mode. See L<Simulation Mode> for more information on the simulation
mode fields.
=head3 Simulation Mode Parameters

=fields SIOL, SIML, SIMM, SIMS
The following fields are used to operate the record in simulation mode.

If SIMM (fetched through SIML) is YES, the record is put in SIMS
severity and the value is written through SIOL.
SSCN sets a different SCAN mechanism to use in simulation mode.
SDLY sets a delay (in sec) that is used for asynchronous simulation
processing.

See L<Output Simulation Fields|dbCommonOutput/Output Simulation Fields>
for more information on simulation mode and its fields.

=fields SIML, SIMM, SIOL, SIMS, SDLY, SSCN

=begin html

Expand Down
37 changes: 12 additions & 25 deletions modules/database/src/std/rec/aiRecord.dbd.pod
Expand Up @@ -441,35 +441,22 @@ monitoring functionality.
interest(3)
}

=head3 Simulation Mode
=head3 Simulation Mode Parameters

The record provides several fields to support simulation of absent hardware.
If the SIML field is set it is used to read a value into the SIMM field, which
controls whether simulation is used or not:
The following fields are used to operate the record in simulation mode.

=over

=item *
SIMM must be zero (C<NO>) for the record to request a value from the device
support.

=item *
If SIMM is C<YES> and the SIOL link field is set, a simlated value in
engineering units is read using the link into the SVAL field, from where it will
subsequently be copied into the VAL field.

=item *
If SIMM is C<RAW> the SIOL link is still read into SVAL, but is then truncated
and copied into the RVAL field.
The L</Units Conversion> process described above is then followed to transform
the simulated raw value into engineering units.

=back
If SIMM (fetched through SIML) is YES or RAW, the record is put in SIMS
severity and the value is fetched through SIOL (buffered in SVAL).
If SIMM is YES, SVAL is written to VAL without conversion,
if SIMM is RAW, SVAL is trancated to RVAL and converted.
SSCN sets a different SCAN mechanism to use in simulation mode.
SDLY sets a delay (in sec) that is used for asynchronous simulation
processing.

The SIMS field can be set to give the record an alarm severity while it is in
simulation mode.
See L<Input Simulation Fields|dbCommonInput/Input Simulation Fields>
for more information on simulation mode and its fields.

=fields SIML, SIMM, SIOL, SVAL, SIMS
=fields SIML, SIMM, SIOL, SVAL, SIMS, SDLY, SSCN

=cut

Expand Down
20 changes: 19 additions & 1 deletion modules/database/src/std/rec/aoRecord.dbd.pod
Expand Up @@ -228,7 +228,7 @@ a complete explanation of monitors.

=fields ADEL, MDEL

=head3 Run-time and Simulation Mode Parameters
=head3 Run-time Parameters

These parameters are used by the run-time code for processing the
analog output. They are not configurable. They represent the current
Expand Down Expand Up @@ -259,6 +259,24 @@ processing.

=fields ORAW, RBV, ORBV, LALM, ALST, MLST, INIT, PBRK, LBRK, PVAL, OMOD

=head3 Simulation Mode Parameters

The following fields are used to operate the record in simulation mode.

If SIMM (fetched through SIML) is YES, the record is put in SIMS
severity and the value is written through SIOL, without conversion.
SSCN sets a different SCAN mechanism to use in simulation mode.
SDLY sets a delay (in sec) that is used for asynchronous simulation
processing.

See L<Output Simulation Fields|dbCommonOutput/Output Simulation Fields>
for more information on simulation mode and its fields.

=fields SIML, SIMM, SIOL, SIMS, SDLY, SSCN

=cut


The following fields are used when the record is in simulation mode. See
L<Fields Common to Output Record Types|dbCommonOutput/Simulation Fields> for
more information on these fields.
Expand Down

0 comments on commit bb908de

Please sign in to comment.