I want to continously (until I press the stop button) measure signals with two DAQ-6024E cards and these measurements should be done with low CPU usage. The programming has to be done with VB6 and no measurement studio is available (and won't be in future).
I want to use the internal clock of one of the cards for triggering the measurement (usual frequency will be 0.1 to 1 Hz), however as I am quite new to programming NI cards I have some problems with the help files and the examples. I think some of the ANSI C examples of DAQmx would work, however I don't know how to transfer the functions like "EveryNCallback" to VB. And the exaples of the traditional DAQ are basically what I want to do, but these are running with high CPU usage as they use a while..wend loop instead of an interrupt. Using a timer in VB was quite easy, but these are not really accurate.
I found out that it is possible to create interrupts with GeneralDAQEvent and I have a working code with the "Every n scans"-property (using double buffered reading). This only reads one channel at the moment, however I hope this will also work with "Scan_Start" instead of "DAQ_Start". Basically, this is what I want. As soon as I get the interrupt, I have the values of one card in the buffer and could read the values of the second card.
However I'm not really lucky with this code, as I only want to read data when I need it. I saw that the GeneralDAQEvent can use a counter signal as interrupt. If I could set up a counter using the internal clock, it was possible to use this to create the interrupt and the I'd just have to read all channels from both cards using the "AI_Read_Scan" Function. In my opinion, this was the best way to do it.
Anyone got ideas how I could achieve this? Or any other solution? I doesn't really matter wheter I use Traditional DAQ or DAQmx, the only limitation is that I have to use VB6 and no measurement studio is available.
Thanks in advance, Jogyb