Hi,
I'm using timestamp to log data every second in while loop , but the stamp is skipping some seconds count for some reasons. I'm using USB DDAQ acquisition card. could somebody please help.
Regards,
Tj
Hi,
I'm using timestamp to log data every second in while loop , but the stamp is skipping some seconds count for some reasons. I'm using USB DDAQ acquisition card. could somebody please help.
Regards,
Tj
Hi,
I'm using timestamp to log data every second in while loop , but the stamp is skipping some seconds count for some reasons. I'm using USB DDAQ acquisition card. could somebody please help.
Regards,
Tj
Dear community,
I am having trouble measuring the duty cycle of a TTL signal. I generate analog signals through aoX (about 10 Hz signal) and feed them to an electronics module. The module converts these signals into pulse signals and I would like to measure the duty cycles within the analog output duration (20 seconds). However, within the timeout period no pulses are captured which results in an error message.
I use a python-C wrapper so I am looking for a working example in C.
The TTL signal is connected to ctr0 gate. I am not sure which timeclock is used but since I do not set it, I guess the default clock of 20 Mhz is used. Do I need to route the clock to ctr0 source? The main lines of code are:
counter1 = Task()
counter_channel="Dev1/ctr0"
counter1.CreateCIPulseChanFreq (counter_channel,"", 1, 200, DAQmx_Val_Hz);
[...]
analog_output.WriteAnalogF64(samplesPerChan,1,0,DAQmx_Val_GroupByChannel,data_out,byref(sampsPerChanWritten),None)
counter1.ReadCtrFreq(samplesPerChanCtr,timeout,DAQmx_Val_GroupByChannel,duty_freqA, duty_cycleA, buffer_size_counter,byref(read),None)
[...]
I would really appreciate any help.
Hi
I'm having a little trouble understanding the manual for BNC 2121. I have connected it to a PCI 6602, and I want to read the frequency of the signal using LabVIEW. But I am unable to understand clearly what the procedure to do so is, from the manual. Here is what the manual says:
To measure a frequency using counter pair 0 and 1, complete the following steps.
1. In the C interface or in LabVIEW, select GATE as the output of the other counter. This selection allows OUT of counter 1 to be the GATE signal for counter 0.
2. Connect a wire from the (square wave) spring terminal to SOURCE of counter 0, which is PFI 39. The counter counts the number of edges received during the interval defined by OUT of counter 1. The frequency measured is the number of counts divided by the duration of GATE in seconds. Another counter pair also can be similarly used.
Now, what I do not understand is, how do I select GATE as the output of the other counter in LabVIEW? Also, the connection that it asks me to make as stated in step 2, does not show any signal on LabVIEW, but when I connect the square wave spring terminal to the GATE of, say CTR 0, I can read the frequency on LabVIEW. Is this the correct way to do this?
Thank you
As the title suggests, I'm writing a controller in C# with the aim to read counts using a PCIe-6351. Right now, all I'm asking my code to do is display the counter readout starting from a value of 10 ever 200ms about 10 times.
But my readout is returning this
0: System.Collections.Generic.List'1[System.Double]
... repeated to index 9.
My initialization code is as follows:
public Task ReaderTask { get; private set; }
public void AddReadChannel(string channelName, bool isCounter)
{
string cname = new String(channeName.Where(Char.IsLetter).ToArray());
{
this.ReaderTask.CIChannels.CreateCountEdgesChannel(channelName,
"Counterreader " + cname, CICountEdgesActiveEdge.Rising, 10,
CICountEdgesCountDirection.Up);
}
}
I have two issues I'm trying to resolve on my own, but could use help wtih
1. Finding the method to configure the input terminal to PFI0 from the default PFI8. When I connect to the terminal in NIMAX I see counts being received when I switch to that terminal.
I was also curious if anyone could inform me if I should work using the single channel reader or the multi?
Any help would be so greatly appreciated.
For my application I need to generate repeatedly triggered analog outputs with the NI USB-6216. The triggers are relatively fast (20-30 ms distance) in an irregular pattern. When I setup the signal generation and a trigger connection in the Data Acquisition Toolbox of MATLBA 2017a I am able to trigger the device, but not consistently. Most of the time it skips several triggers.
Is there a hardware limitation to retriggerable events? Or does it depend on the software? Unfortunately I will not be able to purchase a LabView license, so I am limited to the Matlab toolbox. At the moment I set a trigger connection between the external trigger and the analog output, but maybe there is a better workaround to achieve what I want to do.
If somebody has the solution to my problem or information on where I could further look for a solution I would be very thankful.
Best, Marina
Bonjour,
J'ai un carte d'acquisition PCI 6010 qui contient un timer 80MHz.
J'ai un capteur effet-hall (Cherry GS100502) devant une roue dentée d'un axe en rotation (banc moteur à inertie) qui me sort un signal carré que je rentre dans la voie compteur de la carte (PFI0).
J'enregistre la période entre chaque dent pour la mettre dans un fichier txt pour ensuite faire du traitement. Voici brut ce que ça donne dans le fichier txt :
...
0.001124225000
0.001134325000
0.001114100000
0.001111525000
0.001121687500
0.001121662500
0.001111587500
0.001116600000
0.001126725000
0.001129262500
0.001104000000
...
En divisant par la période (1/80e6), ceci me donne les valeurs entières suivantes :
Je m'aperçois d'une chose à laquelle je ne m'attendais pas quand je zoom sur mes points :
J'ai vraisemblablement des points tous les 200 en Y. Mon "problème" est qu'au global, la précision sur ma période est de 200/80e6 plutôt que 1/80e6.
Ce qui est bizarre, c'est que sur une même ligne, je n'ai pas exactement les mêmes valeurs, j'ai bien une "quantification" de 1 :
Pourquoi ai-je des valeurs tous les 200 environs et non pas 1? Je n'arrive pas à croire que c'est un hasard.
Je pourrai vous envoyer le code ce soir, mais c'est juste un DaqAssistant (bloc bleu) qui envoie le fichier dans un bloc "write to spreadsheet" pour me faire le fichier texte, ni plus, ni moins.
Merci pour votre retour.
Loic
Hi everyone,
I have some questions about sampling the quadrature signal from a HDMI port by using the PCI 6221 DAQ card and would like to have your support. Thanks!
1.Question of connection
Can i use a HDMI to BNC conventor to connect the HDMI cable and BNC cable, so i can connet the BNC port to the SCB-68 channel box. Through this connection to acquire quadrature signal?
2. Question of Counter task set up
What i am going to acquire is the signal from a interferrometer. This signal should indicate the strain difference of my object. When i use DAQ assistant, which typ of counter Input should i choose, is that Edge Count or Linear Positon?
And to acquire this quadrate signal precisely, i shoud set the clock of DAQ card faster than the clock of the HDMI interface which will be configured in the sofware of interferrometer. When i open the DAQ assistant, there this a option for sample clock type under adanced Timing, and i can only choose the "external", and have to also choose a clock source, and this step confused me. Can i use a function generator to connect to a PFI channel, and and set the frequency of the signal from function generator as a external clock?
I'm relatively new to Labview and this is my first time dealing with DIO so please bear with me. I need to produce a PWM signal on one channel to control some motor drives and measure the frequency of pulses on 3 channels to determine RPM of the motors. I've gotten the PWM working but I'm having trouble with the inputs. I've set up a separate task for each input put when I run them in MAX with no signal input I get this error. (see below). Also the input signal will be at zero when the motors stop but It appears you can't have less than 1 for a minimum in the input range. How can I deal with that?
Thanks
Hello,
I am working on setting up a linear magnetic encoder along a strength testing machine. Ideally I'll have the magnetic strip along the back and the encoder attached to the moving stage in order to measure the distance traveled.
This is the encoder I'm using:
It's a incremental encoder that measures distance traveled by the number of pulses in the square wave. It has alternating A track and B track. Ideally I will be able to measure both in order to measure the distance more accurately.
This is the magnetic band:
I have it attached to the NI USB 6008 and I have the encoder attached to the PF10 port on the counter.
I am wondering if there is a labview program that is already made for this sort of thing or if some one could suggest how to augment an existing VI. If those options aren't available, then any suggestions on how to start writing my own would be greatly appreciated.
Please let me know if I can provide additional information or pictures of the configuration.
Thank you for your time and help!
I have an old Hamamatsu H5783 PMT, and I am trying to figure out whether it is capable of conducting single photon counting. I am unsure as to what the specific specs needed are for single photon counting. I compared this data sheet (http://ugastro.berkeley.edu/ay122_fall12/PMT/schematics/h5773.pdf) with the data sheet of a newer hamamatsu pmt that specifically states its design for single photon counting, Hamamatsu 10720 PMT (https://www.hamamatsu.com/jp/en/product/alpha/P/3003/3044/H10720-110/index.html), but I do not see a significant difference in rise time or really any specs. Any knowledge if the H5783 is compatible, or what the specific minimum specs are required to conduct single photon counting, would be appreciated.
I need to generate a single pulse on two channels with precise timing to trigger lab equipment. Please see image below. I haven't found any examples with multiple channel pulse generation.
Hardware:
We are currently using a myDAQ. We also have a NI-9401 digital IO module but supervisor would prefer to use myDAQ if possible.
Work so far:
(Please see LabVIEW attached)
I've tried writing a LabVIEW program using two "ctr" (so it wouldn't run on myDAQ). Channel 2 triggers off channel 1. One issue already is that initalDelay2 must be greater than initialDelay1. I haven't been able to test it but I do have an error with simulated hardware (ERROR: "Lines 0 through 3 of this port are configured for input. Cannot configure these lines for output at this time.")
Questions:
1. Can myDAQ be used? Or do we need multiple "ctr" (e.g. NI-9401)?
2. Am I on the right track? (considering adding analog input and other control later)
Thanks!
Hello
I would like to make a counter,but my professional knowledge is limited because I am just interesting in eletronic field. And I would like to ask that if CD4093( the CD4093 datasheet ) is suitable to make counter. I have several requests about my counter.
The power consumption is low while the supply voltage range is wide,Beside,good noise immunity and high package desity will be more willing. What’s more,I hope the counter has high fan-out capability.
Has any do such a counter? Could you give me some advice?
Thanks a lot.
Dear all
I need some help as my brand new NI-9361 is considered as "unsupported module" with my NI cDAQ-9174. I am a bit worry because the 9361 line disappeared in the compatibility chart (it was 2 or 3 weeks ago).
Any advice?
Thks
Requirement: Need to introduce a time-delay to retriggerable pulse output; so the LabVIEW example "Counter- Single Pulse Output.VI" was tried to generate retriggerable pulse outputs on Dev1/Ctr 1 with a DAQCard 6062E installed on a Laptop running Win10-32bit, LabVIEW 2016.
Problem: encountered Error 200452 when a time delay element is added to "DAQmx Trigger" property node.
Q1: How do we solve this? Can this be done with a single counter?
VI setup:
Output TML: PFI8 (CTR0 SRC); trigger setting PFI4 (CTR1 Gate) on triggered pulses at 8s intervals, 0.010s pulse width.
Q2: It's also odd that I can only select PFI8/CTR0 SRC for my Output TML, and not CTR1 OUT . Should CTR 1 OUT be the output?
I am working with a number of different DAQ devices for experiment control in a lab environment where we need to trigger hardware timed sequences off the 60Hz power cycle. We do this by pausing and retriggering the external clock for the connected DAQs that generate the AO, AI, and DO lines. For timing reference we use a DAQ counter to measure the length of the pause with a Semi Period measurement of two pulses on a DO line of the same device, one at the beginning of the run and one at the end of the wait once things are retriggered.
The problem I'm having is that the X-series DAQs I have only measure the falling edge of the first pulse then both edges of the second. The M-series devices I have measure all four edges. I'm want to use the same code for all the devices since they are practically identical in function, but I can't now since the number of edges read depends on the device used. I can't seem to find any reason why there should be a difference in the documentation. I'd really like to make the behavior consistent so that the code base doesn't need to diverge or implement hacks.
The devices I have access to are a USB-6343, USB-6229, and PXI-6259. I'm using PyDAQmx to access the C api. I have two separate setups using NI-DAQmx 15.5.1 or 9.9. The setup code is:
self.acq_task = Task()
self.acq_task.CreateCISemiPeriodChan('ubs_6343/ctr0', '', 100e-9, 200, DAQmx_Val_Seconds, "")
self.acq_task.CfgImplicitTiming(DAQmx_Val_ContSamps, 1000)
self.acq_task.StartTask()The edges are then read out one at a time with a read thread using the ReadCounterF64 method to get all four edges. When the first edge is missing, timeouts and timing logic have to be changed.
The only other thing I've noticed in my testing is that the M-series devices show the first edge taking place at some large delay consistent with starting the task in software time before the hardware timed tasks are configured. The X-series devices however always have the first edge measurement give the width of the first pulse. If I didn't know better I'd think the counter start was being triggered by the rising edge, but that's not how it's configured as far as I know. Why would it only be the X-series to behave that way?
Any insight would be great!
(I've attached the full source for the curious. It's part of a larger software suite known as labscript)
Hi,
I have some questions about how to synchronize audio and videorecording using a single DAQ device.
In my setup I’m using two devices, one for videorecording (pointgrey camera fl3 u3 13s2m cs, https://www.ptgrey.com/flea3-13-mp-color-usb3-vision-sony-imx035-camera) and one for audiorecording (Ultrasoundgate 416H, http://www.avisoft.com/usg/usg416h.htm, 4 microphone channels), that are connected to the same computer, but started by two different softwares. What I’m trying to do is to find a way to start both recordings at the same time so that to synchronize the two data (video and sound). The goal is to know precisely when sounds occur during the video.
I'm completely new in this kind of tasks and in the field of data acquisition, so any help is truly appreciated.
- Do you think that connecting both recording systems to the same DAQ device will allow me to solve this issue? If so, once both systems are connected to the DAQ, can I start symultaneous recording always from the computer? How?
-What type of DAQ device would be better for this task? May you give me some suggetion?
-What method of syncronization should be performed? I read about start trigger synchronization and sample clock synchronization, but I'm not sure which of the I need to use.
-Once the recording has been done, will I have 2 different files as output? (one for audio and one for the video?)
Please tell me if you need more information.
Than you very much.
Hello everyone,
I use the Astronics PXIe-2461 Universal counter timer to measure phase shift of phase modulated signal (PM) that means one of two pulse change period in time periodaclly with out changing the pulse width and that make it hard for the PXIe-2461 it give two periods simultaneously, I thought that was related to trigger hysterisis's level and gate time settings i tried a lots of settings configurations but it didn't work.
Just for informations the PXIe-2461 give precise measure with a non frequency or phase modulated sinusoïdal or periodic signal.
Your ideas and suggestion are welcome, thank you
Here is the Pxie-2461 datasheet:
I put also the user manual in Attactched file.
I am trying to trouble shoot a problem with counter reading that occurs only under some circumstances. If a certain sequence of actions happens in my software, running a multisample read on a CounterReader returns the following error:
By setting Number of Samples per Channel to -1, you indicated that all available data should be read. This is not valid for acquisitions without a buffer. Specify a value greater than or equal to zero for Number of Samples per Channel. Do not specify a value of zero for Buffer Size when configuring the input buffer.
My code is:
myXCounterTask = gcnew Task("X Counter");
myXCounterTask->CIChannels->CreateLinearEncoderChannel (..)
myXCounterTask->Timing->ConfigureSampleClock("/Dev1/PFI0", 8000, SampleClockActiveEdge::Rising, SampleQuantityMode::ContinuousSamples, numberOfSamples );
myXCounterTask->Stream->Buffer->InputBufferSize = numberOfSamples * 20;
counterXInReader = gcnew CounterReader(myXCounterTask->Stream);
array<double>^ posX = counterXInReader->ReadMultiSampleDouble(-1);
What is confusing is that this code works fine generally, but fails if certain sequences daqmx commands are run previously, which makes me think that I am not initializing something correctly and depending on it to be in a default state. I'm trying to understand which buffer the error is referring to, and how I can check it's size? It is apparently not the Task's buffer, since that is set. Are there other buffers associated with the CounterReader?
Hello guys,
I have some trouble to get pressure reading by every encoder pulse ( every 0.35 deg) using encoder.
Currently, I am using quadratic encoder (A,B, and Z).
I have two tasks. One is for angular position (encoder) and another is pressure reading (pressure sensor)
Both tasks shares same external clock. The execution of the loop is no problem.
When I checked the excel file that I measured, every pulse didn't give the 0.35 deg (360deg/1024 ppr).
The value slightly fluctuated I mean up and down like 0.2 ~ 0.4 deg per pulse.
Is this reading reliable and reasonable?
I am actually measuring intake and exhaust pulse by crank angle.
I am afraid that a few degree difference would result in invalid pulse shape.
For your reference, I attached Vi file that I tested.
Thanks for your help and assistance in advance.