09-27-2006 04:30 PM
firstTask =
new Task(); DaqSystem.Local.ConnectTerminals("/Dev1/Ctr7InternalOutput","/Dev1/Ctr5Gate");firstTask.COChannels.CreatePulseChannelFrequency(
"/Dev1/Ctr7", "PulseTrainSequencer", COPulseFrequencyUnits.Hertz, COPulseIdleState.Low, 0, 5000, .5); firstTask.COChannels.CreatePulseChannelFrequency("/Dev1/Ctr6", "PulseTrainAPDSimulator1", COPulseFrequencyUnits.Hertz, COPulseIdleState.Low, 0, 30000, .5);firstTask.Timing.ConfigureImplicit(
SampleQuantityMode.ContinuousSamples, 1000);secondTask =
new Task();secondTask.CIChannels.CreatePeriodChannel(
"/Dev1/Ctr5", "BufferedEventCounting", .000000025, 53.6, CIPeriodStartingEdge.Rising, CIPeriodMeasurementMethod.HighFrequencyTwoCounter, .0002, 4, CIPeriodUnits.Ticks); // secondTask.CIChannels[0].PeriodTerminal = "/Dev1/PFI18"; /tried this too but not workingdataReader =
new CounterReader(secondTask.Stream);myCallBack =
new AsyncCallback(CounterReadCallback);dataReader.SynchronizeCallbacks =
true;dataReader.BeginReadMultiSampleDouble(-1,myCallBack,
null);taskRunning =
true;firstTask.Start();
I get an error in the callback while reading the data .Status code -89137 . Specified route cannot be satisfied,because it requires resources that are currently in use by another route
COChannel PulseTerminal
Dest Device :Dev1
Dest Terminal : ctr5gate
Resources are used by Source Terminal : Ctr7InternalOutput Destination Terminal :Ctr5Gate
Can anyone let me know what is wrong ?
I 'm also supposed to connect internally the Ctr7 output to multiple counters gate . How should I go about it ?
Thank you
Murugan
09-28-2006 09:48 AM
09-28-2006 10:54 AM
Hi Kenn
Thanks for the reply. But in the code given I'm only internally connecting one signal. But I get the error specified in my previous email.
Question 1: What is the cause of the error ?
Question 2: In the articles they specify about C and Labview. Nothing is specified about C# .
Should I have to use ConnectTerminals twice to connect to RTSI0 and then to another counter's gate ?
DaqSystem.Local.ConnectTerminals("/Dev1/Ctr7InternalOutput","/Dev1/RTSI0"); DaqSystem.Local.ConnectTerminals("/Dev1/RTSI0","/Dev1/Ctr5Gate");It doesnt work it gives the same error.
How to go about this using DAQMX API's?
I couldnt find anything other than connectTerminal for select signal and Change_parameter
Thanks for your Advance help.
Thanks
Murugan
09-28-2006 01:16 PM
09-29-2006 03:25 PM
Hi Kenn
Thanks for the information.
How will I go about in the following scenario.
Each of the 5 counters will be connected to a unknown source. I have to take the known gate signal from a 6th counter as a reference to count the edges of the unknown source for each of the counter.
As per the information given by you If I cannot route the gate signals to the counter as I'm using the period measurement for five of the counters. How will I go about this ?
I will be using the period measurement to count the edges in the five counters .
Instead of using the gate signal is there any other way to go about it?
Another angle : if I dont connect the gate but if I give the measurement time parameter to be the 1/frequence of the gate signal in the CreatePeriodMeasurement function with 2 counter high frequency parameter it works fine giving the number of edges of the unknown source. I think in this case for the measirement time given it counts the number of edges. But the 2 counter high frequency doesnt make any sense.
Thanks for your advance help Kenn.
Thanks
Murugan
10-02-2006 09:36 AM
10-02-2006 03:27 PM
Hi Kenn
Thanks for the reply.
Quest ion 1: But I didnt get the reply for my first part of my question in my previous email . Regarding the connections if I'm going to connect each of the counter gate to a single output of a counter.
Question 2: Yes it works with one counter. The frequency of the unknown signal will be less than 20 MHZ. But if i change the parameter for the create period measurement API form 2 - high frquency counter to one . It doesnt work .Please clarify.
Question 3: If I'm going to go with one counter period measurement and I want all the counters to start counting at the same time How do I go about it? I read about ArmStart Trigger. If I use ArmStartTrigger what will be the source while using the single counter period measurement. Should I have to use a Start Trigger after using the ArmStrart Trigger ? What will be the source of the start trigger? Can you please explain. I did a search on this but couldnt find much information on DAQMX. Few I found didnt answer my questions.
Please clarify/answer/explain the above specified questions.
Thanks
Murugan
10-03-2006 04:35 PM
Question 1: But I didnt get the reply for my first part of my question in my previous email . Regarding the connections if I'm going to connect each of the counter gate to a single output of a counter.
Route your the output of the counter you want to use to a RTSI line. Then route from that down to each of the gates. This should work in a one counter period measurement. Or simply connect them externally with wires.
Question 2: Yes it works with one counter. The frequency of the unknown signal will be less than 20 MHZ. But if i change the parameter for the create period measurement API form 2 - high frquency counter to one . It doesnt work .Please clarify.
I am not sure what you are asking here, what doesn't work?
Question 3: If I'm going to go with one counter period measurement and I want all the counters to start counting at the same time How do I go about it? I read about ArmStart Trigger. If I use ArmStartTrigger what will be the source while using the single counter period measurement. Should I have to use a Start Trigger after using the ArmStrart Trigger ? What will be the source of the start trigger? Can you please explain. I did a search on this but couldnt find much information on DAQMX. Few I found didnt answer my questions.
You can use the Arm strart trigger to arm your counters and then the start trigger to begin the counter operation. You can use one of the available PFI lines as your trigger source, such as PFI0
Lastly, what is your overall application from a high level perspective?
Regards,
10-04-2006 10:11 AM
Good morning Kenn
Question 2: C# API to create period measurement is
measurementTasks[i].CIChannels.CreatePeriodChannel(inCtr,
"BufferedEventCounting", .000000025, 53.6, CIPeriodStartingEdge.Rising, CIPeriodMeasurementMethod.HighFrequencyTwoCounter, .0002, 4, CIPeriodUnits.Ticks);Even for the case of one counter the program works only if I give the CIPeriodMeasurementMethod to be HighFrequency 2 counter. If the parameter is given as lowFrequency one counter the data is always null. Can you please clarify .
Thanks I got the ArmStartTrigger to work. Instead of Start trigger I have created a Digital Channel with Dev1/port0/line0 and toggled the bit to true to false to start the counters at the same time.
Higher level view of this project is to identify the specific pathogens in the atmosphere.
Sequence-specific probes are hybridized to genomic DNA. Proprietary microfluidics stretch the DNA to full contour length and deliver the individual molecules to be read by the laser excitation . x number of APD's will be collecting burst of photons from the laser excitations and data analysis will be done to identify the barcode of the pathogens based on the data collected.
Thank you
Murugan
10-05-2006 02:14 PM