Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

buffered event counting using a PMT and a PCI-6621 card

Hi David,

 

I have replaced the sample clock with the CO Pulse Freq task.  Sonow I have the vi set up as asuch, The CI Cnt Edges vi is wired to the DAQmx Channel Node (with CI.Freq.Term selected andwired to Dev1/Ctr1InternalOutput), which is then wired to the CO Pulse Ref (this is in a While Loop with the Dev1/ctr1 also withint the while loop and connected to the counter function - the frequency function is wired to a vallue outside of the while loop) and then to theDAQmx Timing vi set to Implicit (with the sample mode set to finite samples since we want to be able to specifiy how many samples we get.  I have also put the read vi in a while loop as you suggested, with the number of samples per channel connected to the wire containing that value used in the timing vi (just for my knowledge, how does this benefit the running of the vi).

 

My problem now is that generally when I run it I don't get an error, but the vi doesn't appear to be able to stop without clicking on the abort execution button (clicking on the stop button for the while loops doesn't seem to have any effect on stopign the vi either.  The reason I say generally in the previous sentence is that sometimes i would get this error afte running the program (with no errors) a couple of time:

 

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> 

 

I have attached the updated vi.

 

Thanks again for your help.

 

Scott

0 Kudos
Message 21 of 24
(2,076 Views)

Hi scottum,

 

Each task needs to be set up separately (eg each task requires its own start and stop / clear functions).  The way you have it set up in the vi attached, the CO Pulse Freq and CI Cnt Edges tasks are essentially combined into one.  Take a look at the DAQmx examples that deal with multiple tasks as a reference.

David
Applications Engineer
National Instruments


Digital Multimeters
0 Kudos
Message 22 of 24
(2,056 Views)

Hi David,

 

My apologies for the repeated questions on this. I seem to have picked up other parts of labview ok, but the intricacies of the DAQmx stuff I am finding hard to work myself around.

 

I had a search on the NI developer ZOne for examples of multiple tasks as a reference, but I couldn't find anything, could you point me towards soemthing. Even so, I still had a go at modifying the vi taking into account that each tasks needs its only start stop clear functions.

 

So I gave the CO Pulse Freq its own task and for the timing vi I have kept it implicit but I have change it to finite samples as I do need to be able to select the number of samples I get. I realised I had to change it to the finite samples because I had removed the timing vi from the CI Cnt Edges task (now I just have the DAQmx channel node there with the counter input set to the Ctr1internaloutput).

 

My problem is that when I run it, it doesn't stop after what should be about 50 sec (with the only way to stop it being to press the abort button as pressing the stops buttons does not appear to do anything). Have you got any other suggestions?

 

I have attached the updates vi.

 

Thanks again,

 

Scott

0 Kudos
Message 23 of 24
(2,045 Views)
I'm not quite sure what all this talk of "multiple tasks as a reference" means, but I did have a gander at your code.  I believe what is going on is that your CO Create Channel is in a while loop, so you are repeatedly creating DAQmx tasks every time that loop runs, which, without any timing in the loop, is as fast as the computer can do it.  This is mostly likely filling up the computer's memory which is why you need to be using the abort.  I would recommend removing that loop and checking out the Gen Dig Pulse.vi example located in the LabVIEW example finder under Help»Find Examples...»Hardware Input and Output»DAQmx»Generating Digital Pulses
Doug Farrell
Solutions Marketing - Automotive
National Instruments

National Instruments Automotive Solutions
0 Kudos
Message 24 of 24
(2,033 Views)