Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I program 6013 to give periodic timer events in VB

Using Visual Basic 6, can I program the NI6013 to give me an interrupt (VB event) on a periodic basis - say once every 100 microseconds. I'd use the VB timer control, but it doesn't provide either the resolution or accuracy I need. I need to sample some digital inputs that I'll use to control analog acquisition.
0 Kudos
Message 1 of 3
(2,827 Views)
Hi,

Thanks for contacting National Instruments. Are you wanting to trigger an acquisition or output every 100ms or cause a VB Event to occur?

If you want to trigger an acquisition or output every 100ms you can use the counter/timers to generate a pulse every 100ms. This can then be used as a trigger. To do this you will need to change the terminal count of the counter to a lower number, then it will roll over faster. You can configure it to roll over every 100ms.

If you are doing software events then there may not be a more exact way than using the VB timer. In our CVI software package we have something called an asynchronous timer which is basically a software timer just as you are using, but it runs in a different windows thread. Therefore it is not a
ffected or changed when your program runs, it stays very exact (to milliseconds). We don't have any information on this in Visual Basic but it's something you could do some research on if it seems helpful.

If you are still stuck, send me some more info on your application and we can go from there.

Erick D.
NI Applications Engineer
0 Kudos
Message 2 of 3
(2,827 Views)
Thanks Erik,

What I want to do is get a VB event every 100 microseconds (not 100 milliseconds). To the best of my knowledge, there is no system timer that can trigger an event at that frequency - the VbTimer's accuracy is about 55ms, and the multimedia timers are good down to about 1ms (depending on the OS). The performance timer has the required resolution and accuracy, but can only be queried (for the current count) and can't raise an event.

I was hoping that I could use one of the timers onboard the 6013 to generate an interrupt which I could then use to raise an event.
0 Kudos
Message 3 of 3
(2,827 Views)