Sensoray 2600 User Manual
Page 40

Sensoray 2600 Programming Guide
36
Gateway Action Scheduling
Prototype:
u32 S26_Sched2610_SetModes( XACT x, IOMPORT IomPort, u8 *modes );
Returns:
Error code as described in section 5.5. Zero is returned if the operation was successful.
Benchmark: 0.8 ms.
Example:
// Set DIO channel 0-7 operating modes on the 2610 at MM number 0, IOM port 2.
// Channels 0 to 5: Standard mode, channels 6 and 7: PWM mode.
u8 modes = 0xC0;
void *x = S26_SchedOpen( 0, 1 );
S26_Sched2610_SetModes( x, 2, &modes );
S26_SchedExecute( x, 1000, 0 );
7.5.8 S26_Sched2610_SetModes32()
Function:
Schedules the programming of the operating modes for DIO channels 0 to 31 on a model 2610 IOM.
Prototype:
u32 S26_Sched2610_SetModes32( XACT x, IOMPORT IomPort, u8 *modes );
Returns:
Error code as described in section 5.5. Zero is returned if the operation was successful.
Benchmark: 1.1 ms.
Notes:
This function is compatible with 7410 firmware version 1.02 or higher. Earlier firmware versions support only
eight pwm channels.
Example:
// Set DIO channel 0-31 operating modes on the 2610 at MM number 0, IOM port 2.
// Channels 6 and 7: PWM mode, all other channels: Standard mode.
u8 modes[4] = { 0xC0, 0x00, 0x00, 0x00 };
void *x = S26_SchedOpen( 0, 1 );
S26_Sched2610_SetModes32( x, 2, modes );
S26_SchedExecute( x, 1000, 0 );
7.5.9 S26_Sched2610_SetOutputs()
Function:
Schedules the programming of all 48 DIO output states on a model 2610 IOM.
Parameter
Type
Description
x
void *
Transaction handle obtained from S26_SchedOpen().
IomPort
u8
The IOM port number (on the MM) to which the target IOM is connected.
modes
u8 *
Pointer to a 1-byte application buffer that contains the channel mode flags. The byte
indicates the operating modes for DIO channels 0 to 7. Each bit is associated with a
channel number. For example, bit 4 is associated with channel 4. Set a bit to one to
operate in the PWM mode, or to zero to operate in the Standard mode.
Parameter
Type
Description
x
void *
Transaction handle obtained from S26_SchedOpen().
IomPort
u8
The IOM port number (on the MM) to which the target IOM is connected.
modes
u8 *
Pointer to a 4-byte application buffer that contains the channel mode flags. The bytes
indicates the operating modes for DIO channels 0 to 31. Each bit is associated with a
channel number. For example, bit 4 of modes[0] is associated with channel 4. Set a
bit to logic one for PWM mode, or to zero for Standard mode.