Discussion:
Solve this it's a challenge
(too old to reply)
Parikshit
2008-03-01 11:10:06 UTC
Permalink
First of all thank u for ur help it means a lot
I still have some doubts they are as follows 
*How do i&nbsp;configure the DAQmx_Val_ChangeDetectionEvent&nbsp;as a sample clock in the AI voltage task.(Can u explain me how it's done u can use&nbsp;my&nbsp;code if required&nbsp;<img height="16 src= Loading Image..." width="16" border="0">.
*What Exactly do mean by sample clock.Does it mean that only when there is a change at the encoder the samples are read&nbsp;form the AI.
For Example
while
{
ReadAI(sample clock = changedtection,lines,data,ect....)&nbsp;
}
Does it mean that the&nbsp;data on the line&nbsp;will be filled&nbsp;only when there is a change on the&nbsp;encoder&nbsp;or it irrespective of that.
And Personally which of the above&nbsp;two methods do u think is better and why&nbsp;
nantek
2008-03-03 14:40:06 UTC
Permalink
Hey Parikshit,
Since you didn't set the ai/SampleClock, it looks like it's set (by default) to be 10KHz (0.0001 x 36000 = 3.6 seconds).&nbsp; The cDAQ-9172 uses the USB-STC2 which can acquire data at the exact sampling rate.&nbsp; The times that you got (3.5 and 1.75 seconds) are the software times reading&nbsp;between the two statements, and NOT the actual acquistion time (it is close but not the same).
stilly32
2008-03-03 15:40:11 UTC
Permalink
Stepping back a few posts, you asked:
*How do i&nbsp;configure the DAQmx_Val_ChangeDetectionEvent&nbsp;as a sample clock in the AI voltage task.(Can u explain me how it's done u can use&nbsp;my&nbsp;code if required&nbsp;
You need to the change detection event when you configure your sample clock for AI:
DAQmxCfgSampClkTiming (taskHandle, "/cDAQ1/ChangeDetectionEvent", rate, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, sampsPerChan);
This will allow the change detection event (which is really just a clock signal, see the 9172 user manual) to be routed to the 9215, which can be in any slot.
As mentioned earlier, you should be able to use this along with the change detection example to get what you need. You would wire signal A and B to your digital input module (9411) in slots 1-4. You would configure change detection on the rising and falling edges of both of those signals like so:
DAQmxCfgChangeDetectionTiming (gTaskHandle, "cDAQ1Mod1/port0/line0:1", "cDAQ1Mod1/port0/line0:1", DAQmx_Val_ContSamps, gSampsToRead));
Now you mentioned you wanted to acquire AI on both the rising and falling edges of your encoder - this will allow that. However, if you want to perform a position measurement on that same signal using the counters, you have a problem. Counter I/O&nbsp;is mostly accessed through the PFI lines - which are only available in&nbsp;slots&nbsp;5 &amp; 6. So you will not be able to perform change detection (slots 1-4) and a position measurement (slots 5&amp; 6)&nbsp;as the same time using the normal methods.
If you need this functionality, the easiest thing would be to buy another module - the digital modules are generally not expensive when compared to development time. You could wire&nbsp;A &amp; B to 2 different modules in slots 1 and 5, and&nbsp;get your clocking signal and your position measurement.
Another&nbsp;option would be to just acquire on the rising edge of one of the signals - use the counter&nbsp;in slot 5&nbsp;or 6 for the position measurement, and then one of the PFI lines to read off of the rising or falling edge of A or B.
There are a couple other options that would only work in certain situations, but before we get into that I would pose this question: Why do you need to acquire on both the rising and falling edge of the encoder signals? Are you trying to correlate position to time? If so, there may be a much better option. With position measurements, you can&nbsp;perform a Buffered position measurement and&nbsp;latch the value of the position on a clock edge. So for example, you could have a&nbsp;clock running at 1000 samples per second, and on each clock edge it would record the position of the encoder. You&nbsp;could obviously use that same clock signal as the AI sample clock (or the AI sample clock as the clock signal). This would give you the value of&nbsp;your AI with respect to the position of the encoder, and give you everything with respect to a constant&nbsp;dt - rather than however fast your encoder is running. Feel free to ignore this suggestion if you absolutley need to know the AI value for every degree.
Some of your other comments:
..i need to use a 180 PPR and get a count of 360.&nbsp;Which encoding type are you using - x1, x2 or x4? and which is your encoder? I believe&nbsp;changing that value should help.
For the error you linked in the image -&nbsp;increase the&nbsp;number of samples per read - the default is 4, try 1000&nbsp;- does this help?
Hope this helps,
Andrew S&nbsp;&nbsp;&nbsp;&nbsp;
stilly32
2008-03-03 16:10:11 UTC
Permalink
Just like the manual can't tell you everything the chassis can't do (this chassis is not suitable for toasting bread&nbsp;:smileyhappy:&nbsp;&nbsp;&nbsp; ) it's hard to tell you everything it can. On M-series boards we have the routing tab to explicitly tell you what routes are available. For cDAQ that table is much harder to populate because the front end where PFI lines and AI/AO resides is completely dynamic. Anyway, your point about not explicitly telling you that the&nbsp;change detection event is completely valid, but it can be done.&nbsp;As a rule of thumb, since both the M-Series boards and the cDAQ 9172 chassis both use the STC2 (the USB-STC2 is virtually the same as the&nbsp;STC2)&nbsp;you can use the routing tab on a simulated M-Series to check routing.&nbsp;Also, just simulating a cDAQ chassis with the desired modules will give you the correct errors as far as&nbsp;routing.
Also, if you find similar undocumented features, please file a <a href="http://www.ni.com/contact" target="_blank">product suggestion </a>so our doc team can address them.
Cheers,
Andrew Message Edited by stilly32 on 03-03-2008 10:04 AM
Parikshit
2008-03-04 10:10:07 UTC
Permalink
First of all thank u Mr.Andrew and Nantek.
&nbsp;
Mr. Andrews thank u once again i really appreciate u r help sir. People like u give us the encouragement for this
challenging project of ours.
&nbsp;
As u said sir
*You need to the change detection event when you configure your sample clock for AI:
&nbsp;
DAQmxCfgSampClkTiming (taskHandle, "/cDAQ1/ChangeDetectionEvent", rate, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, sampsPerChan);
&nbsp;
do i need to configure the terminal as "/cDAQ1/ChangeDetectionEvent" or&nbsp; "/cDAQ1/Module/ChangeDetectionEvent"
&nbsp;
*Why do you need to acquire on both the rising and falling edge of the encoder signals? Are you trying to correlate position to time?
&nbsp;
I need to acquire on both rising and falling edge of the encoder signal because that way i will be getting a pulse at every degree the encoder rotates.Using which i'll have to acquire AI values,hence my analog values will be for be every degree .Frankly i dont know weather this is possible because we are using Windows operating system which has a limitation of
1 milli second. So considering that the encoder is going to be rotated at 6000 RPM and considering 360 count every every revolution @ 6000 RPM i will have capture to 36000 samples per second. My biggest worry is that is i will lose samples at that speed.
&nbsp;
For this problem according to me there are only two solution if there are any more please let me know
&nbsp;
1&gt;Time Based--&gt;In which case i will have to forget the encoder and have to acquire samples at time based intervalsFor Example I know that for 1 second i will have 36000 samples at MAX 6000 RPM then i have to take&nbsp;this data
and interpolate it to the corresponding degrees.The drawback of this system is that I am assuming things&nbsp;&nbsp;i dont
know weather the data acquired is for that degree.
&nbsp;
2&gt;Buffered Position Measurement--&gt;(As told by you)I dont know weather this system will be able to acquire the data without missing any samples.But the advantage of thissystem is that the position value corresponds to the Analog data acquired.One doubt i have is that cant i use degrees
instead of position and Correct me if i'm wrong but i wont need to use changedetection and i'll have to slot the 9411&nbsp; in 5 or 6 slot and wrie a program such as create Angular Encoder Channel Right ? And do i need 2 9411 cards or just 1 to achieve this?&nbsp;
One Problem i'm facing in the time based approach is that as mentioned in my previous post that if the number of samplesper channel is 36000 it takes around 3.5 seconds(1800 takes 1.75) to complete the read function. i dont know weather this is because as mentioned by Nantek that the 9215 by default takes the sampling rate as 10Khz.But as u know even for time
based approach i need 36000 samples per second and i dont know weather 9215's internal clock will suffice that.
If it doesn't what could be the alternative?
&nbsp;
Programatically also there are a lot of confusions like weather i should use callbacks or just use a while loop herethe windows limitation of 1 ms will come into play that i spoke of earlier.
&nbsp;
I dont know weather there is a perfect solution to this problem but any amount of inputs given by u guys is priceless.
&nbsp;
Lastly the delay in reply's is due to the fact that i'm based in asia(different time zone).If u guys r willing i willcome online on messenger(I'm ready to go sleepless for a night to talk to u guys).
&nbsp;
Thank you for your helpRegards ParikshitMessage Edited by Parikshit on 03-04-2008 03:56 AMMessage Edited by Parikshit on 03-04-2008 03:58 AMMessage Edited by Parikshit on 03-04-2008 03:59 AMMessage Edited by Parikshit on 03-04-2008 04:00 AMMessage Edited by Parikshit on 03-04-2008 04:01 AMMessage Edited by Parikshit on 03-04-2008 04:02 AMMessage Edited by Parikshit on 03-04-2008 04:02 AM
nantek
2008-03-04 18:10:09 UTC
Permalink
Parikshit,
&nbsp;
I think that you should have NO problem using the buffer position measurement technique as Andrew suggested because the 9215 (according to the spec sheet) only needs 4.4us to convert (for one channel), and you only need 36KHz sampling rate max.&nbsp; The cDAQ-9172 has 2048 samples FIFO memory (each for analog and digital inputs) so you just need to adjust how often you want to read the data to prevent overflow.&nbsp; I hope you realize that this technique has the following implications:
&nbsp;
1)&nbsp;Depending on the rotational speed of the encoder, you may not have exactly 360 data points per revolution because the ai/SampleClock is divided by 2 from 80MHz, 20MHz, or 100KHz clocks.
&nbsp;
2) The position reading would&nbsp;have an error&nbsp;of +/- 0.5 degree (assuming that you select x4 position measurement).
&nbsp;
BTW, what country are you from?
&nbsp;
&nbsp;
nantek
2008-03-05 23:40:11 UTC
Permalink
Hi Parikshit,
Inside the while loop, you should first check to see if there is any data samples to be read before you actual read them:
while(1){
DAQmxErrChk (DAQmxGetReadAttribute (aitask, DAQmx_Read_AvailSampPerChan, no_of_samples_per_channel));
if (no_of_samples_per_channel&gt;0)
{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DAQmxErrChk (DAQmxReadAnalogF64(aitask, no_of_samples_per_channel, 10.0, DAQmx_Val_GroupByChannel, data, 1000, &amp;read, NULL));&nbsp;&nbsp;&nbsp; if(read)&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; p++;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; printf("Sample No. :%d Data ---&gt; %0.2lf \n",p,data[0]);&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }}
&nbsp;}
Parikshit
2008-03-06 14:40:15 UTC
Permalink
Heart Fealt Thank you to you guysToday i had a meeting with my client and he is interested in Buffered position Measurement as suggested by Mr.Andrew(<a href="../view_profile?user.id=59497" target="top" class="auth_text" style="font-weight: bold;"> stilly32</a>
) in this thread.But as suggested by Mr. Andrew i will have to use the same clocks for both my Analog Input (9215) and Angular Measurement(9411) So that&nbsp; i can correlate position&gt;9411&nbsp;&nbsp; with&nbsp;&nbsp; Analog Value&gt;9215. This would mean that both these tasks will have to use that same clock signal.&nbsp;&nbsp;&nbsp;&nbsp; I'm a bit confused as to how to go about it.&nbsp; *Do i have to connect the A,B&nbsp; A- B- To one of the PFI's of the 9411 &amp; the set it as a sample clock for 9215 AI task?*Do i need two 9411 modules to achieve this?So i think the important thing is how to configure the Encoders Output A and B as Clock for bothposition measurement (9411) and AI value(9215).Here is a list of other modules that are loaded in my Chassis other that 9411 &amp; 9215 if it might help me in avoiding purchasing another 9411 module1&gt;92052&gt;92633&gt;94254&gt;9476Need u r help guysThank you&nbsp;
Parikshit
2008-03-07 18:15:22 UTC
Permalink
Mr Joe thank you once againFirstly I'll answer some of your doubts*It would really help to know what kind of test you're trying to set upOur project is a basically a bearing testing rig.On which a certain load is applied.This load is being measured on our 9215 in terms of voltages. Here position is also important&nbsp; since i have to find out at what degree(position) what was the load -&nbsp; so this is where the encoder and the 9411 comes into picture.Using the encoder and 9411we will be able to measure position on slot no 5-6.*My question to you is: what kind of correlation do you need between your encoder and analog input?Latch analog input(voltage) at every change in degree of the encoder.I'm not sure weather it is possible for every degree even if it is not possible it's not an issue but the important thing for me is that the degree should correspond to the load(I should be sure that at this degree this was exactly the load).So it is analog-input-to-position correlation.This was basically about our process. Now i have a few questions regarding the solutions mentioned.*Andrew's suggestion about buffered position
measurement will let you use just the 9411 and 9215 to make correlated
measurements with the chassis' sample clock.How do i use the chassis sample clock in&nbsp; DAQmxCfgSampClkTiming*If you need this kind of
analog-input-to-position correlation, then you'll need to use two
digital input modules: one in slots 1 through 4 to create the sample
clock via change detection, and another in slot 5 or 6 to take the
position measurement.Assuming that i will have two 9411 modules Correct if i'm wrong but i need to find out how do i configure the encoder as the sample clock for both Position measurement as well as Analog Input to achieve my purpose right ?.What is confusing me is how will i do the wiring do i have to take two parallel wires from each channel of&nbsp; the encoder so that A &amp; B will be connected to both the 9411 modules because if i'm not wrong i will need to connect&nbsp; A &amp; B&nbsp; of the encoder to the 9411 in the 5-6 slot without which i wont be able to get the position and also for change detection.It would be great if u can guide me on the flow of the configuration in the program and setup. Need your suggestion's Thank uParikshitMessage Edited by Parikshit on 03-07-2008 05:31 AM
Parikshit
2008-03-18 15:40:12 UTC
Permalink
Thank you Joe:smileyhappy:

