Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

sms sending in labview with wavecom modem

Good Day,

 

I'm using a gsm for the first time. Connecting to a wavecom m1306b via a NI USB-232. I am also using the serial communication through Max to communicate.

I've setup my parameters as such

baud:115200

Parity: None

Stop bits:1

Databits: 8

Flow control: Hardware - RTS/CTS

 

One arb point is that it only communicates if I leave the termination char as \n, I assumed I would require \r.

 

If I powerup and I can send 'AT' and receive 'OK', when I try to send an sms here's what happens

Send: AT+CMGS="xxxxxxxxxxx"             //where xxxxxxxxxxx is my mobile number to send to

Response: <                                           //as expected

Send: My first sms^z                               //I have used ^z to replace <crtl-z>... is this correct?

 

I then get no response and the modem seems to hang. Could anyone offer some advice?

 

Thanks.

 

0 Kudos
Message 1 of 9
(5,359 Views)

No, you cannot use ^. Ctrl-z is hex 1A so you could use \1A.

0 Kudos
Message 2 of 9
(5,356 Views)

Hi Dennis,

 

Thanks for the response. I tried \1A, but I still have the same issue. No sms is sent and after that, any command sent, all I get is the echo but no other response. I have to reboot the device to start getting responses again.

 

Regards

 

0 Kudos
Message 3 of 9
(5,342 Views)

Regarding using the termination char as \n or \r, this is specific to your particular device. What serial commands is your device looking for? I would recommend referring to your manual. This should also clear up your issue with "Ctrl" "Z". It sounds like this has to do with your device, rather than LV or MAX.

 

Jordan

 

 

0 Kudos
Message 4 of 9
(5,324 Views)

Hi,

Apologies for my delay, I'm back onto this now. I have managed to send an sms via the serial communicator in Max.

I have sent...

at+cmgf=1\r     (set to text mode)

at+cmgs="0123456789"\r  (set recipient number)

This\sto\sbe\sent\1A    (message - "This to be sent")

 

This works fine in Max

 

I am trying to duplicate this in my LabView code but am having problems communicating. I imagined this to be the simple process of a few VIs to send these commands.

For writing I Have set up the VISA Configue Serial Port and simply used VISA Serial Write to send each command

VISA Configure Serial Port

 - Inputs - Disabled Char Termination (I'm sending it myself)

               Resource - Comm4

               baud rate - 115200

               Flow Control - RTS/CTS

 

To Read I have set it up like below...

VISA Configure Serial Port

 - Inputs - Enable Char Termination

               Char Term - 13 (carriage return)

               Resource - Comm4

               baud rate - 115200

               Flow Control - RTS/CTS

 

I am getting no response from the modem through labview. Have I missed something obvious?

 

Regards,

Jevon

0 Kudos
Message 5 of 9
(5,299 Views)

I have reverted to using the basic serial write and read.vi in the examples until I start seeing responses via labview. Just to clarify, I do have my write string set to \ codes display. I am appending the termination character to the end of the string myself.

 

Thanks

0 Kudos
Message 6 of 9
(5,297 Views)

Ok, found a problem, When I use MAX, I'm using Com4, so I assumed I'd be using Com4 in LabView. As a lost hope resort, I flipped to Com3 while LabView and I started getting responses. Thats a little arb and I'm a little concerned about that. But gladly, I'm getting responses and can test my full code.

0 Kudos
Message 7 of 9
(5,296 Views)

I am experiencing an interesting issue, in fact I'm hitting a brick wall with this wavecom modem.

I've built the VIs, communicating using VISA with the modem goes fine, I can send an SMS which is received by the correct mobile, however the message is empty!

I'm following the right syntax terminating the message string with a 0x1A, the modem sends it out and loops back through the serial port the text string I provided, which indicates that it got it, however the message is empty.

I have tried all sorts of things, like adding a CR before the 1A, putting the string within " " but no difference.

Anyone experienced this before?

0 Kudos
Message 8 of 9
(5,270 Views)

Hi MartyNZ,

 

Are you seeing this same empty message if you try to send it in MAX also? Is it an option to use HyperTerminal to see a bit more closely what's going on?

 

Regards,

Deborah Y.

Deborah Burke
NI Hardware and Drivers Product Manager
Certified LabVIEW Architect
0 Kudos
Message 9 of 9
(5,248 Views)