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: 

query regarding gps receiver

hello every1,
 
I have a Novatel centimetre accuracy GPS receiver.I have written a code in Labview 8.0 for it.But it doesnt seem to obtain any data via serial port.The logic is perfectly fine since I have used it for another GPS receiver.Earlier I had used a while loop but now I have tried using a case statement.The latter is not working.The code inside the statement is not executing.I have attached the code along. Please let me know ur suggestions.
 
-innovator81
0 Kudos
Message 1 of 12
(3,410 Views)
When you start it, if the true case doesn't execute, then there isn't 144 bytes in the buffer. You should probably put the VISA Bytes at Serial Port in a while loop and then exit that if the number of bytes is what you expect. You should also probe the output to how many bytes really are available with this make and model. I hope you're not using run continuous mode.

You code needs a lot of cleanup. You have wires going in every direction and that just makes it hard to read and debug. None of those convert functions are necessary. All you have to do is right click on those constants and select representation and change them. Wire the constants directly to the Type Cast function.

The string parsing could be done a lot more efficiently too I imagine. I would like to see an actual string that is returned.

Lastly, have you tested everything with some other program such as Hyperterminal?

Message Edited by Dennis Knutson on 08-13-2006 07:38 PM

0 Kudos
Message 2 of 12
(3,408 Views)
yes I have done it with Hyperterminal and it works fine....
0 Kudos
Message 3 of 12
(3,400 Views)
An what about my other questions? Did you probe the output of VISA Bytes at Serial Port? You can use a while loop like I mentioned or just eliminate the case statement code altogether. If you just do a VISA Read with a byte count, it will automatically wait until that number of bytes are available or until the termination character is detected. Since you have the termination character enabled, I'm assuming that the instrument does send one and if it does, you don't even need to provide an exact byte count. You can just use a high number for expected bytes.
0 Kudos
Message 4 of 12
(3,389 Views)
yes i tried running the code without a while loop,but when i do that there is no data coming through the serial port..data comes only when I put a while loop with a timer delay of 1 second.In all the other cases it doesnt seem to work at all...
0 Kudos
Message 5 of 12
(3,366 Views)
Since the example you posted doesn't have a while loop, I don't know what you are refering to when you say you run it without one. When you do use a while loop, where do you put it and what is the delay between. If you get data with this while loop somewhere in your program, why can't you use that?
0 Kudos
Message 6 of 12
(3,362 Views)
thanx for replying...well I cannot use the while lop program which gives me the right results..as there is intermittent data loss which is unacceptable ...so I need to use event based programming rathen than timer based..I am attaching the while loop progam along...please let me know ur view
 
-innovator81
0 Kudos
Message 7 of 12
(3,355 Views)
As I said earlier, why don't you just put the VISA Bytes at SErial Port inside a while loop. Exit that when there are the total bytes available. Also, every time you want to do a read, don't do an initialize and close. You should only do the initialize only once at the very beginning of your program and the close when your entire program stops.
0 Kudos
Message 8 of 12
(3,349 Views)

Unfortunately it is still not working...it just isnt recognising the bytes at port..and the initialisation has been done only once...

0 Kudos
Message 9 of 12
(3,304 Views)
If VISA Bytes at Serial Port says that there are no bytes, then I would believe that there are no bytes. How do you know this receiver is transmitting? You said that you've debugged it with a different receiver. Have you tried using Hyperterminal to see if the receiver is working there? Is there some setting that you have to do to tell it to transmit?
0 Kudos
Message 10 of 12
(3,299 Views)