EdgeTech Sonar Simulator

The EdgeTech Sonar Simulator simulates receipt and processing of all commands that can be sent to the main sonar application.

The requirements for the simulator are:

Once the simulator is running, the current configuration can be examined by selecting the menu item File / Show Status. This will display a list box with all parameters that can be modified and their current values.  Pressing the Update button will refresh the display. The default parameter set on startup or reset command is defined in the Sonar.Ini file and SonarSerial.Ini (Serial Port Settings). For more details on using the simulator select this link.

You may wish to edit the Sonar.Ini file to change the master configuration type. See the comments in the file about the Config= keyword.

The sonar is controlled via a single TCP/IP socket (1600). The sonar delivers data via a second TCP/IP socket (1601). The sonar program acts as a server on both of its sockets. A topside connects to the sonar, and the sonar accepts connections from a topside. Only a single connection is supported on each socket, and when a second connection is detected the current socket is closed.

Every sonar command sent is preceded by a SonarMessageHeaderType structure. The header contains the number of bytes to follow, among other things. There are 3 types of messages, as indicated by the sonarCommand field. SONAR_COMMAND_SET sets properties of the sonar system. SONAR_COMMAND_GET will result in a reply with the requested parameter. All data coming from the sonar system to the topside is of type SONAR_COMMAND_REPLY. This includes any reply to a GET as well as data on the data socket.  The sonar will return a SONAR_COMMAND_ERROR message if the command cannot be executed.

Data is returned in JSF format (JSFDefs.h) on the data socket by default.  For backward compatibility with topsides that were developed with a previous version of Sonar, the default data format can be specified in the Sonar.ini file via the (TelemetryFormat keywords). Every data message is preceded by a SonarMessageHeaderType field, which indicates the number of bytes of segy header/data to follow.  For JSF data, the message type will be set to SONAR_MESSAGE_DATA.

All message information is expected in Intel format. So, for example, for a 32-bit word, the first byte represents the 8 LSBs. The Sonar system has currently been interfaced to both big-endian and little-endian computers, but on big-endian computers message data must be converted.

The file SonarMessages.h defines the primary messages that can be sent to the sonar. The file JSFDefs.h defines the format of  data returned from the sonar.  Here is example code to turn pinging on:

char *Message;
int Bytes;
SonarMessageHeaderType *Header;
SonarMessageLongtype *Data;

Bytes = sizeof(SonarMessageHeaderType) + sizeof(SonarMessageLongType);
Message = (char *)malloc( Bytes);

Header = (SonarMessageHeaderType *)Message;
Data = (SonarMessageLongType *)(Message + sizeof(SonarMessageHeaderType));

// Fill in the header
Header->startOfMessage = SONAR_MESSAGE_HEADER_START;
Header->version = SONAR_PROTOCOL_CURRENT_VERSION;
Header->sessionID = 0;
Header->subSystem = 0;
Header->channel = 0;
Header->sonarMessage = SONAR_MESSAGE_PING;
Header->sonarCommand = SONAR_COMMAND_SET;
Header->byteCount = sizeof(SonarMessageLongType);

// Fill in the data
Data->value = 1;

// Send the message
bytesWritten = send(socketID, (char *)Message, Bytes, 0);
free(Message);


Here is a recommended minimum set of sonar messages to send to initialize the system.  See SonarMessages.h for more details.

1) SONAR_MESSAGE_SYSTEM_RESET : Reset the sonar to default values.

2) SONAR_MESSAGE_PING_LIST (SONAR_COMMAND_GET) : Get the list of all valid pulses.

3) SONAR_MESSAGE_PING_SELECT : Select a pulse from the list returned above.

4) SONAR_MESSAGE_PING_RATE : Set the ping rate for sonar data.

5) SONAR_MESSAGE_DATA_NETWORK_WINDOW : Set the region of interest for returned data.

6) SONAR_MESSAGE_PING : Turn pinging on.

*) SONAR_MESSAGE_ALIVE (SONAR_COMMAND_GET) : Periodically verify that the sonar system is still connected and running.  This message should be sent on the data socket as well if no data has been received recently.  If replys are not received to this message then the connection to the sonar has been lost and a new socket connect should be done.  Note that due to the nature of TCP/IP sockets, the sonar cannot tell when a link has been lost.  Unplugging a network cable is a common way to loose a socket connection.


For questions about the sonar simulator you can contact Jason Sara at EdgeTech directly via phone (561)-995-7767, fax (561)-995-7761, or Email: sara@edgetech.com


More Details:

Simulator Program Descriptions

SonarMessages.h

JSFDefs.h

SidescanDefs.h

DeviceMessages.h