Hi,
I'm pretty new to VB and have been trying to follow the application example in the E364xA User's And Service Guide for programming a pair of E3648A power supplies using a VBA program within Excel.
I have a National Instruments USB interface and can get the example application to work just fine.
My goal is to have the outputs on the power supply change at the same time. I understand how I can setup a trigger source from GPIB. I can send each power supply a "*TRG" command and the outputs change as expected.
I think to get both power supplies to change at the same time, I would need to use the GPIB Group Execute Trigger (GET), as described on page 93 of the user's guide.
What would be the recommended way of doing this, as "GET" doesn't seem to be a SCPI command?
I assume I would need to call a VI function to send GET out on the interface directly?
Thanks!
I'm pretty new to VB and have been trying to follow the application example in the E364xA User's And Service Guide for programming a pair of E3648A power supplies using a VBA program within Excel.
I have a National Instruments USB interface and can get the example application to work just fine.
My goal is to have the outputs on the power supply change at the same time. I understand how I can setup a trigger source from GPIB. I can send each power supply a "*TRG" command and the outputs change as expected.
I think to get both power supplies to change at the same time, I would need to use the GPIB Group Execute Trigger (GET), as described on page 93 of the user's guide.
What would be the recommended way of doing this, as "GET" doesn't seem to be a SCPI command?
I assume I would need to call a VI function to send GET out on the interface directly?
Thanks!
To use the Group Execute Trigger, you must open a computer interface session in addition to the instrument sessions and use the viAssertTrigger function in VISA in conjunction with some lower level programming.
The computer interface session can be opened using *viOpen* (defaultRM, +ioAddress+ , VI_NULL, 1000, my_controller) where ioAddress = "GPIB0::INTFC".
After sessions to the GPIB interface and specified devices have been opened, couple the outputs of individual power supplies (if desired), and set the trigger source to bus. Set the desired trigger level of all instruments, turn the output on, and initiate the trigger system.
Now here is the tricky part: Before using viAssertTrigger, you must make sure that all the instruments are listening. This must be done with low-level commands. In order to write low-level commands, use the command *viGpibCommand* (my_controller, +cmdString+ , Len( +cmdString+ ), actual). cmdString is a string of ASCII characters that corresponds to the Talk and Listen Addresses of an IEEE-488 device. This string will change based on what GPIB addresses that you are using. The string that I used in my example program is ?U!". Here's an overview of what each character does.
? --> "Unlisten" for all devices. This ensures that no unwanted devices are listening when the trigger is sent.
U --> "Talking" for Computer interface. The software that you are using will be the only one sending commands.
! --> "Listening" for GPIB0::1 (address of first instrument)
" --> "Listening" for GPIB0::2 (address of second instrument; in VBA a quotation mark is entered as "" within a string)
?U will be used for whatever instrument addresses you have. The changing components are the ! and the ". I have attached a picture that tells you which characters to use.
Once the low-level programming is finished use *viAssertTrigger* (my_controller, VI_TRIG_PROT_DEFAULT) to use "GET."
-----
Edit: I have attached a second file showing another way to send GET using VISA in the file VISA_GET_ex2.xlsm.
Edited by: MaxineF on Aug 6, 2015 2:56 PM