Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 pin control

Is there any way to program the rs232 port to send program-specified data on a specific pin?
0 Kudos
Message 1 of 11
(4,729 Views)

Hello

Are you planning to use Measurement Studio controls for the task? Because if you are, you can use the VISA to send information via serial. 

Or you can check out the other examples that are installed with NI-VISA

Hope this helps

Bilal Durrani
NI

Bilal Durrani
NI
0 Kudos
Message 2 of 11
(4,729 Views)
thank you for your help!

yes, i will be using measurement studio controls for this. will VISA or NI-VISA allow me to control more than one pin for use in data transmission?
0 Kudos
Message 3 of 11
(4,729 Views)

Matt,

The serial hardware in your computer can only send data on one pin of the RS232 port and only receive data on one pin, with some of the other pins used for other purposes such as flow control, ground, and logic-high levels and some of the other pins unused (with no circuitry attached, so they can't be used).

If you need to connect your computer to more serial devices than you have ports for, you can add additional serial ports to your computer with National Instruments' serial cards (click here for more info).

TonyH
Measurement Studio

0 Kudos
Message 4 of 11
(4,729 Views)
Thank you very much for your response. It was very helpful.

I have a question about all of this hand-shaking from the data-transmitting-side of the port. How does it operate? Does the DTR (Data Terminal Ready)signal go high, and then the RTS (Ready to Send) go high before the data is transmitted? What signals are held high while the data is transmitted? Or are none of the signals held high during data transmission?

In addition, can this protocol be modified by VC++ software? Or is this all intrinsic to the RS232 device?
0 Kudos
Message 5 of 11
(4,729 Views)
The DTR can be controlled by software. For instance, many modems use DTR as an on-hook/off-hook signal. I don't know the details of how, though. RTS typically must be asserted for data to be transmitted and, I believe, is normally under driver control. You might be able to control that independently with software, but it probably would require writing your own serial port driver and that is not trivial.

TonyH
Measurement Studio
0 Kudos
Message 6 of 11
(4,729 Views)
Thanks again Tony for your response.

Actually, I'm looking to use a RS232 cable to control a circuit board. There are 3 control signals the RS232 cable must send to the board, and 1 output signal the RS232 cable must receive. The 3 control signals are ChipSelect, SerialClock, and DataIn. ChipSelect must be held high while SerialClock toggles and DataIn switches. In addition, the cable must receive DataOut data during these transmissions.

My current idea is to use the DTR pin for the ChipSelect, the RTS pin for SerialClk, and the Transmit pin for the DataIn signal. Then I would use the Receive pin to accept the data from the DataOut signal. Is this feasible?
0 Kudos
Message 7 of 11
(4,729 Views)
It sounds like you want to use the RS232 port for clocked digital I/O. This is not feasible for a couple of reasons. First, the RS232 clock is superimposed onto the data transmission, so you will end up with extra bits in your data transmission that are used by the RS232 circuitry for synchronization. Also, on the 9-pin RS232 variant, there is no other way to get a data clock signal. Second, RS232 typically uses a +/-12V signal, not a digital TTL or CMOS level signal like your board probably expects.

If you can, I would consider getting a digital I/O card such as a National Instruments PCI-6503 that has a timed digital I/O mode that would make this application relatively simple.

TonyH
Measurement Studio
0 Kudos
Message 8 of 11
(4,729 Views)
Thank you very much Tony. Your response has saved me a lot of trouble.

I have a new question: Is digital I/O possible via a parallel port cable for the application I've described?
0 Kudos
Message 9 of 11
(4,729 Views)
That I'm not sure about. If you do a web search on "IEEE 1284", you should be able to find detailed info.

TonyH
Measurement Studio
0 Kudos
Message 10 of 11
(4,729 Views)