Sensoray 118 Manual do Utilizador Página 25

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 38
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 24
Sensoray Model 118 Smart A/D™ Instruction Manual 23 Commands: Sensor Acquisition
6.3.2 GetAllSensors
Returns the most recent sensor data from all eight
channels, starting with channel 0. Data is returned from
all eight channels, including disabled channels. The
value returned from a disabled channel is indeterminate.
Sensor data is scaled as a function of the declared sensor
type connected to each channel. Refer to Table9 on
page36 for a list of sensor data scalars.
Driver
// Fetch sensor data from all eight Smart A/D channels into an array.
// The resulting integer data must be scaled to engineering units.
VOID GetAllSensors( USHORT BasePort, SHORT *pArray )
{
SendByte( BasePort, CMD_READ_ALL );
for ( UCHAR ch = 0; ch < 8; *pArray++ = ReadWord( BasePort, ch++ ) );
}
Example
// Read sensor data from all eight Smart A/D channels into an array, then
// return the voltage at channel 6, which is configured for 5V,200uV/bit range.
SHORT SensorData[8]; // Buffer to receive integer sensor data
GetAllSensors( MyBasePort, SensorData ); // get sensor data
// Fetch channel 6 integer sensor data from array & convert to volts.
DOUBLE Chan6volts = SCALAR_VOLTS * (DOUBLE) SensorData[6];
Command: (88)
Response: (MSB0),(LSB0),(MSB1),(LSB1),(MSB2),(LSB2),(MSB3),(LSB3),
(MSB4),(LSB4),(MSB5),(LSB5),(MSB6),(LSB6),(MSB7),(LSB7)
Vista de página 24
1 2 ... 20 21 22 23 24 25 26 27 28 29 30 ... 37 38

Comentários a estes Manuais

Sem comentários