LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tektronix AFG 3022: How to use both channel with VISA

Hi all!

I am trying to control the AFG with LabView using the NI VISA driver. There are several given VIs I can use, but I don´t know how to use both channels at the same time correctly. I attached a VI I made.
Problems are:
-Sometimes it works, sometimes random errors occur.
-The waveform generation doesn´t start at the same time.
-To stop the waveform generation I used the "initialize VI" because I found no better one. Else the generation goes on and on, even though the task was terminated in LabView.
-How can I trigger the AFG with my NI 6259 in LabView?

I hope someone has some good ideas helping me out...

Best regards
Yopp
Message 1 of 5
(4,014 Views)
Hi Yopp Qax,

which version of the Tektronix AFG 3022 instrument driver do you use ?
There are two versions of the instrument driver with different interfaces, on the one hand with VISA (version 1.2) and on the other hand with IVI-Driver (version 2.1).
The version with the IVI-Driver supports:
InternalTrigger, ModulateFM, Trigger, ArbWaveform, StdFunc, Burst, Base, ModulateAM, ArbFrequency

Download the driver from the instrument driver network

I look forward to hearing back from you.

Best regards
Benjamin
0 Kudos
Message 2 of 5
(3,998 Views)
Hi Benjamin,

thanks for the replay. You helped me out very good! I had the Visa driver. I downloaded the driver in your link and it´s way better (more functionality) than the one I used. I now have a configuration, which is working. But there are two things I still doen´t know:
- How can I put out a trigger signal on the NI 6259. Am I doing this over the normal daqmx VIs? (I, by now, didn´t have the time to try it myself, maybe someone can give me a hint. Saves time...)

- I want to create two signals on the AFG that are the same, but one is inverted. At the AFG it is no problem (output menu-> invert on/off). This function doesn´t seem to be available in the driver. Is there a possibilty to modify the driver and create a VI with that functionality? Can anyone do this for meSmiley Wink or explain to me what I need to do it myself and how to do it?

Best regards
Yopp


0 Kudos
Message 3 of 5
(3,989 Views)
Hi Yopp Qax,

pulses are generally created on either a digital line or a counter. The PCI-6259 does not have clocked/correlated digital I/O. Therefore if you use the digital lines the output will be software-timed and the accuracy will be system dependent. You would most likely not achieve the frequency you desire. Therefore I recommend using a counter for output.

To create a pulse with varying frequency and duty cycle you can create a counter output and set it for frequency. You can then use a DAQmx Write to update the frequency and duty cycle.

You can not modify the driver because it is a dll and you do not have the source-files for this dll

Regards
Benjamin
0 Kudos
Message 4 of 5
(3,975 Views)
I just wanted to give a quick replay, that I solved the driver problem. After correspondence with the NI driver section, I learned that there are sourcecodes available for the driver. The IVI drivers are written in C and have some kind of wrapper to make them usable in LabView. To change them, one has to change the sources, compile them as .dll and recompile the wrapper.
To uncomplicate the whole thing a little, I took a step back to the VISA plug and play driver. It is written directly in LabView and therefore can be changed in LabView with no steps between. There´s a reference manual for the AFG3k series, which I got from the NI driver support, that helped me a lot understanding the syntax of the Tektronix language. This reference manual can be downloaded from the Tektronix site, too.
I found, that the VISA driver is kind of buggy, but with my new gained knowledge I could fix the bugs and add the functionality, that was missing (invert function).

Maybe this helps someone, who has simmilar problems in the future...

Regards,
Yopp
0 Kudos
Message 5 of 5
(3,934 Views)