Jump to content

LabVIEW & RS-232 communication


Recommended Posts

Now, I want to press "start" button, and then type "start" string, it can start receiving 0~255 A/D data from single chip. When I type "end" string in my "input string" box, it can transmit "end" to my single chip, and then single chip will stop. Why my LabVIEW can not do it? Can you help me? Thank you.

P.S.:My single chip program has already passed testing by Windows Hyper Terminal. When I type "start" string single chip can transmit 0~255 to Hyper terminal, when I type "end" string single chip will stop transmit 0~255 A/D data. Now, I just want to design a interface which it function like a Hyper Terminal.

Link to comment

QUOTE(chiupohsiang @ Jun 5 2007, 11:14 PM)

Now, I want to press "start" button, and then type "start" string, it can start receiving 0~255 A/D data from single chip. When I type "end" string in my "input string" box, it can transmit "end" to my single chip, and then single chip will stop. Why my LabVIEW can not do it? Can you help me? Thank you.

P.S.:My single chip program has already passed testing by Windows Hyper Terminal. When I type "start" string single chip can transmit 0~255 to Hyper terminal, when I type "end" string single chip will stop transmit 0~255 A/D data. Now, I just want to design a interface which it function like a Hyper Terminal.

A few things I see:

-You close your VISA reference after you write to the serial port, but before you read. You should leave the port open until you want to stop reading/writing.

-This program constantly writes whatever string is in 'input string' every iteration of the loop... So, right now, it does:

Configure Serial Port

Write String to Port

Read 8 bytes from Port

Configure Serial Port

Write String to Port

Read 8 bytes from Port

Configure Serial Port

...

Is this really what you want? I take your description to be:

Configure Serial Port

Write String to Port

Read 8 bytes from Port

Read 8 bytes from Port

...

Read 8 bytes from Port

Write 'End' String to Port

Close Serial Port

You'll need to look at the order of what you're executing. I'm guessing you'll want to put the serial read into a while loop to read the A/D data. Remember, you can also use the 'highlight execution' option to follow what your code is doing.

Link to comment
  • 1 year later...

QUOTE (Jeff Plotzke @ Jun 6 2007, 01:59 PM)

A few things I see:

-You close your VISA reference after you write to the serial port, but before you read. You should leave the port open until you want to stop reading/writing.

-This program constantly writes whatever string is in 'input string' every iteration of the loop... So, right now, it does:

Configure Serial Port

Write String to Port

Read 8 bytes from Port

Configure Serial Port

Write String to Port

Read 8 bytes from Port

Configure Serial Port

...

Is this really what you want? I take your description to be:

Configure Serial Port

Write String to Port

Read 8 bytes from Port

Read 8 bytes from Port

...

Read 8 bytes from Port

Write 'End' String to Port

Close Serial Port

You'll need to look at the order of what you're executing. I'm guessing you'll want to put the serial read into a while loop to read the A/D data. Remember, you can also use the 'highlight execution' option to follow what your code is doing.

hi u have alredy completed rs232 interfacing with hyperterminal.i m trying on dat from 2 weeks bt it showin nothin in hyperterminal.i have set baudrate of 1200 for 16mhz crystal is it k na? i m attaching both dia n code here u plz tel me wat to do?

hi...m doin my final sem pro n in dat i want to interact pc with rs232 n rs232 wil get data via 89c51.i want to create such platform in labview..can u plz suggest me hw?

i have tried for 2 weeks interfacing rs232 n 89c51 n watching output in hyperterminal bt its nt showin anything.

i m attaching hardware n code here u plz check it n tel me whr its wrng?

Link to comment

QUOTE (nature @ Mar 16 2009, 07:18 AM)

hi u have alredy completed rs232 interfacing with hyperterminal.i m trying on dat from 2 weeks bt it showin nothin in hyperterminal.i have set baudrate of 1200 for 16mhz crystal is it k na? i m attaching both dia n code here u plz tel me wat to do?

hi...m doin my final sem pro n in dat i want to interact pc with rs232 n rs232 wil get data via 89c51.i want to create such platform in labview..can u plz suggest me hw?

i have tried for 2 weeks interfacing rs232 n 89c51 n watching output in hyperterminal bt its nt showin anything.

i m attaching hardware n code here u plz check it n tel me whr its wrng?

Srry, i dn't spk/wrt th sm lngge s u (Sorry, I don't speak/write the same language as you). This is an English forum, so please write in English.

Bruce

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.