Sensoray 2410 API Manuel d'utilisateur Page 27

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 39
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 26
Sensoray 24xx Programming Guide
23
Model 2410 Digital I/O Module
Example:
// Enable continuous capture on channels 0, 1, and 47.
u32 err = ERR_NONE;
u16 flags[3] = { 0x8000, 0, 3 };
if ( !s2410_WriteCapContinuous( sess, &err, flags ) )
printf( "Error: %s\n", s24xx_ErrorText(err) );
6.4.7 s2410_WriteCapOneshot()
Function: Enable one-shot event capture on an arbitrary set of DIO channels.
Prototype:
BOOL s2410_WriteCapOneShot( SESSION sess, u32 *err, u16 *flags );
Returns: True if the operation was successful, otherwise False is returned and
err
will contain the associated error code.
Notes: This function enables one-shot capture for any arbitrary set of digital input channels. When a channel is configured
for one-shot capture, only one event can be captured on that channel. Upon the first event capture for that channel,
capturing will be disabled and no subsequent events will be captured. This is in contrast to continuous capture
mode, in which channels remain enabled for capturing after captures have occurred.
The boolean bits in
flags[]
specify the channels that are to be affected. A boolean True enables one-shot capture
on the associated channel, while False will leave the channel’s capture mode unchanged. When this function
enables one-shot capture on a channel, the channel’s previous capture mode (i.e., disabled or continuous) is no
longer in effect.
If asynchronous event notification is enabled, the applications callback function will be called with message type
CAPMSG_ONESHOT
when the specified channels become enabled for one-shot capture.
Example:
// Enable one-shot capture on channel 8.
u32 err = ERR_NONE;
u16 flags[3] = { 0x8000, 0, 3 };
if ( !s2410_WriteCapContinuous( sess, &err, flags ) )
printf( "Error: %s\n", s24xx_ErrorText(err) );
6.4.8 s2410_WriteCapDisable()
Function: Disable event capture on an arbitrary set of DIO channels.
Prototype:
BOOL s2410_WriteCapDisable( SESSION sess, u32 *err, u16 *flags );
Returns: True if the operation was successful, otherwise False is returned and
err
will contain the associated error code.
Argument Description
sess
Session handle obtained from
s24xx_SessionOpen()
.
err
Pointer to error code. See Section 4.3.1 for details.
flags
Pointer to array that contains boolean flags for all digital input
channels. Each bit has the following meaning:
1 - enable one-shot capture on the channel.
0 - don’t modify the channel’s capture configuration.
Argument Description
sess
Session handle obtained from
s24xx_SessionOpen()
.
err
Pointer to error code. See Section 4.3.1 for details.
flags
Pointer to array that contains boolean flags for all digital input
channels. Each bit has the following meaning:
1 - disable capture on the channel.
0 - don’t modify the channel’s capture configuration.
Vue de la page 26
1 2 ... 22 23 24 25 26 27 28 29 30 31 32 ... 38 39

Commentaires sur ces manuels

Pas de commentaire