# AT commands from a PC Application

**URL:** <https://forum.sierrawireless.com/t/at-commands-from-a-pc-application/192>\
**Category:** Open AT\
**Created:** [December 22, 2005, 5:02pm UTC](https://forum.sierrawireless.com/t/at-commands-from-a-pc-application/192 "2005-12-22T17:02:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![malek77](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@malek77](https://forum.sierrawireless.com/u/malek77)\
**Post date:** [December 22, 2005, 5:02pm UTC](https://forum.sierrawireless.com/t/at-commands-from-a-pc-application/192/1 "2005-12-22T17:02:11Z")

</div>

Hi All 🙂  
So i develop application that send At commands to modem with Visual basic in serial port with MS Comm Component.

Then the problem is that when i send to at commands one fter other like  
Ex of Code :  
//First Command  
MSComm1.Output = “AT+CSQ” & Chr$(13)  
//Second Command  
MSComm1.Output = “AT+CPIN?” & Chr$(13)

In this case for exemple the modem sometimes return error sometimes return the reposne of the second and error for the first. So i’ve not understand the problem if i must after sending the first, wait the reponse of the first before sending the second or there is other solution.

Thanks

---

<div class="post-metadata">

**Author:** ![sergiofernando](https://avatars.discourse-cdn.com/v4/letter/s/0ea827/32.png) [@sergiofernando](https://forum.sierrawireless.com/u/sergiofernando)\
**Post date:** [December 22, 2005, 5:22pm UTC](https://forum.sierrawireless.com/t/at-commands-from-a-pc-application/192/2 "2005-12-22T17:22:59Z")

</div>

Hi, first, i think you have to send both CR(13) and LF(10) characters. Each of this responses sends “OK” anfter a response, you should consider waiting for “OK” before sending another commmand.

best regards, SÃ©rgio

---

<div class="post-metadata">

**Author:** ![snoooze](https://avatars.discourse-cdn.com/v4/letter/s/f08c70/32.png) [@snoooze](https://forum.sierrawireless.com/u/snoooze)\
**Post date:** [December 23, 2005, 6:30am UTC](https://forum.sierrawireless.com/t/at-commands-from-a-pc-application/192/3 "2005-12-23T06:30:57Z")

</div>

hello,

> [@malek77](#):
>
> first, i think you have to send both CR(13) and LF(10) characters

No, its enough to send the (0x13) character after a command line. This is the terminating character specified by the S3 register (even though its not possible to change it…). However, the response from a command (if in ATV1 mode) is ended with both and .

> [@SÃ©rgio](#):
>
> So i’ve not understand the problem if i must after sending the first, wait the reponse of the first before sending the second or there is other solution.

Another solution if you want to send multiple commands is to send them all in one command line, just separate them with the ‘;’ character.  
Example:

```auto
AT+IPR=9600;&D0;&W
```

But if you want to send multiple commands that you want to take care of each result code on its own, then you really need to wait before you send the second command.

/Snoooze
