Back to Sealevel      

int SM_SetSoftwareAddress ( SM_HANDLE  handle,
int  slaveID 
)

Configure's a Sealevel I/O module's software selectable Modbus slave ID (Modbus devices only).

Parameters:
[in] handle Valid handle returned by SM_Open().
[in] slaveID Desired slave ID of the Modbus compliant Sealevel I/O module.
Return values:
0 Successful completion.
-1 Invalid SeaMAX handle.
-2 Connection is not established. Check the provided Connection object state.
-3 Error writing to Modbus device.
-4 Failed to perform implicit 'Get Module Configuration (0x45)
This method attempts to set the software selectable address (slave ID) of a Sealevel I/O module, whose side rotary switch is set to the '0' position. By default, setting the side switch to zero will result in a Modbus slave ID address of 247.

The 'Set Software Slave ID' Modbus function requires a security key byte, recieved by performing a 'Get Module Configuration (0x45)'. If the security key has not previously been explicitly requested , the SetSoftwareAddress() method will automatically perform the 'Get Module Configuration' function prior to executing the 'Set Software Slave ID'

Note:
If the side rotary switch is not in the zero position, this Modbus function will fail.

 
 
Generated on 18 Sep 2007.