beautypg.com

Commands, Board configuration, Getproductid – Sensoray 118 User Manual

Page 16: 6 commands, 1 board configuration

background image

Sensoray Model 118 Smart A/D™ Instruction Manual

14

Commands: Board Configuration

6 Commands

6.1 Board Configuration

6.1.1 GetProductID

Returns the Smart A/D model number. In the case of
model 118, the value 118 (decimal) is returned.

This command can be used as a diagnostic tool to help
you during application program development.

Driver

// Return the model number from a Smart A/D board.

USHORT GetProductID( USHORT BasePort )

{

SendByte( BasePort, CMD_EXTENDED );

SendByte( BasePort, XCMD_GET_PRODUCTID );

SendByte( BasePort, 0 );

return (USHORT) ReadWord( BasePort );

}

Example

// Get a board’s model number.

USHORT MyModelNum = GetProductID( MyBasePort );

Command: (240),(4),(0)

Response:

(ModelNumMSB),(ModelNumLSB)

This manual is related to the following products: