Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

9422 dual daqmx counter tasks

I am using a 9172 cDAQ chassis with a 9422 DI module.  I am trying to asynchronously clock in two inputs.  I have created 2 DAQmx tasks to collect the counts, and when used individually they work fine.  It appears that if I arm a second counter, it disarms the first one.  Is it not possible to use both clocks simultaneously?
Jim

LV 2020
0 Kudos
Message 1 of 11
(4,631 Views)

Hi Jim,

 

Yes, you can use two (2) counters simultaneously. I recommend looking over the DAQmx examples in the Example Finder. I'm not clear on the function of the two vi's you focused on in your image. How did you come about those 2 VIs?

 

Regards,

Glenn

 


Regards,
Glenn
0 Kudos
Message 2 of 11
(4,597 Views)

Hi Glenn,

 

the VI is attached.  As I mentioned, every time I arm 2 events, only the second one works.  if I arm counter 1 then 2, only counter 2 works.  Arm 2 then 1 and only 1 works. I have looked at the examples, but didn't really see anything that addressed simultaneously clocked events.

 

Thanks for the reply,

Jim

Jim

LV 2020
0 Kudos
Message 3 of 11
(4,591 Views)

Hi Jim,

 

I'm not sure how the attached vi contributes to the application. I noticed that it nests a state machine and does only a single vi depending on the value connected to the action. 

 

To clarify, you want to run two counters to count two inputs?

 

Regards,

Glenn


Regards,
Glenn
0 Kudos
Message 4 of 11
(4,578 Views)

Hi Glenn,

 

Here's the deal.  I have two flow meters in two pipes.  Each pipe discharges water periodically, and I need to measure the volume discharged.  As you observed, the larger VI is a state machine, and two of the the states poll the counters.  What the program should do is arm the counters and poll them.  When the count begins to go up on one of them, it should look for it to stop increasing.  Once the count stops increasing, the flow is done and the volume should be recorded.  Then the counter needs to be cleared and re-armed.  As I do not control when the flow will happen, they both need to be able to be polled in an interleaved manner.  I hope adds a bit of clarity.

 

Regards,

Jim

Jim

LV 2020
0 Kudos
Message 5 of 11
(4,573 Views)

Hi Jim,

 

The counters are independet from one anotherso, arming one should not cause the other to disarm,

1) What is the trigger?

2) Does one counter stop to count?

3) How are you arming the counters?

4) What are you using for the sampling clock?

 

Regards,

Glenn


Regards,
Glenn
0 Kudos
Message 6 of 11
(4,556 Views)

Hi Glenn,

 

This temporarily dropped down on the priority list, but it's up top again.  As stated previously I am using DAQmx tasks to collect data with a 9172 cDAQ chassis and NI 9422 DI modules in slots 5 & 6.  Specs say that the 9172 has 2 counter/timers, but I cannot seem to be able to use more than 1 at a time.    I have 4 counter tasks, one for eack flow meter.  They are connected to the inputs for ctr0 and ctr1 for each 9422.  Tasks CNTR0_Counts and CNTR1_Counts are configured to the ctr0 and ctr1 inputs of the module in slot 5.  CNTR2_Counts and CNTR3_Counts are configured for cntr0 and cntr1 inputs of the module in slot 6.  Using the attached VI I get the following results.  If the two loops are configured to collect gata on cntr 0 & 1 on the same module, the data is the same for both.  If I try to simultaneously collect data on 1 channel of each module, I get an error.

 

Thanks for any help,

 

Jim

 

 

 

 

Jim

LV 2020
0 Kudos
Message 7 of 11
(4,480 Views)

Hi Jim,

 

Have you ran Count Digital Events.vi? That should be an example that is suitable for your application.


Regards,
Glenn
0 Kudos
Message 8 of 11
(4,451 Views)

Hi Jim,

 

The counters in CompactDAQ are actually on the backplane, not the modules.  So while they're accessible on slots 5 and 6 in the cDAQ-9172, there are only 2 for the chassis, and so if you use both in slot 5, you won't have any available in slot 6.  It sounds like you may be trying to use 4 total, and there are only 2.

 

If at some point you're looking at new hardware, the new cDAQ-9174 and cDAQ-9178 chassis have 4 backplane counters, which are accessible through any slot.

 

Regards,
Kyle

0 Kudos
Message 9 of 11
(4,441 Views)

Hi Kyle,

 

I understand that the counters are in the backplane.  At the time that I ordered the chassis my sales rep told me about the 9174 & 9178, but I couldn't wait a month for them to come out.  While I have 4 counter tasks, I am only trying to use 2 at a time.  That would double my acquisition rate.  See message 3 of this thread, as well as the last 2 sentences of message 7.

 

Jim

Jim

LV 2020
0 Kudos
Message 10 of 11
(4,403 Views)