10-12-2011 08:10 PM
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.
Solved! Go to Solution.
10-13-2011 05:26 PM
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,
10-17-2011 06:41 AM
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.
10-17-2011 09:43 AM
Is it possible to use a FTDI device like UM232. It is a USB UART with TTL level.
Kees
10-17-2011 12:43 PM
Cool, thanks everyone. I just got back today so I'll give them all a try and see how it goes.
10-17-2011 08:07 PM
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?
10-18-2011 04:05 PM
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
10-18-2011 11:49 PM
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.