03-27-2009 09:23 AM
03-28-2009 09:10 AM
Hi David,
Sorry about that, have attached it now.
Scott
03-30-2009 01:59 PM
Hi scottum,
What signal do you have physically routed (read: wired) for your Sample Clock signal? There are a number of internal and external possibilities. Please take a look at the M Series User Manual, specifically, the section titled "DI Sample Clock Signal." And as an FYI, you can obtain an explanation of errors from the Help»Explain Error utility.
With regard to your 2nd concern, you can route the pulse count ouput through a shift register, and compare the present value to the past value to get a count after each time step.
03-30-2009 06:53 PM
Hi David,
So at the moment I have the card in the computer. Connected to this will be a BNC 2110 connector block, and attached to this block is the the BNC cable that is connected to the PMT. So on the block I have the option of connecting the BNC cable to either PFI 0/P1.0 or PFI 12/P2.4, I will probably connect to PFI 0/P1.0 (no specific reason, I can of course use the other connection if that is more appropriate).
So as to which signal is actually wired to my sample clock. This is the part I am somewhat unsure of. The idea is to use the second counter (ie an internal source) on my card as the clock source and set the rate to 200Hz to give the timestep we require. But I have been unsure of how to correctly wire this so that the second counter is our source. That is why I started to look at using the advanced terminals that are available. Is there a way to easily do this? (btw, thanks for the tip with regards to the explanation of errors in the help files).
My second concern. Now I am assuming that for me to do this I will need to set it so that the vi reads the samples available from the buffer rather than wait for all the samples to be read. From my understanding of what is written in the help files if I leave it either unwired or set to -1 the vi will wait until all samples are acquired and then they will be read, given that I am acquiring a finite number of samples. Now the help files says this for when you are collecting finite samples and want to continually want to read the buufer:
"If the task acquires a finite number of samples and you set this input to -1, the VI waits for the task to acquire all requested samples, then reads those samples. If you set the Read All Available Data property to TRUE, the VI reads the samples currently available in the buffer and does not wait for the task to acquire all requested samples. "
My problem here is that I can't seem to find how to change the Read All Available Data property.
As for when I would need to connect to a shift register, I assume that would be between the read vi and the build array function. I think I have an idea as to how to compare, so will think more about that and see how I go.
Thanks,
Scott
03-30-2009 08:32 PM
"So as to which signal is actually wired to my sample clock. This is the part I am somewhat unsure of. The idea is to use the second counter (ie an internal source) on my card as the clock source and set the rate to 200Hz to give the timestep we require. But I have been unsure of how to correctly wire this so that the second counter is our source. That is why I started to look at using the advanced terminals that are available. Is there a way to easily do this? (btw, thanks for the tip with regards to the explanation of errors in the help files)."
With regards to what terminal I should use. After looking at the M-series manual, and given that we want to use our second counter here, I am thinking that I should use as my source something like this Dev1/Ctr1InternalOutput. Howeve, do I leave it wired as I have I do I need to change my wiring set up?
Also I have been shown that to find the Read All Available Data property I need to go here - Measurement I/O>> NI-DAQmx>> DAQmx Read Property Node. My next step with this is to work out where to connect it!
Thanks.
03-31-2009 04:37 PM
Hi scottum,
This KnowledgeBase discusses how to route internal counter signals.
With regard to the read all available samples property node, that should be connected between the DAQmx start and the DAQmx read.
04-02-2009 09:52 PM
Hi David,
I have had a chance to read through that article and to try and implement it.
So I put the channel property node between the existing create channel vi(for Ctr0) and the timing vi. But given that I still get an error:
error -200452
Property Node DAQmx Channel (arg 1) in TIRM DAQ - buffered event counting.vi <append>
<B>Property: </B>CI.Freq.Term
<B>Channel Name: </B>Dev1/ctr0
<B>Task Name: </B>_unnamedTask<0>
When I put the error code into the explain errors things, I get this:
Possible reason(s):
Measurements: Specified property is not supported by the device or is not applicable to the task.
I figure I am still doing somethign wrong here. Do i need to have two create channel vis - ie one for each counter?
What else can you suggest?
thanks and my apologies on how long this has gone on.
THanks,
Scott
(I have attached my most recent version of the vi)
04-03-2009 02:44 PM - edited 04-03-2009 02:50 PM
Hi scottum,
Create a freq output on one of the counters.

Then use that output as the input for the 2nd counter task, specifying which input terminal to measure.

04-05-2009 08:07 PM
Hi David,
Thanks for that. I still have some more questions though, especially with regards to some fo the wiring, sorry about this. I am still having a bit of trouble working out how and where to take the freq output from one counter and making it the input for the other counter task. I thought that might mean I need to connect it to the DAQmx Chanel Property Node, but that is already connected to the edge counting create channel vi. So I am not sure where else it can go.
Also given that there is now a frequency term there, what value should this frequency be kept at? Or would this be used to replace (or complement) the rate option on the sampling clock instance for the DAQmx Timing vi?
Also now that the sampling mode is set as continuous samples for the freq output counter, will this stop operation when the edge counting component of the vi finishes it finite sample run? Or would I need to have a while loop or something like that here?
I have included the modified vi with this post.
Thanks,
Scott
04-06-2009 02:27 PM
Hi scottum,
The CO Pulse Freq and CI Cnt Edges are two separate tasks. The CO Pulse Freq task, when started will create a square wave at the frequency you specify in its input. This frequency is the only frequency input required. The CI Cnt Edges task then references that square wave internally to count. As such, you will no longer need the sample clock for the CI Cnt Edges task, you can just go ahead and start the task. You should create a while loop for the user to stop the CO Pulse Freq task (ORing a "is task done" vi with a user control to stop the while loop). Also, put the read vi of the CI Cnt Edges into a while loop with a "wait" vi set to 10 ms.