SonTek_RS232 demonstrates reading the SonTek RS232 sensor

SonTek_RS232.py

SonTek_RS232.get_data()

This routine is called by all measurements that need data from sontek. A single call populates values needed by measurements into global variables. Multiple calls to this routine within 5 seconds will only update the global variables once. This is to prevent opening and closing the port too rapidly which might impact the buffers and create bad data. A -999999.2 in log indicates sontek did not produce an expected response to command.

SonTek_RS232.sontek_Velocity_east_depth_1(arg)
SonTek_RS232.sontek_com(command, sontek)
SonTek_RS232.sontek_pressure(arg)
SonTek_RS232.sontek_sync_time()

sync sontek time to sl3 time.

SonTek_RS232.sontek_temperature(arg)