From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
03-01-2017 04:13 AM
I'm trying to read the data from a IMU chip using a MyRIO and UART and the data output is this weird string of characters. (see pic)
The block diagram is pretty simple, see picture.
What am I missing?
03-01-2017 05:46 AM
Unless this instrument is as stupid as another one I have dealt with, you have a serial port settings issue. The most common issue is Baud Rate. Also, most instruments do not use the parity and use 8 data bits. So I would set those two first and then try different Baud Rates. Unfortunately, the manual does not give must information other than it uses ASCII commands.
03-01-2017 07:58 AM - edited 03-01-2017 08:00 AM
One other thing. That error messages says you had a buffer overrun. You also have a 1 second wait in your loop. So every second, you are collecting "all the data available". Your baud rate is set for 230,400. Roughly 10 bits per byte, means you are getting ~23,040 bytes every read. The serial port buffer is probably only 4096 bytes. Thus a buffer overrun.
I believe you might be okay on your settings since you aren't getting a parity error, and it looks like you are receiving binary data.
Get rid of the 1 second wait and replace it with something much smaller. Perhaps 50 or 100 milliseconds. I would recommend getting rid of the Express VI which adds lot of overhead. The VISA Serial Configure, Read, Write, and Close VI's are all very easy to use. It is possible your Express VI is opening and closing the serial port every loop iteration. If you are trying to read a lot of data frequently (and 230,040 is a very, very high baud rate. unusually so), then you want to open the port before the loop, only read and write inside the loop, and close the port when your VI is done.
I see you have a False wired to your Stop terminal. Maybe this was just quick and easy for debugging purposes, but right now the only way to stop your VI is to use the Abort button, which is not a recommended way to end a VI.
03-01-2017 09:27 AM
This is my reply to the both of you.
Thanks for your answers!
I've tried what you suggested and replaced the UART express with the VISA parts and using different baud rates and byte count.
But I still get this weird string of characters.
Can you see from my front and block panel what is wrong?
03-01-2017 09:34 AM
You set your baud rate to 9600 (the default of the Configure Serial Port). Shouldn't that be 230400? In the manual, there is a list of valid baud rates. I recommend you go through those until you find one that works.
03-01-2017 09:37 AM - edited 03-01-2017 09:39 AM
What data do you expect to receive? If it is "binary" data, as in any byte value from 0-255 that is probably not human readable, then you will get what you are seeing. (And if you are expecting binary data, wire a False constant to the Enable Termination Character input of the Serial Configure VI.
Now your error message has changed. You don't seem to be getting buffer overruns. Your baud rate is now 9600 by default (since you didn't wire any other value into the Serial Configure.) Along with 8 data bits, 1 stop bit, no parity. Does that match you device?
The error message is "I/O error", which unfortunately isn't descriptive enough to tell you exactly what is wrong.
Have you read the device's manual?
Make your string indicator show "hex display" and see if that byte data matches anything you expect.
03-02-2017 02:52 AM
Hi Jacob,
Just a quick question: why are do trying to do everything with the low level VISA commands? I had a quick look at the manual and it looks like you would need to invest a lot of time in order to get everything working.
VectorNav has a complete .NET library on their download page taking care of the low level commands and in the folder there are even Labview examples showing how to interact with the library.
I believe the quickest way to work with the chip would be using this library, especially if you do not have a lot of experience with serial communication.
http://www.vectornav.com/support/downloads
03-02-2017 03:15 AM
Thanks for the advice!
I was able to get it to show the output as a hexcidecimal but that didn't change much.
I've come to the conclussion that I will have to use the FPGA on the MyRIO, since I must have a baud rate of 921600 to be able to read all the data I need.
I will keep this thread updated
03-02-2017 08:41 AM
Thanks for your advice.
I checked out VectorNav .NET library and it was quite insightful.
But unfortunately I can't use it, because I've to read the data through a MyRIO.
03-10-2017 02:46 AM
Quick update!
I've discovered that the wires between the IMU chip and MyRIO were defect, so I've ordered a new cable!
I hope this was the problem, but we'll see!