LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

GSM modem

Solved!
Go to solution

kelvin tay wrote:

hi

 

I have no idea with what u means that Use VISA termination mode where you receive line after line of a response and look for characteristic patterns in that stream that indicate an end of response. Could u provide me some example? 

How can I list out the received sms of the gsm modem?

I can't read the message by now.........

 


Actually you can read them as you show in your earlier example, just not the All option since you do not use a smart method to read the variable sized messages.

 

VISA temination method is theEnable Termination Char input at the Configure Serial Port VI. Open it and look for the VISA properties it uses and read the online help for them.

Rolf Kalbermatter
My Blog
0 Kudos
Message 21 of 45
(2,004 Views)

What Rolfk is trying to explain is that you cannot use HyperTerminal and LabView at the same time. So your previous error that you posted I can tell by experience is because HyperTerminal is currently using it.

 

My Suggestion: Connect all hardware as needed. Use HyperTerminal to establish a connection and send a very simple AT command at it (preferably one that has a response). Once you are happy HyperTerminal works this means you are now ready to interface LabView with it. BUT if you find there are weird activities or issues with hyperterminal, then you are dealing with a configuration issue.

 

I've attached a very simple diagram of serial communications. Where the pink box is is where you will type in your AT command. Again as Rolfk indicated you will probably have to wire a carriage return (constant) from your string menu.

 

 

**Can't figure out how to delete this post, and I'm sorry I didn't see pages 2 and 3***

 

Good Luck!

 

Chazzzmd

Message Edited by Chazzzmd on 03-02-2010 01:40 PM
0 Kudos
Message 22 of 45
(1,978 Views)

Chazzmd,

 

That VI is completely wrong. You should not wire the output of the VISA Write to the input of VISA Read. There is absolutley no correctly between the number of bytes you have written with the number of bytes you should read.

0 Kudos
Message 23 of 45
(1,972 Views)

hi

 

how could i determine the byte that i want to read?

could u provide me some example, please?

 thank you

 

best regard

kelvin

0 Kudos
Message 24 of 45
(1,960 Views)
You use the VISA Bytes at Serial Port - just like the example program you are using. The problem with the example is the fixed delay. You really don't need any delay if you first put it in a loop that exits when the byte count is greater than zero and then go to another loop with it in and exit when the available bytes are equal to zero.
0 Kudos
Message 25 of 45
(1,948 Views)

yes, i get it..... actually i can read out the message by using the example at page 2, while i want to compare the 'words' in the sms,

but i found that it will read out also the time and date of receive sms, so how can i only read out the 'words' without date and time?

is it set the number of bytes for read VISA?

 

0 Kudos
Message 26 of 45
(1,943 Views)
The content of what you read has nothing to do with how many bytes you read. Perhaps there is a command to program the device to exclude the date time but it's simple to parse it and remove it. The string can be converted to an array with the Spreadsheet String to Array and using a comma as a separator.
0 Kudos
Message 27 of 45
(1,938 Views)
Solution
Accepted by topic author kelvin tay

Dennis Knutson wrote:
You use the VISA Bytes at Serial Port - just like the example program you are using. The problem with the example is the fixed delay. You really don't need any delay if you first put it in a loop that exits when the byte count is greater than zero and then go to another loop with it in and exit when the available bytes are equal to zero.

Actually modem communication follows a certain pattern. I would not recommend to use Bytes at Serial Port at all. Instead I would use the Termination Mode and read line by line. All responses should be terminated with an OK, CONNECT, RING, .. etc line.

 

So it is easy to read the lines after each command until you see such a line and then terminate on that. Don't make it more complicated than it is. The VISA Termination mode can actually do most of the work for receiving messages from devices that use a specific line termination character, so you don't have to worry about how many bytes to read, but simply can provide a large enough value that you will for sure read always an entire line.

Rolf Kalbermatter
My Blog
0 Kudos
Message 28 of 45
(1,925 Views)

You're absolutely right, I shouldn't post if I'm in a hurry.

 

Best Regards

0 Kudos
Message 29 of 45
(1,900 Views)

 

Hi

 

Thank you very much, finally i have success to read the receive message and compare with preset characters......

However, i still got a small problem.... My received sms is used to trigger ON my DAQ 6009 to turn on(output at digital port=5V), while turn off for next trigger(output at digital port=0V).... I need to turn ON more than one port, but i found that i can only turn ON each port and has to turn it OFF before turn ON another port......

for keep the port ON, the signal of the arrow must be always true, Could I change it to turn ON always for only one pulse trigger(True) and turn OFF for next trigger(True)?

Look forward your reply eagerly.....

Thanks

 

Best regard

kelvin

Untitled.png

   

0 Kudos
Message 30 of 45
(1,884 Views)