04-07-2009 02:16 AM
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
04-08-2009 11:50 AM
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.
04-09-2009 05:47 AM
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
04-10-2009 09:41 AM