• 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.


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

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

  .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.

0
 
Kalpesh ChhatralaSoftware ConsultantCommented:
0
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:
http://www.c-sharpcorner.com/UploadFile/mahesh/WorkingWithStringsP311232005021723AM/WorkingWithStringsP3.aspx
http://msdn.microsoft.com/en-us/library/aa903372(v=vs.71).aspx
0
 
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...")
        Console.ReadKey()
    End Sub

End Module

Open in new window

0
 
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

0
 
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.
0
 
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.
0
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