I think you have cleared a few doubts.Correct me if i am wrong but what
u mean to say is that by using the same clock for two tasks they are
not dependant on the sequence of the Read Statements and both the task
data can be correlated. Your answers have made me think a bit more
deeper here it goes( Most of them are basics i'm asking them coz i'm
confused)

"When a hardware-timed measurement is configured, it gets its own memory buffer"
Will my measurement be hardware
timed,I mean as u know my clock will be an encoder which is passed as a
sample clock to the tasks using the change detection event is such a
setup called harware timed?

" As each task receives its start trigger, the buffers begin to be filled with samples with each tick of the sample clock"
I didn't exactly get the start trigger
part are you reffering to the sample clock(change detection-- encoder)
as the start trigger coz i am not using any other triggers?

" When you call a DAQmx Read function, you're asking for the samples in the buffer, not the samples currently coming in"
*Does this mean that the data in the
buffer is filled based on the ticks of the encoder and that data you
are reading using the read function after it is filled in the buffer.So
in that case the data will be continously filled in the buffer
regardless weather i read it or not - right?

There is a lot of ambiguity when it comes to this part.&nbsp; For Example

Create Analog Input
Analog Input Sample Clock =&nbsp; Change Detection Of the Encoder(Rate = 10000, Number Of Samples Per Channel = 72000)
Number of Samples Per Channel = 72000

