LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Possible for while loops to iterate in about a nanosecond?

Hello all,

 

I am using a series of Intel 8254 counter/timers as event counters for a detector system. These little guys operate at 10 MHz max, giving me a time resolution of about 100 ns, assuming that the 8254's actually operate at 10 MHz.

 

What I really need to do is measure the amount of time in between event pulses, with as much accuracy as possible.

 

We will likely use a faster counter in the future, but I need to get this to work as is for now. These pulses are random. I'm currently operating the counters at 5 MHz.

 

I'm in the process of writing a program in LV, but am having some issue. I currently have a single while loop in the program. Within the loop, there is a read function that calls for the current value of the counter. My issue is that the counters are operating at a much higher rate than the software.

 

Is there a way to get a reasonably accurate read from the counters? Can I compile the program to operate in dos? Would that even help?

 

I apologize for the vagueness. I am working on the program now and will have a diagram to post in a bit.

 

Thank you for your advice.

 

This is my first attempt at programming anything other than my ol'VCR (which still flashes 12:00). Please bear with me.

0 Kudos
Message 1 of 6
(2,968 Views)

Hi Bro,

 

using single value reads you will never get any reasonable loop speed - the driver overhead is much too big!

 

- Check for the capabilities of your DAQ hardware: is it fast enough for those pulses? Does it allow fast and hardware-timed reading of the CTR values?

- You should try to read the CTR values with a higher sample rate (if possible). Read bigger blocks of data! As data are hardware-timed you can then analyze change of CTR over time...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,957 Views)

The short answer, anything running in Windows cannot be counted on to run at a deterministic rate.  I have seen Windows halt a program for half a second (probably more at times with me not watching).

 

How are you communicating with the counters?  It is likely the communication bus won't even allow the rates you are asking for.

 

Where are the pulses coming from?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 6
(2,948 Views)

The pulses come from an array of neutron detectors. I can't go into too much detail there.

 

Right now I'm just focused on a single pulse input. I've been using a function generator.

 

The counter board is contacted via USB 2.0.

 

I was told by a peer that running in dos, working outside windows, would free up the processor and greatly increasing the speed of the program. Is this true? How much would it increase?

 

 

0 Kudos
Message 4 of 6
(2,937 Views)

Your LabVIEW application cannot run without a supported operating system to do all the OS stuff (A good KB Article here) DOS is not a viable option to target.

 

LabVIEW Does have a RT (Real Time) Module that can deploy an executable to a RTOS.  That MAY be a solution in your case 


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 6
(2,923 Views)

LV coded targeted to FPGA can loop at 40 MHz.

 

I have used NI's high-speed counter timer board along with their Timing and clock module to run counters at 80MHz.

 

I believe some of the AI devices (scope boards) will sample at over 100MHz.

 

If you are just trying to compare arival times then the loop does not alway have to run as fast as the events. SO give us some details on how often the events will occur for how long and how many things are you watching.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 6
(2,905 Views)