Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-6212 - Generating 1.2kHz Square Wave (VB6)

Hi, 

 

I am rewriting existing NI-DAQ VB6 code that was written for the NI-6062E to VB6 DAQmx code for the NI USB-6212.  In my legacy NI-DAQ VB6 code (written for the 6062E) I was successfully generating a 1.2kHz square wave.  However, when trying to generate the same square wave using NI Measurement & Automation Explorer and the NI USB-6212, I consistently receive the following error message: Onboard device memory underflow. Because of system and/or bus-bandwidth limitations, the driver could not write data to the device fast enough to keep up with the device output rate.  Below is a screenshot of the error.

 

SquareWaveError.JPG

 

 

I've tried a variety of combinations for the "Samples to Write" and "Rate (Hz)" parameters such that the resulting waveform would still be at 1.2kHz but I consistently receive this same error.  Based on my research, it seems like my computer is unable to write to the NI-USB 6212 the necessary samples at a rate quick enough for the NI-USB 6212's buffer to not become empty.  However, when I run the "ContGenVoltWfmIntClk" example provided by NI, I observe the 1.2kHz square wave on my oscilloscope when using the following parameters. 

 

NIExampleSquareWave.JPG

 

 

Is the reason for the difference in behavior between each program due to additional overhead associated with attempting to generate the waveform by running NI Measurement & Automation Explorer?  If not, what are other potential causes for the behavior observed above?

 

Thanks,

 

Scott

0 Kudos
Message 1 of 3
(6,825 Views)

Hello Scott,

 

What versions of NI MAX and DAQmx are you using? Are you still using the traditional DAQ as well on that same computer?

 

Also, do other devices work properly and is this the only device throwing that error? 

 

Lauren

Applications Engineering

National Instruments

0 Kudos
Message 2 of 3
(6,797 Views)

Hi Lauren, thanks for the quick reply.  Below is a screenshot of the versioning information on my system (versions of the two programs you asked about are outlined in red below).  Please note that I am running this software on a WinXP virtual machine.  I assume that there is a certain degree of additional latency from running everything in a VM (maybe that's contributing to this behavior, not sure).  I am only running (and have access to) the NI USB-6212.  Don't presently have access to a NI-6062E. Consequently, I am not sure if other devices would throw a similiar error.

 

System Info.JPG

 

Thanks,

 

Scott

0 Kudos
Message 3 of 3
(6,792 Views)