LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically change unit of time in a wait function?

Currently using LabVIEW FPGA. I have a wait function that I want to make totally configurable, is there a way to programmatically change the units the wait function uses? Something like changing from milliseconds to ticks from a front panel.

0 Kudos
Message 1 of 3
(1,109 Views)

@markel580 wrote:

Currently using LabVIEW FPGA. I have a wait function that I want to make totally configurable, is there a way to programmatically change the units the wait function uses? Something like changing from milliseconds to ticks from a front panel.


It's all (simple) math.

 

You can't make the wait programmable, but you can make your own wait with an enum as input.

 

For instance, if you're waiting for ticks, and want to provide ms:

 

50 ms  X 40 Mhz = 50 X 40000 = 200000 ticks.

 

Assuming you're running on 40 MHz.

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

wiebe@CARYA wrote:

@markel580 wrote:

Currently using LabVIEW FPGA. I have a wait function that I want to make totally configurable, is there a way to programmatically change the units the wait function uses? Something like changing from milliseconds to ticks from a front panel.


It's all (simple) math.

 

You can't make the wait programmable, but you can make your own wait with an enum as input.

 

For instance, if you're waiting for ticks, and want to provide ms:

 

50 ms  X 40 Mhz = 50 X 40000 = 200000 ticks.

 

Assuming you're running on 40 MHz.


Edit: oops, nvm my solution just won't work.

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 3 of 3
(1,071 Views)