LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulated counter

Hi,
 
I have a PCI-6251 and I am using DAQmx.
 
I will receive square waveforms from a channel.
 
I want to compute the speed of the impulses. To do that I have to know a) how many impulse for 1 second and b) what is the period for one impulse.
 
With the DAQmx assistant, I found two ways but I have some problem with both.
First of all, i am using a simulated device of the PCI-6251
1- Counter input
Whatever I use in this (frequency, counter, perdiod, etc) doesn't work. When I launch the VI (after generating the code), there's nothing going on. Even when I test the pheripheric in Measurement and automation explorer, the graphic don't move (in counterpart, when I try analog input, the tests and the VI are working properly.
 
When I try the VIs Gen-Dig-Pulse Train or Count Digitals events, nothing happens.
2- Analog input
I can also choose Analog input and measure the period with "Signal processing / Wfm measurements".
The problem is that I can count how many impulses I have in a second.
 
In addition, there is a lot more options with Counter input and choices A) and B) are available in a drop down list.
 
I would like to know how could I use the 1-Counter input and if you know what would be best between options 1 and 2.
 
 
 
Thank you very much,
 
Jack
0 Kudos
Message 1 of 10
(5,740 Views)
Hi,
I forgot to mention I have the 8.0 version.
 
for my second solution, with the analog input, there is another problem.
 
When I simulate and graph the signal, there is no problem. (WFM1.jpg file)
When I want to compute the amplitude, with WFM measurements, there is no problems.
 
The problem is when I try to measure the period with Pulse measurements from WFM measurements. (WFM2.jpg file)
I got an error message saying the pulse measurements cannot be performed.
 
If somebody has an idea...
 
Thank you very much,
 
Jack
0 Kudos
Message 2 of 10
(5,719 Views)

Here are the print screen from the previous post.

 

Jack

Download All
0 Kudos
Message 3 of 10
(5,717 Views)
Hi Jack,
The reason why you are having trouble doing 1 and 2 are because you are using a simulated device. You will not actually be able to input into this simulated device to do your measurements. Are you working with any actual DAQ cards?
Regards,

Ima
Applications Engineer
National Instruments
LabVIEW Introduction Course - Six Hours
Getting Started with NI-DAQmx
0 Kudos
Message 4 of 10
(5,694 Views)

Hi,

I am using PCI-6251.

I do not have the physical material with me. It is used for other purposes and it's why I was trying to do the VI without it.

I don't understand why I would not be able to do what I want...What would be the purpose of the Simulated device??

 

Thank you very much,

Jack 

0 Kudos
Message 5 of 10
(5,674 Views)
Hi Jack,

Simulated devices can be used to develop and run an application without data acquisition (DAQ) hardware present in the machine. Using simulated devices, you can develop, execute and troubleshoot DAQ applications without any having the applicable hardware installed.

You will receive appropriate errors when executing a DAQ application with a simulated device if you try to perform an operation that isn't supported by the real version of that hardware. For example, if you specify a sample rate of 1.5MS/s for a simulated PCI-6251 (which has a maximum sample rate of 1.25MS/s for one channel) you will receive -200077 saying you have requested a sample rate that exceeds the maximum rate of that device.

I noticed from your screen shot that you received error 20308. Be aware that if the signal you input to the Timing and Transition Express VI does not contain enough edges to complete the measurement LabVIEW will return error -20310 or -20308. In this case, simply raise the frequency or the number of data points of the signal that is passed to the Timing and Transition Express VI. I hope this helps.
Regards,

Ima
Applications Engineer
National Instruments
LabVIEW Introduction Course - Six Hours
Getting Started with NI-DAQmx
Message 6 of 10
(5,644 Views)

Hi, it is true that the signal does not contain enough edges to complete the measurement.

I can't do anything for that because the simulated device only input one sine.

Even if I raise the frequency or the number of data points, there will never be enough edges...always only one.

 

If I try the counter, I have nothin, not even with the count digital events.

All I obtain if I draw a graphic is a flat line at zero, even if I change de frequency and the number of data points.

 

Thank you very much,

Jack

0 Kudos
Message 7 of 10
(5,626 Views)
If you want to test the pulse measurement function, I would recomend you use the Square Waveform on the Wfm Generation palette. You are correct about the simulated sine wave from DAQmx and the simulated counter functions in DAQmx don't do much except allow you to check for errors. Even if you had real hardware, the DAQmx counter functions do not create a waveform.
0 Kudos
Message 8 of 10
(5,616 Views)
Hi,
 
Thank you very much for your help.
 
I was thinking that the simulated counter functions would give me a square waveform as the analog simulation gives a sine.
 
The problem with using Wfm Generation is that I can't link the signal to DAQmx. The DAQmx devices requires a "Task", not a signal.
I tried using a square waveform generation but I can't link it to the counter afterward.
 
I thought of an other way but I don't know how to get it work.
 
I could create a task with the DAQ assistant that would be counter outpout ans then I could link it to the counter input. I just don't know how to do the link
Do you have an idea or others suggestions?
 
Thank you,
 
Jack
0 Kudos
Message 9 of 10
(5,600 Views)
No, the wfm generation cannot link with DAQmx. Essentially, you would have to modify the program to perform the simulation instead of relying on the limited simulation of DAQmx. You can place the DAQmx function inside a case statement. In the other case, place the wfm generation. Until the time when there is a means of DAQmx to simulate a user defined signal, you will have to depend on writing some custom code.
0 Kudos
Message 10 of 10
(5,596 Views)