06-03-2013 01:13 PM
I am having trouble getting LabVIEW to display the bytes I am sending from a microcontroller through an FTDI chip.
The communication specs are:
-19200 Baud
-8 bit word length
-1 stop bit
-no parity
-no flow control
I modified the write-read string demo from here to just read from the chip. I can see that some bytes were read in the 'bytes read' indicator but nothing shows up in the read buffer. Any ideas? Maybe I have something hooked up wrong or something wrong in the communication specs
Solved! Go to Solution.
06-03-2013 01:54 PM
When you say "sending from a microcontroller through an FTDI chip" do you mean you're using a PC with an FTDI-based USB to serial adapter to read serial data from your micro? If so, any reason you're not using the FTDI chip as a serial port with VISA commands? I've had success with the FTDI RS-485 adapter (once the driver is configured to 1 ms latency) using VISA commands at speeds of up to 115Kbps, but have not tried their native library. The link you sent mentions the library was for LabVIEW 7.0 or above, but 7.0 is so old now, compatibility may no longer hold. There may also be issues with the version of Windows you're running and whether it's 32- or 64-bit.
Also, what version of LabVIEW are you using?
Good luck!
Erik
06-03-2013 02:05 PM
Hi Erik,
I am using LabVIEW 2011. I am indeed using a PC with an FTDI serial adapter. I don't know why I'm not using VISA commands since I have used them in the past and am fairly comfortable with them. I'll give that a shot.
Thanks!
Isaac
06-03-2013 03:18 PM - edited 06-03-2013 03:36 PM
I have my microcontroller transmitting one byte at a time repeatadly and I set up a quick VI to try and read one byte of it but I'm getting error 1073807298. I assume this is because I am using a third party adapter. How should I configure it so that it can communicate with labview via the visa commands?
I am now seeing the report number 1073676294 (not error code) the first time I run the VI after unplugging and replugging the chip. Any ideas why?
06-03-2013 03:34 PM
It appears you're closing the port before reading it - you cannot underestimate the importance of dataflow in LabVIEW. Also, use the "VISA Configure Serial Port " VI to init the port, then perform the Read (or first check Bytes at Port, also in the VISA Serial pallette, then read the bytes as a string, and only Close your port when you're done with it. I've attached a pic of a simple example. You also have the option of setting the termination code. I left them as defaults.
06-03-2013 03:52 PM
I'm still getting the -1073807298 3rd party device error. Attached is the current VI.
06-03-2013 03:58 PM
Do you have the FTDI driver for the USB Serial Port AND USB Serial Converter driver installed? See the attachment. If so, what COM port is assigned to it? Be sure to use that com port.
06-03-2013 04:03 PM
Yes they are both installed.
06-03-2013 04:18 PM
Do you have COM21 selected? Also, your code isn't waiting on Bytes At Port - it tries to read regardless, although that won't generate the error you're seeing. Note my use of the CASE statement to only read if there are at least 1 bytes at the port, and I feed that to the input of the READ command.
Also, avoid creating constants by connecting numbers to the inputs - I notice all the coercion dots on the Init Serial Port VI. Rather, right-click on the inputs, and click "Create -> Constant", and of course, use Context Help to guide you. Using this method makes it harder to use invalid entries.
Are you using the latest FTDI drivers? What is the FTDI chipset you're using? The version I'm using is on the Windows Hardware Compatibility List, so is more likely to work. You should be able to get the latest version from FTDI's site.
Finally, what OS are you using on your PC, and what version of LabVIEW?
06-03-2013 04:25 PM
I do have COM21 selected. I just installed the FTDI drivers last week so they should be the latest one. This is the FTDI chip I am using. How do I check if it is on the Windows Hardwar Compatibility List?
Computer: Windows XP Professional
Labview 2011