LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read data using rs-232 port

Solved!
Go to solution

Hi ,

 

I need to read data from an instrument using RS-232 serial connection. The instrument transmits the data as soon as it is turned on . the power button is on the instrument and I dont need to send any signal to transmit the data. I am using NI usb to RS232 hub as my laptop doesnt have an RS-232 port. I have tried the basic write and read.vi but am unable to get the read buffer.

Paramenter for serial port:

Bits per Second: 9600
Data Bits: 8
Parity: None
Stop Bits: 1
Flow Control: None

Data transmitter is in the below format

 

11/19/08; Pressure v0.48; UNITS=psi ; ALARMS: HP1= 0.00; LP1= 0.00; HP2= 0.00; LP2= 0.00; HP3= 0.00; LP3= 0.00; HTM= 0.00; LTM= 0.00;
Sensor 1 ID=S1-220160-1008; MAXP= 6.03; 11/14/08; PZ=-0003; CF1= 1.081; CF2= 0.953; CP1=54.00; CP2= 6.00; CCF= 1.000; CPZ=00000
Sensor 2 ID=S1-220161-1008; MAXP= 6.02; 11/14/08; PZ=00002; CF1= 1.012; CF2= 1.013; CP1=54.00; CP2= 6.00; CCF= 1.000; CPZ=00000
Sensor 3 Disconnected;
RT, P1, P2, P3, TM
10:54:09, 0.02, 0.02, -.--, 0.02,

 

Can someone help me figure out why the program is unable to read the data.

Thanks in advance,

Raghu

 

0 Kudos
Message 1 of 4
(2,538 Views)

Don't know why you don't have the VISA Bytes at Serial Port wired to the VISA Read. Do that and if you get a result of 0, you should double check the com settings and whether you are using the correct type of serial cable. The instrument manual should tell you which type - either null-modem or straight-through. I would also recomend doing your intial testing with a terminal emulation program such as Hyperterminal.

 

It would also be nice to include subVIs when attaching code. You did not include the configuration VI so impossible to know if you are doing that correctly.

0 Kudos
Message 2 of 4
(2,532 Views)
Solution
Accepted by topic author raghu670

Try running with Hyperterminal to see if you are getting anything from your device.  When Hyperterminal works, then try your VI.

You don't really need the case structure in your vi.  You wiring is hard to follow with all those bends and with segments being hidden.  Here is how your vi should look:

 

22280i4902F8A4AE744C60

- tbob

Inventor of the WORM Global
0 Kudos
Message 3 of 4
(2,522 Views)

Thanks guys,

 

I used hyperterminal and found out that the cable I am using is not right. Changed the cable and it started to work.

 

Thanks again for your info about hyperterminal

0 Kudos
Message 4 of 4
(2,493 Views)