LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Initiate LabView Program When it Receives GPS Signal

Hello, I am the OP of this discussion: https://forums.ni.com/t5/LabVIEW/High-Rate-FM-Data-Collection-Help/m-p/3892314/highlight/false#M1104...

 

I am now attempting to write code that will initiate the USRP and open the TDMS file, but will wait until exactly a minute changes according to GPS time.  For example, if I initiate the code at 5:46:26 PM, it will initiate the USRP and open the TDMS file, but not continue in the code until a signal from GPS says that the time is exactly 5:47:00 PM. 

 

I already have the ability to send GPS data to LabView, so I am simply making sure I understand how to make a program wait before the rest is executed.  I have tried using for loops, while loops, along with "tick count", "wait", and "Wait Until Multiple", and can't seem to figure out what must be fairly simple.

Any help is greatly appreciated. 

 

PS: I need the execution to be accurate within a 1/10M of a second or less, hence why I am using a signal from GPS to accurately time it's execution.  If there is anything that might misalign this accuracy such as Windows only allowing operations to execute every 10ms or something, please let me know.  Thank you.

Download All
0 Kudos
Message 1 of 6
(2,199 Views)

Never mind, I solved it by looping the initialization part of the code once, and then having the loop waiting for a given number of milliseconds before it goes ahead with the rest of the code.  Thank you.

 

Tested with a timer on my phone and apparently it is collecting data even before the initial loop finishes.  The diagram of what I have so far is attached.

0 Kudos
Message 2 of 6
(2,165 Views)

Solved the issue by initializing the USRP between the two loops.

0 Kudos
Message 3 of 6
(2,149 Views)

Are you planning on doing anything else with this code besides what you have already done?  It seems to be HUGELY unscalable.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 6
(2,139 Views)

This is the gist of what I have planned for LabView.  LabView is able to process the input signal from the GPS module, so timing is fairly correct now.  The data collected from LabView is being sent to a file which will be processed by MATLAB.  I understand that the code might still be inefficient.  If you have any knowledge that could improve the efficiency of my code, I am all ears. 

Thank you Bill.

0 Kudos
Message 5 of 6
(2,114 Views)

@fundeedoodle wrote:

This is the gist of what I have planned for LabView.  LabView is able to process the input signal from the GPS module, so timing is fairly correct now.  The data collected from LabView is being sent to a file which will be processed by MATLAB.  I understand that the code might still be inefficient.  If you have any knowledge that could improve the efficiency of my code, I am all ears. 

Thank you Bill.


While I believe in scalability and maintainability, I also believe that you should make your code as simple or complex as it needs to be; no more, no less.

 

If you envision this as all the application will ever do, it is fine to leave it this way, but if you envision adding additional responsibilities to this software, consider some form of State Machine.  If you think you might do something like adding a significant user interface, maybe you should adopt a Queued Message Handler approach.  You should be able to find both design patterns as project templates.

 

Even if you think the engineering tool is never leaving your computer... well, I've never created an engineering tool that didn't eventually become a full blown application.  😉

 

Just things to consider.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 6 of 6
(2,102 Views)