Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Single-shot waveform and 2 concurrent voltage measurement without hardware trigger

Hi all,
    I had just purchased a USB-6211 unit and faced a little problem with DAQMX8.5 in VB 6.0: 
Can I know how should I do the following:
  1.  Generate a single-shot waveform, say a triangular wave of -5v to +5v
  • AO_0 will generate a +/- 5v triangular wave(single-shot)

    2.   Concurrent Voltage measurement. Immediately after the single-shot waveform in "1" is generated
  • AI_0 and AI_1 will measure 2 different voltage source, concurrently, and ends when the single-shot wave ends
Need help urgently,.....Smiley Sad

Thanks....

Best regards,
Vincent
0 Kudos
Message 1 of 4
(7,615 Views)
Hello VincentTSWong,

It appears that you are looking for a place to get you started with your application.  The best place to start is proabably the example programs (which are located at C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\Visual Basic 6.0).  Some other good resources include:

Using DAQmx in Text Based Programming Environments

Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications.

I am not sure how big this application is going to get, but NI does work with some people who can write complex code. A list of these people can be found at www.ni.com/alliance. Also, if you are going to be working with our DAQ a lot, NI offers great classes that will greatly reduce development time.

I hope this gives you a place to start, post back if you have questions.
Neal M.
Applications Engineering       National Instruments        www.ni.com/support
0 Kudos
Message 2 of 4
(7,603 Views)
Hi Vincent,

In regards to your questions found here and your questions here, I've gone ahead and included some information that you might find helpful.

The first difficulty is that you want the analog input to start immediately after the analog output has completed it's generation.  This could be accomplish by using a software delay, however this wouldn't be very accurate.  I think the best solution would be to output the single shot waveform and start the analog inputs at the exact same time.  Then, in post processing, just eliminate the samples that occurred prior to the waveform being fully sent.  For example, lets say that you are outputting a square wave for 25ms and you want to start acquiring at 1KHz after the square wave is outputted.  You could simply acquire during the 25 ms (which would be 25 samples) and remove those samples from the array after you are done acquiring. 

To synchronize the analog input and output all you need to do is start them at the same time and use the same sample clock.  This can be accomplished by setting either the analog input or output task to be the master or the slave task.  You will set up the master task (lets say analog output) normally and hold off on actually starting the task.  Before you start the task, you will need to set up the slave task (analog input) to use a digital start trigger with the source as "(your device)/ao/StartTrigger".  After you start the slave task, it will begin waiting for the start trigger to occur from the master task.  This means that you will need to start the slave task and then start the master task.  As long as you are using the same sample clock source, your master and slave tasks will now be synchronized.  We don't currently have a example that demonstrates this exact thing in Visual Basic 6.0, but all you really need to do is combine the example for an analog input (including two channel configurations: one for current and one for voltage) and analog output.  Then you will want to add a command like "DAQmxCfgDigEdgeStartTrig" to set the slave task to listen to the master task's start trigger.

Here is an article on where to find the Visual Basic 6 examples.  Also, if you are still having difficulty try looking in the following folder: C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples.

I hope this helps,
Paul C.


Message Edited by Paul C. on 11-12-2007 02:33 PM
Message 3 of 4
(7,575 Views)
Dear Paul,
    Thanks for your guidance. I will have to use the daata elimination method as all my inputs are occupied.

Best regards,
Vincent
0 Kudos
Message 4 of 4
(7,560 Views)