First, I am an engineer, not a programmer so I apoligize if I am totally off base here.
I am trying to write a VB.net program that will, among other things,
trigger two function generators (Agilent 33120A's) at the same time
over the GPIB.
I have added to my program references to "NationalInstruments.Common" and "NationalInstruments.NI4882".
I have been able to create two "Devices" and succesfully "Write" commands to them and "ReadStrings" from them.
Now I am trying to get them to both trigger at the same time. Can this be done?
Also, I have found no documentation of any kind on the commands I have
been using. Does anyone know of any? Code examples would
also be great.
The documentation for the .NET language interface can be found in the common .NET help system. Start >> Programs >> Microsoft VS .NET 2003 (2005?) >> Microsoft VS .NET Documentation. Look under the National Instruments.NI4882 branch.
Now, what you're trying to do is a little advanced but I think I can describe it to you. You've been opening devices so far, but for your group trigger you'll need to open a handle to just the GPIB board so that you can send the command to every instrument at once.
-Initialize a board class for your appropriate GPIB board (probably 0 unless you hav more than 1)
-Board.Trigger( addresslist )
-Close the board class. Generally you don't want to use both board and device classes at the same time because they can step on each other.
Hope this make sense. Check out the help for more information on Trigger(). Let me know if you have further questions.
Thanks Scott. Found the documentation, easy when you know where
to look. Wish the readme on the NI488.2 CD had spelled it out
Question with using "Board.Trigger( addresslist
)", will that send a simultaneous trigger to the entire list or will
they trigger sequentially as it goes though the list? If
triggered sequentially, I would think that I should use the
Board.Trigger() method. To use this however, I need to get
multiple instruments to be "Listen-Active". What is the best way
to do this?
The Board.Trigger() method will address all the instruments to listen and then send one GET (Group Execute Trigger) command. So, they're triggered simultaneously. Note that while the command will simultaneously be sent to all instruments, there may be other latencies internal to the instruments that could give you an offset for the various instruments. This may be spec'd in your instrument manuals, or you may just have to experiment with it.