Testing a Modem - Sample Project: ModemDiagnostics.ptp

<< Click to Display Table of Contents >>

Navigation:  Examples and Tutorials >

Testing a Modem - Sample Project: ModemDiagnostics.ptp

The Docklight project ModemDiagnostics.ptp can be used to perform a modem check. A set of modem diagnostic commands are defined in the Send Sequences list.


This is a simple example for Testing a serial device or a protocol implementation. The sample project uses the communication settings listed below. This should work for most standard modems.


Communication Mode


COM Port Settings

9600 Baud, No parity, 8 Data Bits, 1 Stop Bit


Getting started


Use the Windows Device Manager to find out which COM Port is a modem device. This demo project may be used with any AT-compatible modem available on your PC, e.g. a built-in notebook modem, or a GSM or Bluetooth modem driver than can be accessed through a virtual COM port.


TIP: For a simple test without specialized hardware, add your mobile phone as Bluetooth Device on your Windows PC. Then find your phone in the Windows Devices and Printers list. Right-click on it, choose Properties and go to the Hardware tab. In the Device Functions list it should mention the modem related COM Ports.


Go to the PROPERTIES Project Settings... dialog and make sure you have selected the same COM Port for Send/Receive on comm. channel.

Press the play Start Communication button in the toolbar.

Try sending any of the predefined modem commands by pressing the Pt_Send_Button Send button


You should now receive a response from your modem, e.g. "OK" if your command was accepted, a model identification number, etc. The response will vary with the modem model.


After sending several sequences, the Docklight communication window could look like this:


07.02.2013 18:17:54.083 [TX] - ATQ0V1E0<CR><LF>


07.02.2013 18:17:54.107 [RX] - ATQ0V1E0<CR><LF>




07.02.2013 18:18:00.511 [TX] - ATI2<CR><LF>


07.02.2013 18:18:00.747 [RX] - <CR><LF>

V 11.10<CR><LF>



(c) Nokia           <CR><LF>




07.02.2013 18:18:01.393 [TX] - ATI3<CR><LF>


07.02.2013 18:18:01.421 [RX] - <CR><LF>

Nokia C2-01<CR><LF>





Further Information


The Send Sequences list includes the following standard AT modem commands:


Send Sequence

Description / Modem Response


Initializes the query.


Model identification (ITU V.250 recommendation is not supported by all modems).


Fax classes supported by the modem, if any.


Shows whether the modem supports the Rockwell voice command set.


Displays manufacturer's information for <n> = 1 through 7. This provides information such as the port speed, the result of a checksum test, and the model information. Check the manufacturer's documentation for the expected results.


The \Samples folder also contains a log file ModemDiagnostics_Logfile_asc.txt. It shows a test run where the above Send Sequences were sent to a real modem.