Sensoray 2600 User Manual
Page 36

Sensoray 2600 Programming Guide
32
Gateway Action Scheduling
Prototype:
u32 S26_Sched2608_SetAout( XACT x, IOMPORT IomPort, u8 chan, double volts );
Returns:
Error code as described in section 5.5. Zero is returned if the operation was successful.
Benchmark: 0.9 ms.
Example:
// Program analog output channel 2 to 5.35V on the 2608 at MM number 0, IOM port 1.
void *x = S26_SchedOpen( 0, 1 );
S26_Sched2608_SetAout( x, 1, 2, 5.35 );
S26_SchedExecute( x, 1000, 0 );
7.4.13 S26_Sched2608_SetLineFreq()
Function:
Schedules the declaration of power line frequency to a model 2608 IOM.
Prototype:
u32 S26_Sched2608_SetLineFreq( XACT x, IOMPORT IomPort, u8 freq );
Returns:
Error code as described in section 5.5. Zero is returned if the operation was successful.
Benchmark: 0.7 ms.
Notes:
The integration period for the “integrated” adc values defaults to 16 milliseconds to help reject power line noise.
This action enables the application to change the integration period to 20 milliseconds in cases where the power
line frequency is 50 Hz.
Example:
// Declare 50 Hz line frequency to the 2608 at MM number 0, IOM port 1.
void *x = S26_SchedOpen( 0, 1 );
S26_Sched2608_SetLineFreq( x, 1, 1 );
S26_SchedExecute( x, 1000, 0 );
7.4.14 S26_2608_WriteEeprom()
Function:
Writes one data byte to the EEPROM on a model 2608 IOM.
Prototype:
u32 S26_2608_WriteEeprom(u32 hbd,IOMPORT IomPort,u32 msec,u8 addr,u8 val,u32 retries);
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.
chan
u8
Analog output channel number. Valid channel numbers range from 0 to 3 on model
2608-4, or from 0 to 7 on model 2608-8. There are no analog output channels on
model 2608-0.
volts
double
The desired output voltage: from -10.0 to +10.0.
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.
freq
u8
Enumerated line frequency: 0 = 60 Hz (default), 1 = 50 Hz.
Parameter
Type
Description
hbd
u32
MM handle.
IomPort
u8
The IOM port number (on the MM) to which the target IOM is connected.
msec
u32
Maximum time, in milliseconds, to wait for a response before declaring a time-out.
addr
u8
EEPROM memory address, in range 0x00 to 0xFF.
val
u8
Data value that is to be written to the EEPROM.
retries
u32
Maximum number of transaction retry attempts.