LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling afg320 from LabVIEW

Hi guys,

 

I would like to be able to control AFG320 from LabVIEW, for instance place a knob on front panel and change voltage, frequecy, amplitude, function and so on. I don't see afg320's drivers on Instrument Drivers menu on Block Diagram.

Any suggestion will be highly appriciated.

 

Thank you for your time,

HrvojeM

0 Kudos
Message 1 of 9
(4,724 Views)

Hi HrvojeM,

 

did you search in InstrumentDriverNetwork on NI's website? ( www.ni.com/idnet )

It has an IVI driver for your instrument…

 

When you have a programming manual for your device (which you should have!) you can implement the needed commands using VISA functions…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(4,712 Views)

Hi GerdW,

 

I've downloaded LLB for afg3xx, converted it but when I try to open it I get the message "VI version is too early (version 5.0) to convert to current LabVIEW version (version 8.5)". I wasn't able to find newer version of afg3xx files. I would like the afg320's options to appear on functions palet (like there are functions for Agilent 34401, ni5660 and so on). Ultimately I would like to copy AFG320's front panel controls on LabVIEW's front panel using numeric controls and indicators in order to make user friendly interface. To make it work I first have to learn how to interact with AFG320 from LabVIEW. 

 

Thank you for your time,

HrvojeM

0 Kudos
Message 3 of 9
(4,672 Views)

HrvojeM,

 

Were you using the driver from this link? http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=E3B19B3E9559659CE034080020E748...

 

If not, where did you acquire the LLB for the afg3xx? Further, while true that you cannot convert directly from LabVIEW 5.0 to LabVIEW 8.5, if you build it into an intermediate version first (like 7.0), you will then be able to convert that up to 8.5. Please reference the following conversion chart: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YSO4CAO&l=en-US . If you have any other versions of LabVIEW available this would be a great step to try.

 

Finally, if you are able to use a newer version of LabVIEW (2012 or later), there is built in driver support available from the first link that won't require any conversion, and should have the options for the afg320 appear as you mentioned with other 3rd party drivers which are NI compatible.

 

Best,

 

Daniel

 

 

0 Kudos
Message 4 of 9
(4,639 Views)

Hi fiendfyre,

 

yes, I've used drivers from the link you mentioned. If I fail to convert the drivers I have, is there some other way to communicate with AFG320 through LabView?

 

Regards,

HrvojeM

 

 

0 Kudos
Message 5 of 9
(4,619 Views)

Hello HrvojeM,

 

Absolutely! At a base level, the LabVIEW drivers for third party instruments are either preconfigured VISA or DLL calls; their major convenience is they already include the syntax for the specific instrument. However, if you go down into the subVIs of this tkafg3x0 driver, it is just a series of implementations of the Call Library Function Node, which calls C functions from a DLL directly. If you know how you would be writing this code in C, or at least what the function prototypes and arguments are for whatever you are trying to do with the instrument (this is probably in the documentation for the instrument, or can be inferred from the DLL), you can do it in LabVIEW with the Call Library Function Node. Here is our help document and a community example:

 

Call Library Function Node

 

Community Example: Configuring the Call Library Function Node to Call a Simple DLL

 

I am still a little confused as to why you were converting the driver VIs into an LLB, I was able to download a quick setup executable from my original link which immediately integrated all the driver files into multiple versions of LabVIEW (2012-2015) and LabWindows/CVI (2013), which I was then able to find them in. Could you shed some light on what exactly your process is?

 

Best.

 

Daniel

 

0 Kudos
Message 6 of 9
(4,597 Views)

Hi Daniel,

 

thank you for explanations. I've downloaded driver from the link you've provided but haven't got the functions I was looking for. I 'm trying to get something like this

funkcije.JPG

 

but only for Tektronix AFG320. I'm measuring two signals (voltages) from my experimental setup in the following manner: First, I manually set the frequency, amplitude, offset and function type on AFG320's front panel. Then I go to LabView 8.5's front panel and set the parameters in DAQ Assistant and click Run. The program averages two signals and writes them in two excel files. Now, I would like to do the first step in LabView's front panel, and I think that in order to do that I have to have the AFG320's functions like the ones for Agilent from the photo. 

I think I have the files I need but I'm unable to view them in LabView's block diagram.

afg funkcije.JPG

 

I'm a beginner in programming so I tried different things (including converting the driver VIs into an LLB) just to get the functins I was looking for. I have access to LabView 8.5 only.

 

Regards,

HrvojeM

0 Kudos
Message 7 of 9
(4,564 Views)

Hello HrvojeM,

 

Thank you for the screenshots! They were very helpful. On my end, installing the drivers from that link did indeed generate a palette.

 

2016-03-21 09_23_44-.png

 

I am using LabVIEW 2015, however, so there might be something happening differently in driver import between our setups. I also wanted to clarify how exactly your driver download worked, since the LabVIEW driver I see on the page I linked is listed as supported for 2012. It might be that this particular driver is not configured to be automatically imported into 8.5? Also it looks like our filenames are different (mine is tkafg3x0). There are a few other things you can try:

 

Potentially you can reimport the driver by going to Help>>Find Instrument Drivers, and see if you can find it under Installed Instrument Drivers. If that still doesn't work, you could try creating your own function palette. Here are a few links that describe that process.

 

Community: Creating a LabVIEW Palette

 

How to Build a Palette Structure for a LabVIEW Plug and Play Instrument Driver

 

Best,

 

Daniel

 

 

Message 8 of 9
(4,541 Views)

Hi Daniel,

 

I think I have the functions after all. I've searched the drivers on NI sites and found the same drivers you've provided but I noticed that they belong to IVI driver type with interface IEEE 488.2 (GPIB). So I searched for IVI drivers on functions palet and found this

IVI.JPG

Now I'll try to use them to communicate with my AFG320.

 

Regards,

HrvojeM

0 Kudos
Message 9 of 9
(4,479 Views)