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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial to USB converter with GPS error

Solved!
Go to solution

Your USB-Serial adapter may not be fully configured when you issue the read...

 

See this Knowledgebase entry...

 

Error Code -1073807253 When Using VISA Read

 

Or this LAVA thread:

 

Strange error using serial porta with visa drivers

 

 


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

0 Kudos
Message 11 of 27
(1,566 Views)
Solution
Accepted by jdeters79

Are you doing this in a loop?  I don't see any way you are repeating the code.  If you have a loop, make sure you aren't configuring the serial port on every iteration of the loop.  The configuration should only be done once at the beginning of the program.

 

Your serial configure function has a lot of coercion dots.  It probably is not the cause of your problem.  But you should delete those constants and recreate them by right-clicking on the terminals of the configure serial port VI and picking Create Constant.  Then they will be the right datatype and you won't have coercion dots.

Message 12 of 27
(1,558 Views)

So, being new to LabView, I did have the "VISA Configure Serial Port" in the loop.  I removed it from the loop, and now it runs without error.  I verified it both with the USB to Serial adapter, and without (using the docking station COM port).  Thanks Ravens Fan! 

 

 

0 Kudos
Message 13 of 27
(1,551 Views)

another comment:

 

why are you reading a fixed amount of data (82 bytes), when you are getting the number of bytes available to be read?  Or did you do that for debugging purposes, only?

0 Kudos
Message 14 of 27
(1,545 Views)

The GPS unit will be spitting out far more than just the single line you are interested in, its better to concatenate all the string data from the GPS within a loop and search out for your required sentence, each time the search finds the required string delete the string data from the loop after you have extracted the portion you need to work with to avoid memory hogging within the application. I would also drop the $ symbol from the search syntax as its a wild card - Mike

0 Kudos
Message 15 of 27
(1,513 Views)

here's roughly the GPS parsing algorithm I use:

 

1) read from serial with term char enabled

-when a string is recieved:

2a) check the NMEA string ID ($GPGGA, etc.) to see if this is a string I'm interested in.

2b) compare the checksum to determine if the output is valid

 

3) if 1a and 1b, parse it into its datatype and pass it from this producer loop to a consumer loop.

 

3) repeat from 1

-Barrett
CLD
0 Kudos
Message 16 of 27
(1,494 Views)

I'm reading the GPS output using the "VISA Read" function.  Then, from the read buffer I'm searching for the $GPGGA string using the "String Subset" function.  I then parse the output ($GPGGA string) for the relevant parameters (GPS time, latitude, lat hemisphere, longitude, long hemisphere, fix, # satellites, etc...) which are displayed on the monitor and recorded to a CSV file.

0 Kudos
Message 17 of 27
(1,489 Views)

Should have mentioned that I did not enable the termination character.  The GPS transmits the entire message which contains multiple sentences (GPGGA, GPGSA, GPGSV, GPRMC, PGRMT, etc...).  This may vary depending on GPS setup instructions/config.

0 Kudos
Message 18 of 27
(1,488 Views)

Im using the Read Gps Time, Position Velocity and Course Heading example linked with an Arduino Mega 2560 to read the NMEA strings from the GPS. However, I keep getting zero bytes read in the GPS NMEA sub vi which in turn gives me an error of 1 at the Consumebefore.vi. I have no idea why it is not reading any bytes. I have the arduino initialized at the serial port 3 at a baud of 4800 and in labview every VISA serial configuration is calling 4800 baud and whenever I test my GPS it has an indicator light showing that it is locked on to satellites. Any help is appreciated? Maybe my serial port on the arduino isnt initialized correctly? I'll attach my .llb so you all can see what is going on. But I cant seem to figure it out. 

 

Thanks. 

0 Kudos
Message 19 of 27
(1,378 Views)

Hi parkerb_b,

 

Looks like you've dug up an old thread. Are you using the LabVIEW Interface for LabVIEW (LIFA) at all? You  might want to try re-posting on the Arduino discussion forum or a related Aduino forum if you want help troubleshooting the Arduino. 

 

LabVIEW Interface for Arduino 

 

Arduino Mega 2560

 

Best,

--
Peter Rifken - Field Engineer & Business Manager
Boston / North New England & Maine
0 Kudos
Message 20 of 27
(1,359 Views)