• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 790
  • Last Modified:

AT commands

Dear Experts,

Please help:

I have Declared
   Dim cescQuote As Char

   cescQuote = Char.ConvertFromUtf32(34)

How do i write the following AT commands using cescQuote  in VB.net

1. .WriteLine("AT+CMGF=1\r")

2. .WriteLine("AT+CMGL=\"REC UNREAD\"")

Thank you all.

1 Solution
Todd GerbertIT ConsultantCommented:
I'm not sure I understand the question...you need to know how to open a serial port?
ukconceptsAuthor Commented:
The port is opened and all those.


  .WriteLine("AT+CMGL=\"REC UNREAD\"")

The two lines above are ma problems. How do i write then out in Vb.Net such that it doesn't give me errors, prefarably using cescQuote to replace "".

Thank you.

Kalpesh ChhatralaSoftware ConsultantCommented:
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

Todd GerbertIT ConsultantCommented:
So you just need to know how strings work in VB.Net?  You're getting an error in VB.Net because of those strings, not an error response from your device?

And you're sure you mean VB.Net and not C#, right? (Tthose strings resemble C# code, and you've posted this question in the C# Zone, but you're also referring to VB.Net, which is why I'm not sure what language you're talking about).

Here's a couple tutorials that describe strings in VB.Net:
Todd GerbertIT ConsultantCommented:
Here's a silly console program that might give you a hint.

Module Module1

    Sub Main()
        Dim string1 As String

        string1 = "world"

        Console.WriteLine("Hello """ & string1 & "!""")
        Console.Write("Press any key to exit...")
    End Sub

End Module

Open in new window

käµfm³d 👽Commented:
To tack on to terbert's comment, unfortunately, in VB you can't use the "\r" or "\n" syntax. You'll have to concatenate one of VB's constants:
' Carriage return: vbCr
' Line feed:       vbLf
' CR/LF:           vbCrLf

.WriteLine("AT+CMGF=1" & vbCr)

Open in new window

Todd GerbertIT ConsultantCommented:
The syntax for using quotes in string literals is different too.

I STRONGLY recommend you have a look at some tutorials; if you don't have a good understanding  of strings I think it's going to be very difficult for you to write anything useful.
ukconceptsAuthor Commented:
I was able to sort out the technical problem from my hardware.

so i would love to award it to tgerbert for the various attempts.

Thanks everyone all the same.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now