LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I Sync FPGA Code and Labview Code with a timestamp?

Hello,

 

I need to synchronize a Labview Programm and a Labview FPGA program. When working with Labview 2009 alone, I can use the Windows clock as a time stamp, when I query informations from Digital Inputs (millisecond timer is ok for me).

 

Now my question: Can I program a millisecond clock with Labview FPGA running on a R-Series Board, and query the "time" from a windows Labview programm without having time gaps between the  FPGA and the PC? How fast is the transfer from FPGA to PC? 

0 Kudos
Message 1 of 2
(3,770 Views)

Hello Dr.Jeanlux,

as the FPGA is restricted to "regular" data types, the IMHO best approach would be the creation of a derived clock on the FPGA to prescale the 40MHz clock down to 2.5MHz (1/16). Then use a timed loop that is linked to this timing source to increment an integer shift register in each clock cycle and reset the counter each 2,500 counts. Another shift register integer will be incremented on each reset, and the count should be written to an indicator which is included in the timed loop. This is your millisecond "clock", starting with count (0) the very moment your FGPA application is running.

To synchronize your Windows application part with it, simply use front panel communication to query the indicator's value each time you need a timestamp in your windows application...

In case you need an absoulute timestamp for data logging, you can query your FPGA millisecond indicator from your Windows application, parallely get the windows timestamp and "memorize" the offset...

Best regards,
Sebastian

0 Kudos
Message 2 of 2
(3,735 Views)