PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

UART communication

Solved!
Go to solution

As far as the RS232 card goes, it looks like it only does RS232, so that's not useful. If I connected that card to my device I would blow it up. See here for differences between RS-232 and TTL (I am using 3.3 VDC instead of 5 VDC, but you get the picture):

 

https://www.sparkfun.com/tutorials/215

 

As far as the DIO card goes, I think that brings this right back to my original question. I can't reset a hardware timed task fast enough, but software timing isn't reliable enough, so is it possible to use any DIO card to capture UART?

0 Kudos
Message 11 of 23
(4,062 Views)

Jo-Jo,

 

What is the maximum voltage signal you are transmitting and receiving?  Regarding your question about rearming your task software timing won't be any faster than the hardware.  Although your statement that of the RS-232 is not the same as UART is correct all NI serial hardware is UART compatible as explained before.  As long as the specs of the cards support 0-3.3VDC (which many of them do) then you should fine.

 

Thanks,

Jonathan R.
Applications Engineer
National Instruments
0 Kudos
Message 12 of 23
(4,039 Views)

The logic is 0 to 3.3.

 

I feel like maybe I wasn't clear. Yes, the DIO cards, including the one I already have, can send and receive single bytes via UART. The problem is that if you want to send several bytes via UART, the timing between bytes is not always uniform. This is why every byte starts with a sync bit. So you can trigger on the synch bit, and then your timing will be OK for that one byte. However, if you want to send multiple bytes, then the task must be able to rearm itself before the next sync bit is received, which at 115200 baud, can be as soon as 10us, or even less. I have been unable to rearm the task that quickly, so hardware timing is not possible. Also software timing is not possible, because you have to be able to read bits to about 10us of accuracy, which isn't reliable.

 

I just wanted to know if there was something I was missing, since I feel like someone must have run into this probably before, but I get the impression that I'll just have to use a USB to UART device, which is fine. I would just rather not have to use external hardware, as it is one more peice of test equipment I have to set-up, keep track of, worry about, etc.

0 Kudos
Message 13 of 23
(4,035 Views)
Solution
Accepted by topic author Jo-Jo

If you have LabVIEW FPGA, there are examples floating around that use an R Series FPGA card as a UART.  Then everything is done in hardware and you just use a DMA FIFO to send data and another for recieving.


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 14 of 23
(4,033 Views)

OK, that's makes sense.

 

Unfortunately, I'm not using the FPGA stuff for anything at the moment, so spending that much for a UART is probably not something I can justify.

 

Thanks for the answer.

0 Kudos
Message 15 of 23
(4,029 Views)

Hi, 

 

   I am interested in this problem as well. You were running at 115200 and were having issues with the timing of the sync pulse. At lower baud rates this should become less of issue. Do you think that at 57600 you would see less of an issue? I am looking at using these cards for UART as well, but my data rate is 1/2 of yours. 

 

I am curious about your opinion on this. 

 

Thanks,


Drake

0 Kudos
Message 16 of 23
(2,948 Views)

If you only want to receive a single byte you can do it. Otherwise, you will probably run into the same problems I had even at the slower speed.

 

Ideally you would use hardware timing, and start when you receive the start bit. This works fine if you only want to receive 1 byte. Unfortunately, you have to rearm the task before the next byte, and I just couldn't get it to rearm fast enough. If you have a faster controller you might be able to do it. It turns out our system is running a little slow.

 

Software timing is probably out because you aren't on a real-time system, so it is just too slow and unstable. You would be receiving a bit about every 18us. I would be surprised if you could software time that kind of rate with the card I had.

0 Kudos
Message 17 of 23
(2,942 Views)

Hi guys, I would like to know whether you find a solution for this? I would like to receive every 30 ms a frame of 9 bytes. I have a NI PXIe- 1062Q with a NI PXI-6528 isolated digital I/O board. Do you think I can use this one to only receive those frames at 9600 bauds? cheers!

0 Kudos
Message 18 of 23
(2,691 Views)

@JOSEGANDICA wrote:

Hi guys, I would like to know whether you find a solution for this? I would like to receive every 30 ms a frame of 9 bytes. I have a NI PXIe- 1062Q with a NI PXI-6528 isolated digital I/O board. Do you think I can use this one to only receive those frames at 9600 bauds? cheers!


Not a chance.  That board uses software timing, which means it only runs as fast as your software.  You will not get the speeds you need nor consistently sample properly.

 

So let's back this problem out.  What level are your UART signals?  TTL (5V digital)?  LVTTL (3.3V digital)?  RS-232?  If RS-232 just get a USB-Serial adapter, preferably from FTDI (people around here seem to have better luck with them).  If TTL or LVTTL, find a converter to change those into RS-232 and then use said USB-Serial adapter.  Then it is a simple VISA Read to get your data.


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 19 of 23
(2,689 Views)

Hi,
Thanks for your fast answer. Let me explain it better. I have used USB-serial converter successfully with visa in Labview10.. everything worked fine but my usb serial device got broken (14€ hardware so =( ) My levels are 3.3v LVTTL. Is there any board that you can install on NI PXIe-1062Q to manage TLL or LVTTL uart communication? I would like to use realiable NI hardware,

 thanks in advance

0 Kudos
Message 20 of 23
(2,687 Views)