Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ USB 6363 - Generate digital serial data through single DIO line

Solved!
Go to solution

Hi,

 

  I'm new with Labview, currently I purchased NI DAQ USB 6363 to generate control signals and accquire analog signals. I'd like to send serial digital data through one of the digital IOs with data rate of 30 kbps. Please see the attached for the data frame. Could anybody comment one the feasibility of this? Is there any example codes that I can refer to? Most of the examples I've looked so far deal with generating multiple line instead of 1 single line. How can I achieve this?

 

Thanks

diem

0 Kudos
Message 1 of 7
(4,518 Views)

Hey diem, 

 

There is an example which I think you might find useful in the LabVIEW help- if you go to Help » Find Examples » Hardward Input and Output » DAQmx » Digital Generation » Write Dig Port.vi

 

You will have to add timing to specify a baud rate, but this should get you started. Good luck!

 

~kgarrett

 

District Sales Engineer
0 Kudos
Message 2 of 7
(4,497 Views)

Thanks kgarrett,

 

  I've gone through those examples for several times and came up with the attach VI.

  My purpose is that:

    - I have an array of 8x8 elements, each element contains a 16-bit number.

    - I want to write the array out to only one digital line, bit by bit (LSB first), from element 1 to 64, at a rate of 30 kbps. My DAQ is USB 6363.

  This is what I do:

   - Convert the 2D array to 1D, re-arrange the array order so that the 1D array starts from 1 to 64.

   - Check every bit of the array, if TRUE, write 1 to port0 so that line 1 will have logic High. If FALSE, write 0 to port 0.

 I observe the program running and I found that it stuck at the second bit of the first element, it seems to wait for the buffer to be free or something like that. After that it runs and finishes very quickly.

 

  I'm not so clear what's going on, please have a check on my VI and give me some suggestions.

 

Thanks,

diem

0 Kudos
Message 3 of 7
(4,494 Views)
Solution
Accepted by diem

Hey diem, 

 

After looking over your code, I understand what you were trying to do. Here is how I would do it. Usually we don't write code for customers, but you peaked my curiosity! Hope this helps. Good luck!

 

~kgarrett

 

District Sales Engineer
Message 4 of 7
(4,482 Views)

You piqued my interest as well--once you have the waveform to be generated (which is by far the most complicated part), simply write the entire array to the task before it starts.  This way, the data is buffered and can be deterministically clocked out. 

 

Something like this:

 

2011-03-23_160341.png

 

Best Regards,

John Passiak
0 Kudos
Message 5 of 7
(4,470 Views)

Thanks kgarrette, the way you build array and use For loop with shift register is awesome. With the help of John and a bit modification I was able to send the data I want.

 

Cheers,

diem

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

Great! Thanks diem!

 

~kgarrett

 

District Sales Engineer
0 Kudos
Message 7 of 7
(4,456 Views)