LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i Use an External Clock in my DAQ device to run Timed Loop without PFI lines

Currently I am using the Advantech PCIE 1816 device and programming using DAQNavi Assistant in LABView on Windows 8.1. I need 100us precision in time but windows offers only a 1KHz clock to access for timed loops. The 1816 has an onboard 20 MHZ clock and 24 digital I/O pins but no PFI lines.

The program aims at sending out specific signals at specific times and hence I am using the timed loop and DAQNavi Assistant for Digital and Analog Output

I am quite a novice at LABView and not sure if its possible to do this without PFI lines and what kind of code would get the job done. 

Any pointers will be appreciated.

TIA

0 Kudos
Message 1 of 5
(2,940 Views)

What are you trying to do?

 

Depending on your needs, you might be able to build an arbitrary wave and send it out of the analog output.  The Digital pins won't give you 100 us level output unless it is a PWM.  There does not appear to be anything like a digital waveform option listed in the manual where the hardware will buffer and play back a predefined file from the DIO.

 

Otherwise, it looks like the DIO is software controlled so you're stuck with whatever speed it can be serviced by the controlling process.

0 Kudos
Message 2 of 5
(2,929 Views)

Not sure I completely understand your question, but this is what I understand

 

The time loop construct that you want to use, is for a Real Time Operating System. Presently, NI uses a Real Time Linux OS, but in the past has used different operating systems.

The time loop construct will NOT work properly in Windows. It may run at 1kHz rate, but is not precise and will have jitter.

 

New versions of LabVIEW have the High Resolution Polling Wait.VI. You can try that in a while loop like below and see if you can get 100us periods; it will probably work better than a timed loop.

 

Snap12.png

 

mcduff

0 Kudos
Message 3 of 5
(2,917 Views)

Thank you for your time!

You are absolutely right. I am currently using an arbitrary waveform which loads analog values into the buffer and outputs them according to the Clock on the Advantech card and that resolution is perfectly good for the analog output. There is no such option for digital waveforms which is the issue.

So currently even if i can obtain 1 ms precision for the digital output it is a good start but since the timed loop runs on a 1KHz clock and because of non-deterministic clock of windows I wanted to somehow use the 20 MHz clock(counter) from my DAQ device as the reference clock for the timed loop/Labview program.

The aim of the program ultimately is to have a continuous cycle consisting of a charge phase, buzzer phase and fire phase (according to the comments on the VI) and from the start of the fire phase I must output an arbitrary analog signal and operate several digital channels at preferably a 100us precision. 

 

0 Kudos
Message 4 of 5
(2,894 Views)

Thank you for your time.

I have tried to explain the aim of the project again, please have a look and let me know if it was more clear than before.

 

While browsing through the forum i did notice that for a deterministic clock I need to somehow download a Real-Time OS fomr labview online site and install it in my Windows PC? But i was afraid that this would mean the PC would become completely dedicated to the program. 

That's why I wanted to try using my DAQ device's 20 MHz clock/counter as the reference clock for my labview program since it won't have timing jitter and has more resolution. But havent figured out a way to read the clock into LABView.

 

I see, thank you. I will try the Polling Wait block and get back to you. Thank you.

0 Kudos
Message 5 of 5
(2,891 Views)