From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading GPS data from a cRIO

Solved!
Go to solution

HI Tamanna,

 

I am progressing. Can you kindly post the FPGA part of the program for a quick reference if possible?

 

I have made a time critical loop having two parallel loops and trying to figure out combing the data to go together in the buffer.

 

 

Also, since i have got that 9870, is there a simpler way to use that for GPS data recording by any chance? 

 

Thanks,

 

Ajay

0 Kudos
Message 21 of 52
(2,410 Views)

Good to know that you are inching forward 🙂

 

The FPGA has nothing to do with the controller code. FPGA chip is just used to read the data off the modules, so if you are using a module to read the GPS data like ni9870 then you need to worry about your FPGA vi. Since you are talking about your Time critical loop running in your controller, you are headed in the right direction.

 

The data flows from FPGA --- > contoller --- > host. IF you are using the module in the chasis for your GPS data, it means that you are reading the data one step away from your host, and still you will have to deal with the parsing and buffering and all that in your TCL. So the bottom line is, there is no 'simpler way', and actually you have saved yourself sometime by opting to read the data from the controller than the FPGA chip. 

 

The attached file is a screen shot of my TCL loop with other stuff (the circled part is the GPS part of it). And the small sub vi which you see in the screen shot is also attached. This checks for wanted sequence and pulls out the lat, lon and all other details from it and buffers it. I have used a global varaible to pass it to the host through a TCP connection. I am not sure what type of communication method you are using between the controller and the host. This VI should atleast help you get the required info from the NMEA message and store it.

 

Please use front panels everywhere and check for the outputs at every stage, this will help you debug and implement your code much better.

 

hope you find your location from the GPS data Smiley Wink...good luck

 

--Tamanna

Download All
0 Kudos
Message 22 of 52
(2,402 Views)

HI Tamanna,

 

I think TCP connection is the next point of conern. I am geeting errors saying "wrong wire type". I am using a usual serial cable to attach from Trimble GPS to the cCRIO 9014 serial port. 

 

I am sorry for bugging you so much but some thing crop based work came up so time is an  issue.  Can we please talk for a minute, probably that will help me a lot. My no is 510-305-5410.

 

I am doing all over.

1) For all the analog channels, we have to have one loop running from FPGA to the controller.

2) Where does the GPStome velocity.vi goes? I ammissing it may be..

3) The TCL.vi screen shot is in the host machine, right? and the parse.vi is its part??

 

I will greatly appreciate your time if you could give a call?

 

Many thanks,

 

Ajay 

0 Kudos
Message 23 of 52
(2,385 Views)

"wrong wire type" means that you are connecting a differnt data type than what is expected by the function terminal, it has nothing to do with the physical type of the serial cable.

 

I think you should go around the NI site and look for knowledge base and tutorial help and understand how a basic FPGA project works. NI site is way too good for any help that you need if you have some patience....it will be worth your time. And that will help you maintain your project and maybe add some functionality later.

 

about your questions,

1.yes you can read the data from the modules in your FPGA vi using a loop. and you have to call the fpga reference in your controller code to get the data in the controller

2.  I am not sure what the "GPStome velocity.vi" is. Once you connect your GPS receiver and invoke VISA commands on the port, you are good to go.

3.  TCL gets its name as time critical loop because it  needs to be timed accurately so that the FPGA buffer does not overflow or underflow and it is the code which goes into the controller.

 

the following links will give you a better idea on the loops and TCP connection

 

CRIO programming

 

http://zone.ni.com/devzone/cda/tut/p/id/2856

http://zone.ni.com/devzone/cda/tut/p/id/3261

 

Data communication methods

http://digital.ni.com/public.nsf/allkb/48D244EC86971D3986256BD4005CCC28

 

-Tamanna

 

 

0 Kudos
Message 24 of 52
(2,376 Views)

Hi Tamanna,

 

I got the basic GPS program running and many many things are clear nowSmiley Happy. I got the basic stuff and all the other small bits and pieces.

 

I have few queries. I know I am asking too much but if you ccould please give me call or drop a mail in my mailbox to chat for few mins I will greatly appreciate.

 

Many thanks for all the help so far,

 

Ajay

 

0 Kudos
Message 25 of 52
(2,366 Views)
Hi

 

Good to know that. I think the forum is a better place to get help...post your Qs here so that you will get help from lot of people, and would help others too who might be looking for something similar.

 

--Tamanna

0 Kudos
Message 26 of 52
(2,364 Views)

Hi Tamanna,

 

Okay, 1) I am now trying to put a configure VISA, invoke read in a program and would place it under the controller itself, please correct me if I am wrong here.  I think there are two options possible a) pass the string from VISA read or b) read the string in the same program, parse it and pass the 2 variables I need ----- to the program in the host PC for writing in the data file. 2) The screen shot with time critical loop you earlier send was of the host program, so that means you are simply reading the string and passing it from the vi under the controller to the vi in the host PC. Can you explain how to do that??

 

If these two things are clear, probably I would be able to make some more headway.

 

Thanks,

 

Ajay 

0 Kudos
Message 27 of 52
(2,361 Views)

Hi Tamanna,

 

Please disregard the earlier message.

 

My point was 

1) I am now trying to put a configure VISA, invoke read in a program and would place it under the controller itself, please correct me if I am wrong here.  I think there are two options possible a) pass the string from VISA read or b) read the string in the same program, parse it and pass the 2 variables I need ----- to the program in the host PC for writing in the data file. 2) The screen shot with time critical loop you earlier send was of the program you put under the controller. Can you please explain how pass the required to global variable and to read in the host PC program??

 

If these two things are clear, probably I would be able to make some more headway.

 

 

I will greatly appreciate.

 

Ajay

0 Kudos
Message 28 of 52
(2,354 Views)
 1.passing just the wanted variables from the NMEA message is a good option than sending the whole string to the host. 

2. read and look through examples using the real time communication wizard

 

http://zone.ni.com/devzone/cda/tut/p/id/4676

 

this will collect all the time critical loop variables and put them in queues to be sent to the host.

You will need another normal priority loop or a communication managing vi which will set up the TCP connection(if you have decided on using TCP) on the controller side  and send the data to the host.

3.You will need a communication manager at the host to listen on a port and read the variables sent from the controller. 

4.The communication manager at the host will pass on the data to the final host vi where you can play around with the final data and write it into a file.

 

look for examples using a TCP connection and RT communicatin wizard.

 

There might be lot of other ways to do this stuff, When I did my project, I felt this was easy to understand and implement. You might want to look at other examples employing different ideas and pick something which might suit you.

 

 

-Tamanna

 

 

0 Kudos
Message 29 of 52
(2,331 Views)

Hi Tamanna, 

 

I have got the program up and running for the controller and I am only extracting the GPS time and putting to an indicator.  Because of time constraint I wanna go ahead with only GPS time and that too at 1 hz for this small experiment. 

 

I know for the FPGA, we call the FPGA and invoke read, and all the indicators/controls are available in the host program to write the data.

 

1) For the RT things, are the indicators available under the invoke function? If there is small example project program you have showing a complete project, that will be a great help for quick reference.  2) Is the Visa resource is the communication manager.

 

Thanks,

 

Ajay

0 Kudos
Message 30 of 52
(2,323 Views)