fCoder Home > Look RS232 > Modem programming  
fCoder SIA
fCoder SIA Look RS232 Download Order Support Cookie Policy
Look RS232
Online help
Modem Programming
Serial port
RS232 Hardware
  Modem programming with Look RS232

Programming of modems is another sphere where Look RS232 may be used. This example may be interesting for the user, as this software can be helpful for anyone who has a modem*.

*Please Note: Modem programming requires care and knowledge. Please remember that you assume all responsibility for all you are doing. In no event shall Look RS232 developers be liable for any incidental or consequential results of your actions.

Some theory: as general, programming of a modem is just performing a sequence of predetermined commands that are known as AT modem commands. Using them one can learn the version of the modem, get information on the current connection settings, administer one's connection and other available settings.

There are some ways of programming - and one of these methods is adding modem commands to Data Send Task and performing them in a queue. This way allows as well to monitor modem response time that sometimes may prove to be a very useful figure.

So let's return to the example.
Assume that we have a list of commands (you can find list of commands for your modem in modem manual) to program our modem, assume the queue look like this:
AT *C - enter command mode;
AT InI04 - connection information query;
AT &F - load factory settings;
AT *B0 - selection of terminal-modem transfer speed (DTE/DCE), 4800 bit/s;
AT &W - save configuration;
AT O - quit command mode.

Enter this queue of commands noting that each command must be closed with decimal code 13 - symbol of carriage shift. Here we can use program ability to transfer several lines at a time, the only thing to note is the necessity to put stop points after each command. So this is what you should have as a result:

Try yourself entering commands.

Next step is the selection of settings and initialization of COM port, press button to invoke port settings menu:

In COM port settings you should "Choose port", to which the modem is connected, "Transfer speed", number of "Data bits" in a byte, number of "Stop bits", "Parity control" and "Flow control". All these settings must correspond to the settings of modem that is necessary to make connection with it.
After settings are done, press OK button and, if the port specified is not busy, you will see the selected settings in the right bottom corner of the window:

For detailed description of the indicators please see help file.

Now all the commands queue can be performed by pressing only one button . But of course, one should monitor modem responses even if the programming and command selection was correct.

Another, more universal method is the use of macros. Thus, one can enter commands of different transfer speed and then forget about command formats, for example:
Assume there are transfer speeds and corresponding commands:
AT *B0 - terminal-modem transfer speed selection (DTE/DCE), 4800 bit/s;
AT *B1 - terminal-modem transfer speed selection (DTE/DCE), 9600 bit/s;
AT *B2 - terminal-modem transfer speed selection (DTE/DCE), 2400 bit/s;
AT *B3 - terminal-modem transfer speed selection (DTE/DCE), 1200 bit/s;

Let's enter them to the list of commands, try yourself writing macros. Let's write a macro for entering the last symbol of a command. At the same time let's correct out Task List. So now let's see what we have:

As you can clearly see from this example, modem speed change is now just a change of macro name. To finish, save the commands in a file and use them whenever you need.

It should be specially noted that this is just a particular case of program application using only a minor share of all its potential - "for standard use" as one might say.

Here is another example: one can not just program one's modem but communicate with other devices through it, thus clearly monitoring data sent and received that is very important in connection debugging.

Of course, this program opens wider horizons and is a valuable handy tool for professional developers of various outer devices exchanging data through COM port. A remarkable flexibility lying in multiple settings and easy interface is one the main characteristics of this software.

  Contact us
© fCoder SIA