Back to Sealevel      

int SME_SetNetworkSerialParams ( SME_HANDLE  handle,
int  baudrate,
int  parity 
)

Sets the Ethernet to serial translation speed (serial output baudrate).

Parameters:
[in] handle Valid handle returned by SME_Initialize().
[in] baudrate 
[in] parity 
Return values:
0 Successful completion.
-1 Invalid SME_Initialize handle.
-2 No module selected. Call SME_SearchForModules() first.
-3 Could not get the current module's serial parameters.
-4 Invalid baudrate parameter.
-5 Invalid parity parameter.
-6 Could not set the new serial parameters.
Note:
The translation baudrate set here does not affect the rate at which any SeaI/O module sends or receives Modbus commands. It only affects the rate at which Ethernet data is translated from Modbus TCP to RTU, and back again. In order for a SeaI/O module to recieve and respond to Modbus commands, the translation baudrate must match the SeaI/O's baudrate (see SM_SetCommunications()).

The Ethernet to serial bridge only supports baudrates 1200, 2400, 4800, 9600, 19200, 38400, and 115200 with parity values none, odd, or even. Any other values than these will result in an invalid parameter return value.

Warning:
After a sucessful set of the serial parameters, this function will cause the Ethernet to serial bridge to reset for a short time while the new parameters are enabled. For bridges with statically assigned IP addresses, the reset time is only momementary. However, for DHCP assigned IP addresses, the bridge will not respond until it's IP address is re-leased from the DHCP server.
See also:
Baudrate Values, Parity Values

 
 
Generated on 18 Sep 2007.