12-03-2014 11:25 PM
Hey Guys,
I did a search and I couldn't find where this was answered. So, if someone has already asked this, I'm sorry.
I'm in my senior year of school and I just puchased a myRIO. I have had a few measurement classes but I'm not really fimiliar with LabVIEW at all. I'm trying to record my GPS position and acceleration for some testing.
I'm basically using the default GPS and Acceleration programs that you can download for myRIO. I have combined them and added a USB write to file program to record the data (I cannot seem to get the DAQMX to work).
From the research I have done, I appears that I need to add a VISA Write command right after my VISA configuration icon to increase the baud rate up to 38.4Kbd I'm using the following write buffer comand line $PMTK251,38400*27<CR><LF>
Once the Baud rate has been increased, then I can up the sampe rate. So, I added another VISA Write inline. the write buffer command line I'm using for this is:
$PMTK226,3,30*4<CR><LF>
The program runs fine, but the sampe rate hasn't changed with the above mentioned VISA's added. I have tried multiple Baud rate codes as well as position fixed interval codes. I have changed the loop wait times from 100 to 10 but that doesn't seem to have any affect either.
I'm assuming I'm just missing something dumb, but I cannot figure it out.
That should be all of the code for the GPS. The rest of the code that you cannot see is the Accelerometer. It is working fine now that I added the filters.
Anyhelp you can provide is greatly appreciated. I really need to get this done and I'm stuck.
12-03-2014 11:45 PM
Are you trying to run all of that on the RT processor on the myRIO or is that something you want to run on your computer to talk to the myRIO?
The code is a bit difficult to read in all of those pictures. You'd probably help us help you by posting the code.
But, here's what I'm really curious about. Why aren't you using a timed loop? If you're on the RT system, which you should be, you would want to use the timed loop over the while loop. Beyond being able to tell the loop what period you want, it also lets you set priorities so you can control what takes place if you don't have enough time to process everything. It also gives you flags to let you know if the loop is completing on time so you can troubleshoot where problems exist. If you do this, you can write your data to a buffer and pull the data from this buffer out on your host pc.
Really, you shouldn't be running into issues with 10 Hz regardless. There's a serious problem with the code if you're having this issue. 10 Hz is NOT fast for the myRIO.
12-04-2014 09:32 AM - edited 12-04-2014 09:37 AM
Basically, I'm in over my head. I needed to have this project completed by the 1st. I attached my full code (GPS_Accel_Main).
What I have done was modify code that I found that works. The PmodsGPS code, the Accelerometer code, and the USB drive code works independently. From there, I combined them into a single project. It isn’t pretty and it will need to be completely overhauled once I finish this and have time to learn what I’m doing.
Stepping back for a min. let’s just focus on the PmodsGPS portion (also, attached GPS_with_VISAs_10Hz). I have spent quite a bit of time researching what command packet code I need to broadcast. Digilent has the two that are in the file currently. I went to GlobalTop and found two slightly different codes. Neither of these seem to work.
Am I instituting the VISA wrong or do you see anything wrong with what I’m doing?
12-04-2014 09:51 AM
12-04-2014 10:24 AM
Thanks for the help Dennis.
So, I changed the <CR><LF> to \R\N but left the display as normal
And there was no change. Switched the display to "/" code displayed
And there was no change. So, I took out the extra "\" infront of the R and N. As soon as I did, the second "\" dissapeared when I clicked ouside of th text box.
No change here either. You mentioned another VISA Config. Would I add that where the first VISA write is or can I change the VISA Config Serial Port to 38400 and be done with it?
Again, I appreciate the help!
12-04-2014 10:41 AM
12-04-2014 10:55 AM
Ok, made it lower case, tried it all three ways like before. When I do the "/" code display with the lower case r and n, I'm getting the following error
The code looks like this
I figured that maybe it is something in the Baud Rate, so I removed it and I'm still getting the same error
This is one of the pdf's that I found while researching http://www.adafruit.com/datasheets/PMTK_A11.pdf
It mentions a PMTK 220 (bottom of page 8 and top of page 9). What is the difference between the 220 and 226?
12-04-2014 11:45 AM
12-04-2014 11:52 AM
Thank you so much for all of your help!!!
So, I added it back in, ran the program and got the same error (as expected). I unplugged the power to the myRIO for probably 10 seconds, and then plugged it back in.
I'm still getting the same error. Is that what you meant by cycling the power or is there a comand I need to be using?
here is how the code looks now.
12-04-2014 12:04 PM