LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading serial data on non-serial input

Hi,

 

We are in the process of proposing a batch mixing/formulation process. The weighing scales required for this is already in our possession. These scales communicate via RS232 as follows

 

2400, 4800, 9600 or 19200 baud

8 bits

Odd parity

1 stop bit

 

 

As we are attempting to minimise the project cost, we are thinking of using a single DIO card with ~16 IOs, which should be enough to control all of the hardware.

 

Is it possible to read serial data using a single IO input in LabVIEW (we have v8.2)? The RS232 output from the scale is continous (no handshaking), so I envisage simply connecting the GND pin and the RX pin to one of the inputs.

 

 
As I am inexperienced in LabVIEW, I am not sure how to interpret the constant stream of logic values (and check parity etc). Is this possible? Any thoughts or comments?

 

 

Best regards,

 

Simon Thomas

0 Kudos
Message 1 of 6
(3,175 Views)

Simon Thomas wrote:

simply connecting the GND pin and the RX pin to one of the inputs.


I think that will be ok. But why not connecting the TX pin also ? You may need it in the future.

Use the VISA functions in LabVIEW to communicate.

There are examples installed with LabVIEW.

Also search for "VISA" in this forum.

Ask if you need further help

0 Kudos
Message 2 of 6
(3,172 Views)

You'd be better off getting an RS-232 interface, then you can use standard serial port software, rather than writing your own. USB/RS232 ports are available cheaply now, and some PCs still have serial ports.

 

As an example of USB/serial converters, see https://www.ni.com/en-us/shop/model/usb-232.html 

In the UK it sells at under 100 pounds. I'm sure that this is less than the cost of writing your own driver.

 

Rod,

 

0 Kudos
Message 3 of 6
(3,160 Views)

Rod wrote:

You'd be better off getting an RS-232 interface, then you can use standard serial port software, rather than writing your own. USB/RS232 ports are available cheaply now, and some PCs still have serial ports.

 

As an example of USB/serial converters, see https://www.ni.com/en-us/shop/model/usb-232.html 

In the UK it sells at under 100 pounds. I'm sure that this is less than the cost of writing your own driver.

 

Rod,

 


I would have to agree with Rod here. USB to Serial converters are available for as little as $10 each online.

 

http://www.newegg.com/Product/Product.aspx?Item=N82E16812156003&cm_re=usb_serial_adapter-_-12-156-00...

 

I have used them in several Labview programs recently.

 

One of my Labview program has eight of these connected to one computer and it operates flawlessly.

 

The drivers make then look like a standard serial port to Labview, Max, and VISA so they are simple to use.

 

The hardest part is keeping them all straight as to what adaptor is what comm port.

  

Message Edited by RTSLVU on 11-06-2009 01:10 PM
========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 6
(3,138 Views)

You can't connect RS-232 lines from your scales to DIO lines of any IO card since they work at different voltage levels!!!!!!

You need at least a MAX 232 converter IC in between!

 

But like previous posters said: RS232 to USB is the best way to go.

Just in case you're from Europe: buy here Smiley Wink

0 Kudos
Message 5 of 6
(3,108 Views)

I did not realized what Simon wrote.

Of course Alain is right.

0 Kudos
Message 6 of 6
(3,098 Views)