Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Use rs232 as digital output

Hi,

 

I need 3 digital outputs to control some device. Can I implement it by using RS232 port? 

I don't have a parallel LPT port...

 

Any other idea how can I implement it without using external hardware containing a serial comunication decvice?

 

Thank alot

Avzilka

0 Kudos
Message 1 of 7
(9,106 Views)

Hey Avzilka, 

 

The RS232 port is a serial port. I realize you do not have a parallel port but do you have a serial port? What device are you working with? Does this device have a corresponding manual that you can attach? It should explain possible communication options in the device user manual. Please provide a bit more information and I would be happy to assist you. Have a great day!

 

Regards,
Jackie

DAQ Product Marketing Engineer
National Instruments
0 Kudos
Message 2 of 7
(9,092 Views)

Hi Jackie and thank you for your response,

I need to control 3 I/Os of device that I build for my university project. It will control (ON and OFF) a vacuum pump, laser diode and gas valve.

I wonder if there is any other way to control those I/Os without the need of implement serial comunication uart by CPU or FPGA.. If could I use the rs232 port as a parallel port it would be excelent, but I realize that is not possible. Is it?

 

By the way, I got LPT parallel port installed at my PC. But I rather not using it beacuse the need of flexibility to work with others PCs, and using it in the future (when LPT parallel port will rarely can be found).

 

Thanks for your help.

Avzilka

0 Kudos
Message 3 of 7
(9,085 Views)

The RS232 port does have some control/status lines, but as far as I know Windows does not allow direct access to these pins. They can be controlled via the UART only, i.e. if you establish a communication protocoll with hardware handshake the UART will control these control/status lines and it is not possible to set them to desired level. 

 

Also, the RS232 port pins different signal levels, it goes to +5V...+12VDC when in logic high state and to -5...-12VDC in low level, so you need at least a signal level converter if you want to connect a device with TTL level inputs. 

 

I think it would be much easier to use an USB controlled device with digital I/O lines, these are available ready-made and easy to operate. 

0 Kudos
Message 4 of 7
(9,077 Views)

The easiest way (for me at least) is to use serial to a PIC microcontroller.  Since you said you would rather not use the serial function, 2 bits are available using the RTS and DTR lines.  Depending on the requirements of your switching, you may be able to use just the 2 to control the 3 functions.  If, for example, the gas pump will only be on when the vacuum pump is off but the laser diode can be on at any given time, then you can easily implement the control of the 3 functions with only two control lines.

0 Kudos
Message 5 of 7
(9,076 Views)

Windows does support direct access to control signals: win32/C and the C# CLR

0 Kudos
Message 6 of 7
(4,878 Views)

Hi,

 

Like other I would use something else like a cheap USB I/O device or an Arduino.

 

But if you really want to use the serial port there is a possibility. 

You can control the handshake signals (CTS and DSR) in LabVIEW. You have to convert the voltage below and above 0V. This can be done with a RS232 receiver (1489 variant)

For the third line you could use the data, send a break and pass this through a RC filter to convert it to a '0' or a '1'

 

This will need some knowledge of electronics. If you are not in electronics read only the first line of this post.

 

Kees

0 Kudos
Message 7 of 7
(4,866 Views)