Read Analog Input (Number of Samples Per Channel = 72000)

*Does the Read statement wait until 72000 samples are acquired&nbsp; or
in other words till the change detection takes place 72000 times.

*Does more Samples Per Channel mean more time to acquire &amp; why
do we have to pass this parameter two times once in the configuration
of the sample clock (DAQmxCfgSampClkTiming) and once in the Read Input Fuction.

*How does the Rate in DAQmxCfgSampClkTiming affect my above
question&nbsp; because pratically what i saw is that when i increased the
rate the Read statement executes faster.

Basically i want to capture data for 5 seconds should i keep on
looping&nbsp; the Read Statement for 5 seconds or should i increase the
number of samples per channel to such an extent that it will capture
data using 1 Read Statement to avoid software timing issues.

"If, however, you can find a common sample clock
that will suffice for both of your analog measurements, then you should
use that one instead."I
have 2 Analog Input modules - 17 lines in that single task.Out of the
those16 lines have to measured at millisecond speed which include
crtitical parameters such as temperature and flow.Only 1 line has to
measure Load which has to have the sample clock as change detection
which as u know has to be correlated with position.I will have a
problem if i set the change detection as the sample clock for the
complete AI task because i will have to assign the same number of
samples per channel for the Load that i have set for position
measurement task which has to be high to avoid software timing
issues.But since the task is common for all the lines the time taken to
read temperature lines will be very high and buffer allocated also will
be high(17*numsamperchan). Even if i use ai/sampleclock for both the
tasks still the samples per channel problem will persist with longer
time taken.Your Thoughts?

