Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

vbnet counter input channel read

Hello Kaxten,

From what I understand when you use the following call function call:

task.CIChannels(0).datatransfermechanism = CIDataTransferMechanism.Dma

- or -

task.CIChannels(0).datatransfermechanism = CIDataTransferMechanism.Interupts

for multiple channels before you start the task. This will cause VS to freeze and lock up. If you only have this one line of code specifying the transfer mechanism (DMA or interrupts) you won't see this issue.

Is it possible for you to post a small snippet of your code that will exhibit this behaviour. I want to test this issue on my end.

Regards,
  Sandra T.

Applications Engineer | National Instruments
0 Kudos
Message 31 of 35
(1,814 Views)
Hello Sandra,

I have a Test class (the top level class that contains everything else). I then have AI/DI/CI and 1 CO classes. These work in conjunction with testtype classes and my analaysis class to determine what type of analysis can be run.

If not recording, then I have the timing of the ai/di set to continous and the ci set to hardware single point with the one co generating the pulse.
If recording data then single or multiple is determined by the number of ci's currently enabled. if <= 1 then I am using continous with async callbacks to get the data, if >1 then I would like to use the irq with a reduced timing from DMA and continue to use the async callbacks, but currently I have this configured to use a windows timer and have the ai/di set to continous and the ci set to hardware single point. I then grab a sample when the timer goes off (SLOW).

With IRQ the application runs and starts recording, it just doesn't come back and visual studio doesnt' respond either. The number of samples and the pulse freq were available to configure these were dropped down to a very slow rate with a very small sample size (I dont' remember just how slow). This was run three time and I had to use ctl+alt+del each time to stop it. Each time the samples and frequency were dropped down each time.

The code below stars with a comment before each routine.

Thanks again for yoru help,

cm
0 Kudos
Message 32 of 35
(1,805 Views)
0 Kudos
Message 33 of 35
(1,802 Views)
Hello cm,

I was looking through your code, it is good to see that you are using try/catch to handle exceptions. I also appreciate the comments.
Have you been running debug mode on this code? Have you been setting break points? What section of your code do you see the system slowing down?

Regards,
  Sandra T.

Applications Engineer | National Instruments
0 Kudos
Message 34 of 35
(1,786 Views)
Hello Sandra,

Yep, I have been running in debug mode and using breakpoints (Customer has the hardware and I email him the code and he recomiles it in visual studio and I debug while talking him through it over the phone = painful...)

The slowdown happens in the async read, it just doens't come back to it. Same setup as when I have only 1 ci active that I am trying to read from (only difference is the dma or irq).

Thanks for your help,

CM
0 Kudos
Message 35 of 35
(1,780 Views)