09-17-2025 04:20 AM
Hi,
I’m creating a VI for configuring and managing an Agilent 34980A. I need to trace somehow the SCPI commands that I sent by Agilent‘s Vis. I have thought to use the VISA events to do for avoid changing in those Vis but I’m not able to find a way or the property to obtain back the string written to the device. Is there anyone who has done that?
Thank you for the help!
Here after a little example to understand my idea: since the Agilent’s Vis are inside my VIs for manipulating the data I prefer to pass by the events. I have Labview 2019.
Best Regards,
Zuc
09-17-2025 04:37 AM
Hi Zuc,
@Zuc_lab2 wrote:
I need to trace somehow the SCPI commands that I sent by Agilent‘s Vis. I have thought to use the VISA events to do for avoid changing in those Vis but I’m not able to find a way or the property to obtain back the string written to the device. Is there anyone who has done that?
So you want to create a logfile with all commands send to your device? (Like VISATrace in MAX?)
I would change that Agilent device driver to:
09-17-2025 04:47 AM
Hi GerdW,
yep the semplified aim is to have a text file with all the SCPI commands. Hopefully, in the future, to also save the answers of the device.
as i said i'm trying to not change the Agilent's VIs (since they are in other projects) and to have something a bit more flexible also because the Agilemnt's VIs are so many that it can be quite boring.
best regards,
Zuc
09-17-2025 04:56 AM
Hi Zuc,
@Zuc_lab2 wrote:
Hopefully, in the future, to also save the answers of the device.
So you need a Write subVI next to the Read subVI…
(The device responses can be quite large once you use the buffer abilities of such DMMs…)
@Zuc_lab2 wrote:
as i said i'm trying to not change the Agilent's VIs (since they are in other projects)
Create a copy of the driver, only used in (and inside) your own project.
@Zuc_lab2 wrote:
because the Agilemnt's VIs are so many that it can be quite boring.
That's why I suggested this Read/Write subVI, so you only need to replace the VISARead/Write function with your subVI.
09-17-2025 05:07 AM
Hi GerdW,
sorry for my questions that can appear to be quite simple, so you suggest to modify this Vi to have everything done in one shot. Is it possible? because i have no access to the code of that vi. Moreover i then need to replace is in all the Agilent's VIs, It's the same to add a the Writetotxt Vi in all of them, right? i was trying to develop something that can be reused and was a module aside from the rest.
best regards,
Zuc
09-17-2025 05:36 AM
Hi Zuc,
@Zuc_lab2 wrote:
so you suggest to modify this Vi to have everything done in one shot. Is it possible? because i have no access to the code of that vi.
You don't "modify" the VISAWrite, but you place it in a subVI. Inside the subVI you can add anything else like your logfile feature…
@Zuc_lab2 wrote:
Moreover i then need to replace is in all the Agilent's VIs, It's the same to add a the Writetotxt Vi in all of them, right?
I have seen device drivers that already came with a dedicated subVI for Read or Write, but haven't checked for your specific device.
Yes you would need to replace all instances (of interest) of VISAWrite with your subVI…
@Zuc_lab2 wrote:
i was trying to develop something that can be reused and was a module aside from the rest.
How often do you need to develop/re-use device drivers?
You know learn the basics once and can apply it to all future developments 😄
09-18-2025 09:31 AM - edited 09-18-2025 09:40 AM
@Zuc_lab2 wrote:
Hi,
I need to trace somehow the SCPI commands that I sent by Agilent‘s Vis
There is a separate SCPI manual for those instruments that explain the SCPI commands in detail
You can just open the Agilent VIs block diagram and look at the SCPI commands they are using.
Or you don't even need the instrument to do this.
Also if you install the full NI-VISA you should have NI I/O-Trace (NI-MAX "Tools" menu) that will log and save all the commands sent and responses received to and from the instrument