annuler
Affichage des résultats de 
Rechercher plutôt 
Vouliez-vous dire : 

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 Compliments
Message 11 sur 27
1 971 Visites
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 Compliments
Message 12 sur 27
1 970 Visites
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 Compliments
Message 13 sur 27
1 959 Visites
Hi tbob, thanx.

I use Labview 6.1 so I can't open your VI. Could you convert it to 6.1? Thanx.
0 Compliments
Message 14 sur 27
1 955 Visites
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 Compliments
Message 15 sur 27
1 954 Visites
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 Compliments
Message 16 sur 27
1 953 Visites

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 Compliments
Message 17 sur 27
1 952 Visites
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 Compliments
Message 18 sur 27
1 934 Visites
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 Compliments
Message 19 sur 27
1 928 Visites
Here's the VI that moves the stage...


0 Compliments
Message 20 sur 27
1 870 Visites