08-25-2022 08:18 AM
I have a PXIe-1073 chassis that has various cards in it and would like to make some programs to test them. VBA is my prefered editor for this and I am having trouble seeing the cards. I can see them in NI Max and when I put their address in some example code I use for GPIB communication I get some errors at ioMgr.open().
Any help would be appriciated. At this point I am just tring to send an IDN and get the response from the cards.
Dim ioMgr As VisaComLib.ResourceManager
Dim instrument As VisaComLib.FormattedIO488
Dim idn As String
Set ioMgr = New VisaComLib.ResourceManager
Set instrument = New VisaComLib.FormattedIO488
Set instrument.IO = ioMgr.Open("PXI15::0::INSTR")
instrument.WriteString "*IDN?"
idn = instrument.ReadString()
ActiveSheet.Cells(1, 1) = idn
08-25-2022 08:59 AM - edited 08-25-2022 09:01 AM
What exact instrument are you trying to control?
NI PXI instruments do not use SCPI command and will not respond to IDN? query
For NI PXI instruments, instrument control is through their respective drivers (C DLL).
08-25-2022 09:10 AM
I am trying to control a 5652 generator. Is it possible to develope a program in VBA that will communicate with my PXI cards? If so do you have an example I can work off of?
Thanks
08-25-2022 09:14 AM
I don't think there is an example for VBA, but if you know how to call a C DLL in VBA, you can directly use the RFSG driver dll.