SignalExpress

cancel
Showing results for 
Search instead for 
Did you mean: 

external aquisition rate

Awesome,

 

Thank you CharlesD.

 

I have altered the code with respect to what is inside/outside of the loop.

 

I have a function generator. I hooked it up to the DAQ device yesterday, and I am pretty sure I connected everything properly. 

 

I did not think that the program would run with just one signal input--due to my program being dependent on two, seperate signals (one the constant analog pulse (and is this interpreted in my program as a digital pulse sequence?---that is something I never quite understood) andthe other is the variable analog voltage input (y-axis). So since I couldn't figure out how or if I could generate two signals of the appropriate type, the program continued to fail---giving me errors like "I maybe needed to increase the buffer size?". I'm not in my lab right now, so I can't quote it directly. The function generator does have two outputs. When I test the functions and generate a waveform on the oscilloscope, it seems that the second output only outputs pulses. So, I thought since I need an analog pulse sequence and a variable analog voltage I could hook these up and it may work...but it didn't.  When I arrive back in my lab tomorrow, I can email you the specs on the function generator and where I connected the wires to my DAQ device. I'm just not sure

if I can generate the two, seperate signals I need from the one function generator.

 

With respect to hooking it up directly, There is some electrical alterations that need to happen with the spectrometer and our technician is booked solid for the next couple of weeks--so I am definitely trying to get the program up to speed before that and verify that it works.

 

Kudos CharlesD!

 

John

0 Kudos
Message 21 of 41
(5,095 Views)

Hello John,

 

If you could provide the specific error code and the hardware setup, we can better find the source of your issue.

 

Regards,

Glenn


Regards,
Glenn
0 Kudos
Message 22 of 41
(5,081 Views)

Ok,

 

So I have constructed a constant signal from a 9 volt battery. I applied resistor and a dimmer switch so I could adjust the signal to the proper voltage. I am using a function generator for my other, pulse signal of 100mV.

 

I keep getting an error: Error -200279 occurred at DAQmx Read (Analog 1D DBL 1Chan NSamp).vi

 

And it says:

 

Possible reason(s):

Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.

Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.

Property: RelativeTo
Corresponding Value: Current Read Position

Property: Offset
Corresponding Value:


Task Name: _unnamedTask<6>

 

When I run it with the execution highlighting on, it seems to run through the program twice and then fails with an error message.

 

What does this error message mean?

 

And can anyone explain how the compound arithmetic function works here. With the execution highlighting on, it seems that after the second time the signal is sampled, the program defaults to the stop function. Do I need to alter this arithmetic function?

 

Please help,

 

Frustrated chemist.

 

0 Kudos
Message 23 of 41
(5,032 Views)

Ok, so the last message was when I hooked the pulse signal up to the "CTR 0 Out" output/input.

 

This is the error message I get when I hook the pulse signal up to the "PFI 0/AI Start" input/output.

 

Error -200284 occurred at DAQmx Read (Counter 1D U32 1Chan NSamp).vi

 

And it says:

 

Possible reason(s):

Some or all of the samples requested have not yet been acquired.

To wait for the samples to become available use a longer read timeout or read later in your program. To make the samples available sooner, increase the sample rate. If your task uses a start trigger,  make sure that your start trigger is configured correctly. It is also possible that you configured the task for external timing, and no clock was supplied. If this is the case, supply an external clock.

Property: RelativeTo
Corresponding Value: Current Read Position

Property: Offset
Corresponding Value:


Task Name: _unnamedTask<15>

 

Which Input PFI 0/ AI start or CTR 0 Out, should I hook the pulse signal up to? Sorry, I still don't fully understand my program and all of the functions in it. 

0 Kudos
Message 24 of 41
(5,031 Views)

First, If you are sampling quickly the DAQ card "pushes" data samples to your computer's buffer by itself.  When you call the DAQmx read you then "pull" X number of samples off the buffer.  If you do not call the DAQmx read often enough and don't pull enough samples off that buffer with each Read you will get that overwrite error Everytime:

 

1. Turn off Highlight execution and let the program read at full speed. 

2. Set you Number of Samples to read to at least 1/10 your sampling rate. (Ie; Sampling rate = 1kHz --> Number of samples to read = `100 Samples)  If you are not using the DAQ assistant ensure that you wire the number of samples to read to both the DAQmx Read AND the Sample Clock.vi

 

 

This should eliminate the first error

Charley Dahan

Global Account Manager
Message 25 of 41
(5,019 Views)

So i'm not sure what kind of counter task you are trying to run.  But you must wire the signal to different terminals depending on which Type" of counter measurement that you are performing.  Please see the DAQmx help to get more information on this - I've attached a screenshot of the help document I speak of.

 

For Example: if you are doing non-Bufferred Event Counting you must wire you signal into the Source terminal. 

 

The DAQmx help document is Very extensive and should answer most of your Questiosn regarding these types of errors. 

 

Also it should have the pinout for your device simply search for your Device ie: PCI-6225 ...

 

Good luck!

Charley Dahan

Global Account Manager
Message 26 of 41
(5,018 Views)

Ok, so I got the first error to go away. I increased the "# of samples to read" to ~4/10 of the sampling rate--which I also increased/decreased to observe the effect. And...this seems to be taking multiple data pts, as it ouputs the analog voltage into an output array.

 

I still get this error, although:

 

Error -200284 occurred at DAQmx Read (Counter 1D U32 1Chan NSamp).vi

 

And it says:

 

Possible reason(s):

Some or all of the samples requested have not yet been acquired.

To wait for the samples to become available use a longer read timeout or read later in your program. To make the samples available sooner, increase the sample rate. If your task uses a start trigger,  make sure that your start trigger is configured correctly. It is also possible that you configured the task for external timing, and no clock was supplied. If this is the case, supply an external clock.

 

 

I am pretty sure I have everything wired in correctly.  Also, no data points are plotting on my XY graph. Should I be worried about this at this point? Or do you think the above error is the stopgap?

 

I have been looking through the help pages, but I am so far coming up empty handed.  Any take on the above error?

0 Kudos
Message 27 of 41
(5,003 Views)

This error occurs because well the counter is not detecting any pulses (rising/falling edges).  Therefore verify two things:

 

1. you have wired everything properly

 

2. that you actually do have a square wave signal that conforms to TTL Logic: Definition of TTL SignalYou should be able to verify this with a scope.

 

3.  The other thing you could do is increase tthe timeout value on the DAQmx Read function.  This will increase the amount of time that that function will wait for a pulse.  Realize however that the read funciton is a blocking function an will inhibit the rest of your code from running. 

 

good luck!

 

Charley Dahan

Global Account Manager
Message 28 of 41
(4,983 Views)

Thank you for the feedback CharlesD.

 

I have verified with an oscilloscope that I have a square wave signal. If I am understanding the definition of a TTL signal correctly, I am not certain that my pulse (coming from an external function generator--to test the program) falls under the TTL category. Since the signal coming from the actual instrument I will be using is on the mV scale (100mV), I have set the parameters of the function generator to output this type of signal. (Also there is a pin on the port which i have tested which is -60mV----is this also necessary for my pulse signal?)

 

First off--does the program I've written accept Analog Pulse Signals? This is the pulse signal (It is not a digital signal) I have coming off of my spectrometer which I need to interpret and synchronize with the other analog, variable signal.  If the current program does not interpret analog signals, and then---I'm assuming---convert them to digital signals (which is what I've been led to believe I need to do), then that is my problem. Don't I need to use a PWM function? Or do I already have an element of that present?

 

Second, I'm pretty sure everything is wired correctly. I also tried increasing the timeout on the DAQmx read function from 10 to 100---all this did was increase the amount of time that my program ran....It still did not collect and utilize any of the pulse signals---nor did it place the pulse measurements in an array nor graph them with the other analog signal....and then eventually gave me the same error.

 

I feel I am closing in on the problem more and more, but I am not quite there yet.

 

 

Please help....kudos are plentiful.

0 Kudos
Message 29 of 41
(4,977 Views)

The fact that your pulse is of 100mV is why you are getting that second error.  By TTL Logic a HIgh (or rising edge) and therefore a sample will only be read above 2.4 V, because you do not ever get that from your signal you cannot use a counter to do your pulse measurements UNLESS you have some external circuity to amplify the signal up to a 0-5V TTL signal.

 

Your next option is to digitize the square waveform using an analog input task and in software determine which part of the waveform constitutes a "High" or a "low you would then in software corerlate back to which pulses came when and correlate it back to you other analog input signal.  Unfortuantely because your signal is not anywhere near TTL the option of using a counter to measure the PWM signal is not an option anymore Unless once again you amplify your signal to conform to TTL logic. 

 

Note: You will get that timeout EVERYTIME if your signal's amplitude is less than 2.4V

Charley Dahan

Global Account Manager
Message 30 of 41
(4,958 Views)