Jump to content

read and write serial port


phoenix

Recommended Posts

Hi,everyone! :rolleyes:

I am a novice in LabView and need this tool for working with managing data from different equipment. First of all, I wanted to dublicate this tool as HyperTerminal.Explaining myself,I write commands to serial port and have to read the data replied from it.I did it with help of vi given in labView with some panel done by me with appropriate commands.Now,I see all OK,but the one thing that disturbs me,I cannot stop the line that appears in "Read value" window :headbang: .It disappears and I have to stable it in the window.I made a while loop for writing and reading,may be this is a problem.May be I have to check if there is end of line like linefeed and somewhere stop my loop for displaying steadily the read value? :blink:

Pls,I would be glad if someone helps me !!!

Thanks in advance :)

Link to comment
Hi,everyone! :rolleyes:

I am a novice in LabView and need this tool for working with managing data from different equipment. First of all, I wanted to dublicate this tool as HyperTerminal.Explaining myself,I write commands to serial port and have to read the data replied from it.I did it with help of vi given in labView with some panel done by me with appropriate commands.Now,I see all OK,but the one thing that disturbs me,I cannot stop the line that appears in "Read value" window :headbang: .It disappears and I have to stable it in the window.I made a while loop for writing and reading,may be this is a problem.May be I have to check if there is end of line like linefeed and somewhere stop my loop for displaying steadily the read value? :blink:

Pls,I would be glad if someone helps me !!!

Thanks in advance :)

First of all I don't think this is the correct forum for you to be using to ask this question. It should either be in the LabVIEW General forum or the Hardware forum (which includes serial communications). It also would have helped if you had either posted an picture of your block diagram or the actual VI since without either of those we can only speculate.

It sounds like you have a loop that is doing the reading and it does indeed read and display a message fragment but then subsequent iterations of the loop either overwrite the displayed preceding fragment with the next fragment or possibly a blank text string if no message is available.

If you are not using a termination character to to determine when a complete message is available at the serial port, then you should be. Once you get that working, it is easy to display only complete messages in your display window and they won't be overwritten until the next complete message arrives. This post has a simple example of this attached. This post has a more complex example (using multiple VIs) attached.

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