Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital Bidirectional Line for Asynchronous Serial Data using USB-6009?

Solved!
Go to solution

Hi,

 

I'm rather new to the LabVIEW environment so I'm a little bit confused about this.

 

I have a signal conditioner chip (MAX1452), which I'm trying to communicate with via the digital line.

 

The line is a bi-directional, half-duplex asychronous serial.

 

I'm currently attempting to set this up with a USB6009, and essentially what I'm trying to do is write some digital data (1 start bit, 8 bits, 1 stop bit, no parity, TTL logic) to the chip and read the response back. Is it possible to reconfigure a digital port on the USB-6009 from an input to an output? 

 

Or is there a better way for me to implement this?

 

Thanks.

0 Kudos
Message 1 of 8
(5,111 Views)
Solution
Accepted by topic author Gabriel Loh

Hi Gabriel,

 

It is not possible to simultaneously have a digital line on an NI product be both a digital input and output.  It is possible that using the DAQmx commands, you can create a virtual channel that is a digital output, write the data, and clear the task.  After that you can try to create a new virtual channel that is a digital input, read the data, and then clear the task.  However, the USB 6009 is a simple device, so it may not support this functionality.

 

Hope this helps get you started,

0 Kudos
Message 2 of 8
(5,089 Views)

You would need to use 2 digital lines; one for input and one for output.  Tie the two together and write your code to send on the output and read from the input.  Since the outputs of the 6009 are open collector, make sure you write a "1" to the output bit before trying to read.  This would allow the line to float so the MAX1452 can drive the line high and low. 

0 Kudos
Message 3 of 8
(5,064 Views)

Is it possible to use a FTDI device like UM232. It is a USB UART with TTL level.

 

Kees

0 Kudos
Message 4 of 8
(5,059 Views)

Cool, thanks everyone. I just got back today so I'll give them all a try and see how it goes.

0 Kudos
Message 5 of 8
(5,051 Views)

Hey Eric,

 

I'm having a little bit of trouble in the implementation of your suggestions. I need to specify a baud rate (the MAX1452 chip uses an initialisation sequence transmitted at a particular baud rate). How do I specify this baud rate in labview?

 

I thought that using the DAQmx Timing vi would do the trick, but it returns me an error saying that there are property conflicts.

 

I haven't written up the section for reading the data yet, since I'm still trying to get the writing part sorted.

 

I've attached a screenshot of what I have so far, but I'm not sure if it's correct. Suggestions/corrections?

0 Kudos
Message 6 of 8
(5,041 Views)

Hi Gabriel,

 

That is the sample clock rate. It specifies the rate at which the data will be written at. The Baud rate is associated with serial communication and specifically with VISA write and reads in LabVIEW. You will not be able to use those functions since you are attempting to serially communicate with you device trough the digital outputs of your DAQ card. I believe the baud rate is associated with the symbols per second. So if in your application one bit is a symbol then the sample rate will effective be your baud rate. If a symbol in your application is several bits then the signal frequency divided by the bits per symbol will be your baud rate. It all depends on what is a symbol in your application. I hope this helps.

 

Regards,

 

Josh Brown

 

Applications Engineer
National Instruments
0 Kudos
Message 7 of 8
(5,015 Views)

Thanks. I've swapped over to a PCIe-6536, since I had trouble getting the bits to toggle faster than 1ms. I'll repost this as a different question though, since I'm still having a little bit of trouble with the whole thing.

0 Kudos
Message 8 of 8
(5,001 Views)