SAMPLE CHOICE(3P) — SUNPHIGS LIBRARY
NAME
SAMPLE CHOICE − sample the current measure of a choice device
SYNOPSIS
C Syntax
void
psamplechoice ( ws, dev, choice )
Pintws;workstation identifier
Pintdev;choice device number
Pchoice∗choice;OUT choice
FORTRAN Syntax
SUBROUTINE psmch ( WKID, CHDNR, STAT, CHNR )
INTEGERWKIDworkstation identifier
INTEGERCHDNRchoice device number
INTEGERSTATOUT status (POK, PNCHOI)
INTEGERCHNROUT choice number
Required PHIGS Operating States
(PHOP, WSOP, ∗, ∗)
DESCRIPTION
Purpose
Use SAMPLE CHOICE to sample the current measure of the specified choice device without waiting for the device trigger to fire. The device must be in SAMPLE mode. See SET CHOICE MODE and INITIALIZE CHOICE for more information.
C Input Parameters
wsWorkstation identifier. An integer specifying the workstation with which the specified choice device is associated.
devThe device number of the choice device to be sampled. See the Available Devices section of INITIALIZE CHOICE for a description of the available devices.
choiceA pointer to a Pchoice structure in which to store the CHOICE measure. Pchoice is defined in phigs.h as follows:
typedef struct {
Pchoicestatus status;
Pintchoice;
} Pchoice;
status contains the measure’s choice status. Pchoicestatus is defined in phigs.h as:
typedef enum {
PCH_OK,
PCH_NOCHOICE
} Pchoicestatus;
choice contains the measure’s choice number. This field is undefined if the status returned is PCH_NOCHOICE.
FORTRAN Input Parameters
WKIDThe workstation identifier of the workstation associated with the device.
CHDNR
The device number of the CHOICE device. See the Available Devices section of INITIALIZE CHOICE for a description of the available devices.
STATThe measure’s choice status. Valid values as defined in phigs77.h are:
• POK(OK)
• PNCHOI(NO CHOICE)
CHNRThe measure’s choice number. This value is defined only if the status returned is OK.
Execution
SAMPLE CHOICE samples the specified choice device. The device must be in SAMPLE mode. See SET CHOICE MODE and INITIALIZE CHOICE for more information.
When a device is set to SAMPLE mode, a measure process is created for the device and the device is activated. When SAMPLE CHOICE is called, the current value of the measure process for the specified device is retrieved without waiting for the device’s trigger to fire.
ERRORS
003Ignoring function, function requires state (PHOP, WSOP, ∗, ∗)
054Ignoring function, the specified workstation is not open
061Ignoring function, specified workstation is neither of category INPUT nor of category OUTIN
250Ignoring function, the specified device is not available on the specified workstation
252Ignoring function, the function requires the input device to be in SAMPLE Mode
SEE ALSO
SET CHOICE MODE (3P)
INITIALIZE CHOICE 3 (3P)
REQUEST CHOICE (3P)
GET CHOICE (3P)
INQUIRE CHOICE DEVICE STATE (3P)
Sun Release 4.0 — Last change: 12 July 1989