LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I can do the WRITE but i can´t do the READ from a SERIAL port

Hello

I need to read/write from a pressure control (from GDS instruments) that has a SERIAL port (RS-232).

I’m using LABVIEW 7.1, and Windows XP Professional with SP2.

With the help of a LABView example named "Basic serial write and read.vi", I have done successfully the VISA WRITE function. I have sent a string line to the pressure control and it reacted positively. That functionality is working ok.

However, I can't do the Visa READ. The string line that it supposed to read appears blank. It doesn’t recognize anything.

What could be the problem? If I have configured the input parameters (baud rate, data bits, parity,...) in a way that it can do the Write, why doesn't LABView can also read it?

The parameters configured in the pressure control, in the PC (in device manager) and in LABVIEW are as follow:

 

Baud Rate: 4800  (The pressure control doen't suport 9600)

Data bits: 8

Parity: Odd

Stop Bits: 2

Flow control: none


What could be the problem? I dont understand.
 
Thanks In advance

Ricardo


0 Kudos
Message 1 of 23
(5,969 Views)

Are you checking the number of bytes to read at the port and wiring that value into the Read from Serial Port?

Things to look at:

1.  Using a sw like Hyperterminal, are you able to write and read (to/from) the instrument. 

2. If yes to #1, you should send a command (Write) to the serial port.  Then you should read how many bytes are available at the port to be read.  Wire this value to the read serial port.  If the value is not wired or a value of zero is wired, then it won't read anything. 

3.  If you already have a value like #2, then is there a small delay between the writing and the reading?

4.  Do you get any error or timeout messages?  Make sure the error cluster is wired to an indicator or a simple error handler.

 

 

Message 2 of 23
(5,966 Views)
I'm not sure how to use Hyperterminal

How can i check the communication

Do I need to change the com settings until anything appers in the monitor of the PC?

I do CALL and nothing appears

I have already tryed to do the communication with my calculator (TI-92) and nothing...

Could you help me?

thanks in advanced


0 Kudos
Message 3 of 23
(5,931 Views)

I should probably first ask what Operating System are you using?

Also, have you been able to communicate with the instrument using any 3rd party serial communication software?

The first step would be to have basic communication to/ from the instrument or any serial device.  So no need to change any settings for now.

Just curious... when you mention sserial communication to your calculator, do you mean from your PC?

RayR

Message 4 of 23
(5,917 Views)

Joe: I should probably first ask what Operating System are you using?

Ricardo: Windows XP professional


Joe: Also, have you been able to communicate with the instrument using any 3rd party serial communication software?

Ricardo: i think i don't understand the question very well. 3rd party serial communication software? Give me an example

                My main objective is to read from a hardware (pressure control from GDS instruments) that have a serial conection.
                I can WRITE and send instructions to the hardware from Labview but i can READ

                You (Joe) suggested  the  use  of  HYPERTERMINAL  to check  the  conection bettewn the computer and the hardware

                My problem is that i don't understant the functioning of HYPERTERMINAL

                Once i make the conection with HYPERTERMINAL should anything be show on the monitor PC

                I don't need to change the COM settings (baud rate, parity,...)


Joe: The first step would be to have basic communication to/ from the instrument or any serial device.  So no need to change any settings for now.


Joe: Just curious... when you mention sserial communication to your calculator, do you mean from your PC?

Ricardo: Yes. Connect  the  calculator  to  the  PC by a serial cable


Ricardos

0 Kudos
Message 5 of 23
(5,905 Views)
Good morning Ricardo,
 
We first need to get Hyperterminal communcating with any serial device, such as your calculator.  You can find it under:
START>Programs>Accessories>Communication>HyperTerminal
 

Message Edited by JoeLabView on 06-19-2007 08:12 AM

Message 6 of 23
(5,901 Views)

When running HyperTerminal for the 1st time, you need to set it up.  See pictures below:

Select your Country (or leave USA only if you were to use the phone feature)

Just click OK for below:

Give a usefule name a select an icon.  Typically, the first one will do (red phone).  You can recall your settings later by selecting the name you give here to open HyperTerminal later..  This is useful.

Message Edited by JoeLabView on 06-19-2007 08:24 AM

Message 7 of 23
(5,897 Views)
Select the serial port that you are using.. Most likely COM1 (could also be COM2, depending on the hardware settings... you can change this later).
 
 
Set the values as recommended by the manufacturer of the device connected to the port.

You should be ready to go.  Once you have a device connected to the port, you should be able to type something (command) in the window similar to the one below.

Usually, when first connecting / turning on a device, some sort of message appears saying the model designation of the device, etc..

Message Edited by JoeLabView on 06-19-2007 08:30 AM

Message 8 of 23
(5,896 Views)

If communications do not work.  You can change settings in the properties menu:

You first need to disconnect..

Then open the properties

Message Edited by JoeLabView on 06-19-2007 08:37 AM

Download All
Message 9 of 23
(5,892 Views)

Your PC may have multiple serial ports.  Or porst assigned differently than what is shown here.  The best location to determine this is in your control panel (next post).

It is unlikely that you need to change the 2nd Tab (settings) for now..

Message Edited by JoeLabView on 06-19-2007 08:41 AM

Download All
Message 10 of 23
(5,888 Views)