LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Timing

Solved!
Go to solution

Dear all,

 

I have this following VI solution that stems from the LabVIEW example for Continuous Digital Data Output. The issue concerns the System Clock - when set to a low sampling rate value (say, 1S/s), the rate seems to be much higher. The LED indicator on my BNC2120 is dimmed throughout; indicating fast switching between the Low and High?

 

How shall I edit the enclosed VI to actually write one sample per second? I am using the PXI-6132 card.

 

Thanks in advance.

0 Kudos
Message 1 of 9
(3,186 Views)

Are you using the external clock?  What rate is that running at?  What is the Actual Sample Rate indicator showing?  Are you getting an error or warning?


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 2 of 9
(3,160 Views)

Thanks for your quick reply.

 

Are you using the external clock?

The Sample Clock Source is set to PFI0.

 

What rate is that running at? What is the Actual Sample Rate indicator showing?

 

The Sample Rate is set to 1000 by default, and the Actual Sample Rate is 1000.00. However, if I set the Sample Rate to 1, the Actual Sample Rate shows 1.00, BUT the LED indicator is slightly dimmed - giving me the suspicion that the Sample Rate is very high, so that I can not differentiate between its dimmed state and its lit up state by the naked eye.

 

Are you getting an error or warning?

I am not getting an error or warning whatsoever. Occassionally, I get a "memory underflow" error but when I run the program again straight away without any changes, no error shows up again.

 

 

 

I am new to DAQmx and the PXI 6132 card, so all hints are appreciated.

0 Kudos
Message 3 of 9
(3,113 Views)

UPDATE:

I double-checked the configuration and I need to restate my previous description.

When the Sample Clock Source is set to PFI0, the LED does not light up at all throughout the whole operation, regardless of the data I choose to write. If I set the Sample Clock Source to 100kHzTimebase, that's when the LED is dimmed, but it is lit up. After I stop the program, the LED lights up in full power if the last data byte written was 1, or the LED goes off if the last piece of data was 0.

 

It is my understanding that the 100kHzTimebase is the external one on the PXI card? When I choose OnboardClock for the Sample Clock Source, I get an error that the OnboardClock is missing on the 6132 card - which is strange, as the card description does say there is a clock on the device.

0 Kudos
Message 4 of 9
(3,102 Views)

Escalador wrote:

What rate is that running at? What is the Actual Sample Rate indicator showing?


What rate is your external clock running at?


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 5 of 9
(3,093 Views)

Here, I am attaching a screenshot of my current configuration.

0 Kudos
Message 6 of 9
(3,090 Views)

Ok, when you set the clock to use the 100kHz clock, you will be sampling at the 100kHz.  I am a little surpised that it won't let you use the onboard clock.  Maybe the DIO can only be clocked out with an external clock?

 

Some tweaks you should make here:

If using an external clock, the rate should be set to the maximum expected rate of that clock.  The data will be clocked out based on that clock though.

Since you are using Continuous mode, do not wire up the Samples Per Channel to the DAQmx Timing VI.  All you are doing is limiting your buffer size.


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 7 of 9
(3,086 Views)

Indeed, if I use the OnboardClock, I get error -89120:

Source terminal to be routed could not be found on the device.

Make sure the terminal name is valid for the specified device. Refer to Measurement & Automation Explorer for valid terminal names.

Property: SampClk.Src
Property: SampClk.ActiveEdge
Source Device: PXI1Slot4
Source Terminal: OnboardClock

 

Just to be clear, what do you mean by 'If using an external clock, the rate should be set to the maximum expected rate of that clock.'? The 100kHz clock is external, correct? The 'rate' you are referring to is the Sample Rate? I set the Sample Rate to 100 000, and I unwired the Number of Samples from the Timing VI, but nothing seems to have changed.

 

The aim I have for this application is very,  very simple - I want the LED to be lit up for 1 second, then to go off for 1 second, then light up for 1 second again, then go off for 1 second again, and repeat forever. Solving this in LabVIEW is obviously pretty easy - I could just send a signal every second from my PC to the card. But I would like to send a task to the card and then let the card itself to do all the work, so that if my PC freezes for some reason, the card will still be functioning independently of my PC.

0 Kudos
Message 8 of 9
(3,076 Views)
Solution
Accepted by topic author Escalador

If using the 100kHz clock, then make a waveform that is high for 100,000 samples and then low for 100,000 samples.  So you will have a 200,000 sample array to write.


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
Message 9 of 9
(3,069 Views)