Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Feasibility of generating RS232 using DAQmx?

Solved!
Go to solution

I am interfacing with a legacy PIC device that has an RS232 interface.  I need to generate the RS232 messages through DAQmx because I will have 8 PIC devices and only one serial port in a PXI chassis controller.  I also do not want to have extra cabling.  I already am using a NI PXIe-6363 for SPI, IEEE 1149.1 and I figured I may as well just generate RS232 to communicate with the PIC.  

 

Does anyone have any examples of generating RS232 with DAQmx?  Do you see any potential issues with going down this path?

0 Kudos
Message 1 of 8
(4,408 Views)

Two issues:

1. RS-232 can use voltages from +/-6 V to +/-12 V.  I did not check the 6363 specs but many DAQ devices only have +/-10 V AO ranges.

2. The current requirements may be higher than the AO lines can handle.

 

Lynn

0 Kudos
Message 2 of 8
(4,401 Views)

You might be able to find some chips to convert digital lines into RS-232 levels, but I doubt you could get the bit rate right.  As already said, I don't think you will have the current capability needed.

 

Might I recommend the PXI-8430/8 or the PXIe-8430/8.  These two guys are 8 RS-232 ports in a single PXI(e) card.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 8
(4,396 Views)

Lynn,

 

Thank you for the reply.  I will be interfacing to eight PIC16F887 (Microchip Microcontroller) via the Rx/Tx pins using the NI 6361 I/O pins.  The Rx/Tx pins are Schmidtt Trigger CMOS inputs and have very high input impedance.  The VDD voltage level will be 5.0V, which matches the NI 6361 TTL output voltage levels.  I don't believe I will have a problem with current drive.  Even if I do, I can include buffers inbetween the PIC and DAQ card.

 

-Philip

0 Kudos
Message 4 of 8
(4,363 Views)

crossrulz,

Thank you for the reply and the tip on the PXIe-8430. That instrument will probably work for me if I can fit it in the PXI chassis.  Right now I don't have an open slot.  Ideallly I could use my existing instrumentation without adding another if possible. 

 

Assuming current isn't an issue per my reply to the previous comment, why do you think I will not be able to get the bit rate right?  My application is not a general RS232 replacement but a very specific interface to a specific PIC microcontroller (PIC16F887).  As far as I understand it, I just need to generate or digitize the serial data and send it out the DAQ at the necessary frequency while reading the data coming back.

 

I'm assuming the operation isn't much different than a SPI operation. Perhaps I am looking at this too simplistically.  I appreciate your feedback, which is why I posted the question in the first place.  Perhaps I am missing something...

 

 

0 Kudos
Message 5 of 8
(4,362 Views)
Solution
Accepted by topic author philip.timson

Philip,

 

OK. When you say RS-232, you get a set of specifications for voltage, current, character framing, hand shaking and so on. What you are doing is using the framing portion without the physical parts.  There is no good term for that as far as I know. 

 

If you have available a pair of digital ports (one input and one output) you can probably use those for your communication. Use one bit of each port for each of the 8 channels. If you use a common clock for the UART at the PIC end and as a digital sampling clock at the DAQ end, it should be fairly straighforward to acquire and send the data. Of course you would need to write, or find someone who already has, the software to encode/decode everything.

 

Lynn

0 Kudos
Message 6 of 8
(4,357 Views)

Lynn, 


Thank you for the clarification.  I plan to write the software to generate the digital data.  I was just wondering if there was something in the serial protocol that would be a monkey wrench to this idea.  I'll give it a shot.

 

Thank you for your response and advice.

 

-Philip

0 Kudos
Message 7 of 8
(4,347 Views)

Philip,

 

The serial framing specifies start and stop bits, the number of data bits, and, optionally, parity. You need to do those things the same on both ends - PIC and the host computer.

 

Anything else, such as message or packet framing is completely up to you since you have control at both ends.

 

Lynn

Message 8 of 8
(4,339 Views)