LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

send command to modem using serial port and capture the response in the labview

 

hello.

I am doing my shool project.

I want to send command to modem using serial port and get the response in the labview.

When i run my program and enter"AT", only messy code will be displayed.

can anyone help me? thanks Smiley Happy

 

45.jpg124.jpg

0 Kudos
Message 1 of 12
(3,986 Views)

Hi Dora,

 

right-click the string indicator and select "Hex display". Read the manual of your modem to understand the meaning of those bytes in the answer...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 12
(3,965 Views)

Thanks to your help.

My partner change the indicator to"hex display", then it only display some letters and numbers. It seems still cannot work properly. 

One more thing, should we add one more "stop" button to control this program?

Looking forward to your reply.

0 Kudos
Message 3 of 12
(3,951 Views)

What response are you expecting from the modem?

 

Without seeing your program, we can't comment on stop buttons.  If your VI is what is shown above and nothing else, then you don't have a single stop button right now.

0 Kudos
Message 4 of 12
(3,942 Views)

Thanks for you all. My partner got it already.Smiley Happy

I am doing send sms part.

Can anyone tell me why my program is not so steadily?

It means this program can run. But somtimes I cannot receive sms. sometimes can

未命名.jpg

 

 

 

0 Kudos
Message 5 of 12
(3,921 Views)

@Dora0512 wrote:

Thanks for you all. My partner got it already.Smiley Happy

I am doing send sms part.

Can anyone tell me why my program is not so steadily?

It means this program can run. But somtimes I cannot receive sms. sometimes can

未命名.jpg

 

 

 


Basically, it is not well-written from both a LabVIEW and a communications point of view.  Unfortunately, I can't elaborate because today is an exrtremely busy day at work.  I'm hoping this bump will prompt someone to help you with your problem.  If you could also provide us with the programmer's guide or the manual for your equipment, that would be extremely helpful.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 12
(3,911 Views)

You should use a Wait function rather than a Wait Until Next ms Multiple function.  A 1000 wired into the wait until next means it could wait anywhere from 1 to 1000 milliseconds.  It will wait until the system clock gets to the next rounded 1 second interval.  If the clock is at a 999 msec point when the Wait Until Next executes, it will only wait for 1 msec.

 

(I don't know if that would cause your problem or not.  All I know is that the function you used does not work the way you may think it does.)

0 Kudos
Message 7 of 12
(3,908 Views)

First, grab the error out wire from your VISA Serial Config VI and place this to the error in of the VISA Write command and get rid of the Sequence Structure. There's no need for it beacuse now you've enforced dataflow and your not reading back from the gauge for a response.

 

I suggest that you get rid of the Wait to Next Multiple altogether. Don't need them either if your not reading anything back. My two cents.

0 Kudos
Message 8 of 12
(3,902 Views)

Your original code looks ok. To me it looks like a baud rate mis-match between what your vi is set to (9600 or 19200) and what the modem is set to. That would explain the crazy characters.

0 Kudos
Message 9 of 12
(3,892 Views)

@Edjsch wrote:

Your original code looks ok. To me it looks like a baud rate mis-match between what your vi is set to (9600 or 19200) and what the modem is set to. That would explain the crazy characters.


I agree.  I like the original code 1000x better than the "fixed up" version.  I also agree about your diagnosis.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 10 of 12
(3,883 Views)