LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read from Serial Port

Hi Chris,

This is what I did.

First I used Hyperterminal and typed

1R(IP) *enter*

I got back
*1 

This indicates the stage is in position (*0 otherwise).

Next I disconnected Hyperterminal and ran my Labview program. I sent out 1R(IP)\r and tried to read serial buffer. Unfortunately I got exactly what I typed. 😞

0 Kudos
Message 11 of 27
(1,757 Views)
Ok I just tried what you suggested.

When I type in 1G\r and read the buffer I got 1G\r. It looks like Labview has loopback set?

Is there any way I can change that? Thanx.
0 Kudos
Message 12 of 27
(1,756 Views)
Labview can't set loopback by itself.  Usually a specific command has to be sent to a device so that the device can set up itself into loopback.  Check your com port settings, compare them to Hyperterminal.  Check the baud rate, parity, stop bits, etc...  If they are the same, then try the modified vi attached.  I added a wait for bytes at port in between your write to port and read from port.  Also, I got rid of your sequence structure because it is not needed and it just hides some code.  Now you can see the whole code in one window.
- tbob

Inventor of the WORM Global
0 Kudos
Message 13 of 27
(1,745 Views)
Hi tbob, thanx.

I use Labview 6.1 so I can't open your VI. Could you convert it to 6.1? Thanx.
0 Kudos
Message 14 of 27
(1,741 Views)
I just looked at your vi again.  You have the termination character disabled.  Are you sure that this is correct?  Try changing the False constant to True.
- tbob

Inventor of the WORM Global
0 Kudos
Message 15 of 27
(1,740 Views)
Here is a picture of the block diagram.

Message Edited by tbob on 08-19-2005 09:57 AM

- tbob

Inventor of the WORM Global
0 Kudos
Message 16 of 27
(1,739 Views)

Hi Honeywell,
I still suspect that the problem is with your instrument since to get a loopback test to work, you have to physically wire it to do so.  It is mainly a test to check to see if your port is working properly.  I did run your program on my machine and my instrument responded correctly.  Do you have another instrument you can try on this program and possibly another computer with LabVIEW that you can try your program on?  You may also want to recreate your program in a blank VI just to make sure there is not a problem somewhere in the VISA functions.  Sometimes small conflicts are resolved by recreating the program.  Luckily, your program is not too large.  Also, you can try the example program "Basic Serial Write and Read" which can be found in the Example Finder in LabVIEW by searching for "serial" from the search tab.  This program is already set up to simply send a command and receive the data back.  Let me know if you have any questions!  Good luck!

Chris R.
Applications Engineer
National Instruments

Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 17 of 27
(1,738 Views)
Also, you say you've tried a CR and a LF. What about sending both? What does the instrument manual say is the correct termination character? What is the make and model number of the instrument? Post that information and you might find someones who's used that. If you have an electronic version of the manual you can post that or give a link to it.
0 Kudos
Message 18 of 27
(1,720 Views)
I'm trying to control a Parker MX80S linear stage system with 2 Vix250IE controllers.

I have an existing VI that can move the stage system fine. Right now I basically need to create another VI so I can detect to see if the stage is in position before I move it again.


0 Kudos
Message 19 of 27
(1,714 Views)
Here's the VI that moves the stage...


0 Kudos
Message 20 of 27
(1,656 Views)