One work around that i have thought is as i have said previoulsy is something like this
&nbsp;
while( 1 )
&nbsp;{&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; DAQmxErrChk (DAQmxReadCounterF64(taskHandle,1000,-1,data,10000,&amp;read,0));&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(read)&nbsp;&nbsp;&nbsp; &nbsp;&nbsp
Parikshit
2008-03-27 12:40:11 UTC
Permalink
Thank you Joe
There are a few things i need to know
"Displaying the RPM of the encoder is a counter task. You could measure the frequency of the change detection event or a counter phase to determine how fast the encoder is spinning. The example to start with is DigFreq-LowFreq1Ctr.c."
If i use the counter port should i use all three line(A,B,Z) or just any one of them for frequency measurement.In the test program that u mentioned in the terminal it is mentioned as ctr0 or ctr1 i dont know for which line it gives the frequency?
Secondly Change Detection(9411) can only be used in fourth slot can that be used for frequency measurement?
As suggested by you earlier can i use ai/sampleclock as the sample clock for the Load so that temperature as well as Load(9215) which are clubbed into one analog task can be acquired fast enough and the Load can be correlated with Position which has to have the same sample clock. Are there any draw backs in this system.Or are there any other sample clocks such as ai/sampleclock which will help me in avoiding another chassis.
Regards
ParikshitMessage Edited by Parikshit on 03-27-2008 07:34 AM
Parikshit
2008-04-08 11:40:08 UTC
Permalink
Hi Joe

Thank you for your support&nbsp; it's&nbsp; because of you people that we have
been implement our project.&nbsp; Infact that's the reason for my absence
form this thread for a while.There a few things that i came across
during the implemenation.

The cDAQ 9172&nbsp; chassis has only 2 counters and in my case since the
measuring frequency is 18 khz max for 6000 RPM from the encoder. Since
it is high frequency i&nbsp; have to use both the counters for measuring RPM
which means that i cannot do position measurement at the same time.

To solve this problem i'm ready to switch between the two tasks i.e
Stop RPM measurement task during postion measurement for some time, But this gives rise to a new problem.As disscussed earlier i'm ready to use onboard clock as the common clock for position measurement and Load
measurement so that both of them are correlated.The problem here is
that since the all analog tasks are clubbed together including Load and temperature .I'm starting the analog task and keeping it on from the beggining .But now my position measurement Task will start only when data capturing is required.
My worry is that since both the tasks are not starting at the same time
they might not be correlated since the analog task has started before
the Position Measurement task and the samples in the Analog task which
contains Load might be older data than the Position Measurement task.

* Is there any solution to this problem?
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
While Measuring RPM i'm using both the counters and measuring frequency so to get the RPM i'm using the following formulae
(Frequency X&nbsp; 60) / Pulse Per Revolution Encoder(180).A strange thing i'm observing is that RPM
increments in terms of 33's or 66's and RPM stays constant in terms of
33's or 66's. What i mean to increment or decrement is in terms of 33's
and 66's but i think there should be no such steps it should be actual
RPM right?

*While measuring RPM if there are no pulses from the encoder it comes out after time out. I changed the time out parameter to infinite .The Problem here is that it gets stuck in the Read Statement waiting infinetly for the pulses.But i'm using the RPM Parameter to check weather the encoder has stopped rotating so if
the encoder stops rotating it gets stuck at the read statement so there
is no way determine that the encoder has stopped rotating.Any Inputs?

Regards
Parikshit
Chris_D
2008-04-09 20:40:10 UTC
Permalink
Hey Parikshit, Joe is actually out of the office right now. I am definitely not as familiar with the progression of your application, but hopefully I can provide some insight.You can synchronize the analog input with the position measurement by setting the sample clock source of the counter to the analog input sample clock. To do this, configure a buffered position measurement task, then for the sample clock, specify "/DevX/ai/SampleClock" as the source, where "DevX" is the device name of your DAQ board. As to how you line up the samples, that is a good question and something we will have to look into. One solution may have to be to stop your analog input task and then restart both the counter and analog input task using a start trigger. This way they start at the same time and we know the samples will line up.For the RPM, it sounds like the increments of 33 or 66 have to do with your formula (60/180=.333). Do you notice a trend when you just look at the frequency measurement? What data type are you using (I32, double, etc)? You could give it more precision by returning the measurement as a double.You may want to just change the timeout from infinite and set it to a very high timeout. You could also could in some case where that if it does timeout then it restarts the task and continues looking for pulse or it checks the RPM to see if it has stopped rotating. You would basically handle the timeout error with a case structure and before it passes to any other VI.
Joe F.
2008-04-11 13:10:07 UTC
Permalink
Hi Parikshit,I'm curious how you made the decision that you needed to use two counters for your RPM measurements. If 18kHz is your maximum frequency, then I think using a single counter will suffice. Typically, you can measure up to 100kHz with one counter.
Parikshit
2008-04-14 13:10:08 UTC
Permalink
Thank u Chris and Joe it's good to have u back" I'm curious how you made the decision that
you needed to use two counters for your RPM measurements. If 18kHz is
your maximum frequency, then I think using a single counter will
suffice. Typically, you can measure up to 100kHz with one counter. " Thanks the mistake i was making was that i was setting the minimum frequency as 0 . The strange thing is that in error message it says that for Low Frequency Counter (Option 1)&nbsp; the maximum frequency is 40Mhz and Minimum frequency should be 18.626451e^-3 which is 0.927356389 but when i enter the minimum frequency as 0.01 it accepts it without giving any errors. Why cant i put minimum frequency as 0 as my encoder range is from 0-18 Khz &amp; What should be my bare minimum value for minimum frequency.As u know my setup is 9411 module on 9172 chassis.Regards ParikshitMessage Edited by Parikshit on 04-14-2008 07:52 AMMessage Edited by Parikshit on 04-14-2008 07:53 AMMessage Edited by Parikshit on 04-14-2008 07:54 AMMessage Edited by Parikshit on 04-14-2008 07:55 AM
Joe F.
2008-04-15 13:40:07 UTC
Permalink
Hi Parikshit,I believe you may have misunderstood the error message. I simulated your setup and set the minimum frequency to 0Hz and also saw error -200527:Possible reason(s):Measurements: Requested values of the Minimum and Maximum properties for the counter channel are not supported for the given type of device.The values that can be specified for Minimum and Maximum depend on the counter timebase rate.Property: CI.MinCorresponding Value:&nbsp; 0.000000Property: CI.MaxCorresponding Value:&nbsp; 10.0e6Property: CI.Freq.UnitsCorresponding Value: HzOption: 1Property: CI.CtrTimebaseRateCorresponding Value:&nbsp; 80.0e6Property: CI.MinValue Must Be Greater Than:&nbsp; 18.626451e-3Property: CI.MaxValue Must Be Less Than:&nbsp; 40.0e6Option: 2Property: CI.CtrTimebaseRateCorresponding Value:&nbsp; 20.0e6Property: CI.MinValue Must Be Greater Than:&nbsp; 4.656613e-3Property: CI.MaxValue Must Be Less Than:&nbsp; 10.0e6Option: 3Property: CI.CtrTimebaseRateCorresponding Value:&nbsp; 100.0e3Property: CI.MinValue Must Be Greater Than:&nbsp; 23.283064e-6Property: CI.MaxValue Must Be Less Than:&nbsp; 50.0e3Channel Name: cDAQsim_9401Mod5/ctr0Notice that there are three possible counter configuration options since there are three different timebases on the cDAQ chassis (100kHz, 20MHz, and 80MHz). For option one, the minimum frequency is 18.626451e-3 Hz which is 0.018626451 Hz not 0.927356389. The notation "e-3" expands to "* 10^-3".Because you entered 0.01 Hz as the minimum frequency, DAQmx won't choose the 80MHz timebase since the minimum frequency for that option is 0.018626451 Hz and 0.01 is less than that value. Instead, it will choose the 20MHz timebase since the minimum value for that configuration is 4.656613e-3 Hz or 0.00465613 Hz. If you specify a value lower than that, then the driver will choose the 100kHz timebase and allow you to specify a minimum frequency as low as 23.283064e-6 Hz.Take note, however, that by forcing a slower timebase, you will not be able to measure as high a frequency. Those values are given in the error message.
Parikshit
2008-04-25 14:10:12 UTC
Permalink
Hi JoeThank you for your help once gain.There are two more problems i'm facing right now on the site.* As we had disscussed earlier that we will use the onborad clock as the sample clock for both the AI task as well as the Position Measurement task so that both the data can be correlated but the problem is that i cannot set the Onboard clock&nbsp; as the sample clock for position measurement task.It gives the following error----------------------------------------------------------------------------------------------------------------------------Measurements: External sample clock source must be specified for this
application.Unspecified Property: SampClk.SrcChannel Name:
AngularPosition---------------------------------------------------------------------------------------------------------------------------------My doubt is weather the&nbsp; Onboard clock is the&nbsp; chassis clock&nbsp; or&nbsp; Module&nbsp; clock ?*As we had disscussed earlier we need a common trigger for both the Analog Input task as well as the Position Measurement task so that Samples will line up but the problem is Postion Measurement tasks dont accept triggers or&nbsp; for&nbsp; that matter any digital&nbsp; channel&nbsp; cannot be used&nbsp; with&nbsp; triggers is what&nbsp; was told by national instruments engineer.Can u give me a sloution to these problem asu know lining up the analog and position samples is what i'm trying to achieve and at the moment i'm unable to synchronise it using trigers and sample clock.. Regards Parikshit&nbsp;Message Edited by Parikshit on 04-25-2008 09:10 AM
Joe F.
2008-04-28 20:40:12 UTC
Permalink
Hi Parikshit,Yes, the information you received was correct: position measurement tasks cannot use start triggers and they do require an external clock. Since you cannot use a start trigger, then it's best to have absolute control over the sample clock: if the sample clock doesn't tick, then samples won't be taken.My recommendation for you is to generate a sample clock with either a digital output line or a counter. Choosing a counter would be better since counter output tasks can be triggered in hardware.So the basic flow is: set up a counter output to generate your sample clock and start on a trigger. Use that sample clock for your analog and counter measurements. No measurements will be made until the sample clock starts, and the sample clock won't start until it receives its start trigger. So, even though the position measurement can't be triggered, it will have a trigger since its sample clock won't start until the generation counter receives its trigger.I know you may be running out of counters because you keep adding measurements, so you may need a second cDAQ chassis.
Parikshit
2008-05-06 13:10:10 UTC
Permalink
Hi Joe &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thank You for your Kind help once again.My setup is as follows------------&nbsp;Chassis------------* 9172------------Modules------------* 9205* 9215* 9263* 9425* 9411 quantity - 2* 9476So as u can see i have no counter output modules so a bit confused on&nbsp; how i can use your suggestion.However i have been in touch with National Instruments India's Technical support who had escalated the case to NI USand Mr.Steven(NI US) suggested the following solution.As for the problem of Triggering the tasks(Postion measurement Task and Analog Task) at the same time --&gt;" You should use your PFI0 line to do a digital edge start on your analog input module and insert a DAQmx Trigger property node configured as More &gt;&gt; Arm Start &gt;&gt; Digital Edge &gt;&gt; Edgeto specify the edge on which you would like to trigger your position measurement task, and then as a second input to the property node selectMore &gt;&gt; Arm Start &gt;&gt; Digital Edge &gt;&gt; Sourceto specify the source of your Arm Start trigger (PFI0).It is important to remember that you will only have access to the PFI line on slots 5 and 6 of the cDAQ chassis.Best regards,Steven " I think what he means that the same PFI line on which i'm doing position measurement which gets pulses from the encoder can be used as a start trigger for the Analog task so in that way both the tasks should start at the same time.As for the problem of lining up samples of both the tasks using the same sample clock---&gt;"I am not sure I understand clearly, but is there a reason why you do not want to use the DAQmx Timing Property nodewith the:Sample Clock &gt;&gt; Timebase &gt;&gt; Sourceand /cDAQx/ai/SampleClock constant wired up to the propertyfor your ai task and use another DAQmx Timing Property node with the:Sample Clock &gt;&gt; Source/cDAQx/ai/SampleClock wired up to this property for the position measurement task? Please let me know. Thanks!Best regards,Steven "So i think I have i have to set the clock source for the Position Measurement task as /cDAQ/ai/SampleClock whick wouldmean that the sample clock for my Position Measurent task would be the same as Analog Task hence lining up of samples.I have a few doubts as followsMy Analog Task Configuration is as follows Sample Clock Type = ExternalClock Source&nbsp; = OnboardClockAcquisition Mode = ContinousRate =&nbsp; 15KhzMy Position Measurement Task configuration task is as followsSample Clock Type = ExternalClock Source&nbsp; = /cDAQ1/ai/SampleClockRate = 15Khz* Since i have set the sample clock of postion measurement task as /cDAQ1/ai/SampleClock will that mean that&nbsp;the Samples in the Position Measurement task will be generated at 15Khz at that the speed of Analog Task which&nbsp;i have set as the sample clock for it.* When the clock Souce is as External OnboardClock is this the chassis clock or module clock.I need your kind feedback on the above methods to synchronise the 2 tasks. &nbsp;RegardsParikshit
Joe F.
2008-05-07 16:40:15 UTC
Permalink
Hi Parikshit,Steven's advice for you is good. What are the results from trying it?Like he wrote to you, using the PFI line as a start trigger will let you start the tasks simultaneously, and if you start on an edge from your encoder, then that's fine. Similarly, using the same sample clock will ensure that samples are also taken at the same time.As I mentioned earlier, no CompactDAQ module has a clock on it, only the chassis has clocks. You're using your analog input sample clock (which is generated on the chassis) and sending it to your modules. They're using the same chassis clock for their measurements as long as you specify that in your program.
Parikshit
2008-05-08 14:10:15 UTC
Permalink
Hi Joe&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; Firstly Thank you for your kind feedbackThis Concept I have not tried it yet coz i still had some doubtsIf u see in the above post i have mentioned my configurations for both the tasksMy Analog Task Configuration Sample Clock Type = ExternalClock Source&nbsp; = OnboardClockAcquisition Mode = ContinousSampling Rate =&nbsp; 15KhzMy Position Measurement Task configurationSample Clock Type = ExternalClock Source&nbsp; = /cDAQ1/ai/SampleClockSampling Rate = 15KhzQuestion _________I'm not using /cDAQ1/ai/SampleClock for the Analog Task i'm using Onboard clock and sampling rate as 15Khz.For the Position Measurement task i'm using /cDAQ1/ai/SampleClockWill that mean my sampling rate for position measurement will also be 15Khz ?Apart from these what other issues do u think i might face in synchronization of the two tasks like NI support told me that i should expect some sort of&nbsp; delays&nbsp; involved&nbsp; because of the ADC is there any thing else u forsee as a potential problem in making these two tasks synchronize perfectly.RegardsParikshit&nbsp;
Joe F.
2008-05-09 15:10:09 UTC
Permalink
Hi Parikshit,Thanks for re-wording your question. I think I see where your confusion is :-)By specifying the OnBoard clock for your analog input task, you're creating a 15 kHz clock for that task. By specifying /cDAQ1/ai/SampleClock for your counter input task, you're using the exact same clock as the analog input task. When an analog input task is created, so is the ai/SampleClock signal. Whatever that task's clock is and however that clock is made will be copied to ai/SampleClock.Thus, the setup in your post will perfectly synchronize the sampling of both your analog input and counter input measurements.The other delays that NI support mentioned are most likely the multiplexer delays with the ADC. While the analog input modules in your chassis have multiple analog inputs, they only have one ADC. That means that samples from each channel are not taken perfectly simultaneously. The explanation is better in our KnowledgeBase:[1] Difference Between the Sample Clock (Scan Clock) and the Convert Clock (Channel Clock)<a href="http://digital.ni.com/public.nsf/allkb/4D1435DF82EF494186256D8A006DD6D4?OpenDocument" target="_blank">http://digital.ni.com/public.nsf/allkb/4D1435DF82EF494186256D8A006DD6D4?OpenDocument</a> Message Edited by Joe F. on 05-09-2008 09:49 AM
Parikshit
2008-05-16 13:40:10 UTC
Permalink
Hi&nbsp; Joe&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; It looks like my problem is solved. :smileyvery-happy:&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; I sincerly thank you for your help without which this project would not have been possible.Thank You Once AgainRegards Parikshit&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
Continue reading on narkive:
Loading...