AnsweredAssumed Answered

*TRG much slower than READ? for DCV  with 34410A?

Question asked by greif on Jun 8, 2016
Latest reply on Jun 29, 2016 by tomc

I have used Excel VBA to  use  READ? to save thousands of sequential voltage measurements to Excel cells at the rate of about 325/sec.  Expecting fatser results using *TRG and saving to the 34410A memory I found I had to insert delays in the VBA code (120ms between *TRG commands) or triggers went missing. This slowed the *TRG method down to 8/sec.

Question; Am I doing something wrong with the VBA  *TRG code?

 

Below are the snippets of code and settings for both ways.

(Win 7, Excel 2010)

 

Excel VBA code:

--------------------------------------------------------------------------------------------------------------

'Agilent 34410A using Read? command reads volts at ~325/sec

--------------------------------

'These should make it faster to gather voltage data:

instrany.WriteString ("display off")

instrany.WriteString ("sense:volt:dc:zero:auto off")

instrany.WriteString ("sense:volt:dc:range:auto OFF")

instrany.WriteString ("sense:volt:dc:range:upper 10")

 

instrany.WriteString ("sense:volt:dc:null:state 0")

instrany.WriteString ("sense:volt:DC:aperture:enabled 1")

instrany.WriteString ("trigger:sequence:delay .0001") 'delay between readings in seconds

instrany.WriteString ("sense:volt:DC:aperture .0002")

 

instrany.WriteString ("Trigger:Sequence:source IMM")  'bus is software triggering

 

i = 1

For i = 1 To 5000

instrany.WriteString ("Read?")

'sleep 120 'time delay of 120ms, prevents lost *TRG commands

idn1 = instrany.ReadString()

ActiveSheet.Cells(i, 1) = idn1

Next

--------------------------------------

 

========================================================================

==========================================================================

 

'

'Agilent 34410A using *TRG command reads volts at ~8/sec

'------------------------------------------------

'These should make it faster to gather voltage data:

 

instrany.WriteString ("display off")

instrany.WriteString ("sense:volt:dc:zero:auto off")

instrany.WriteString ("sense:volt:dc:range:auto OFF")

instrany.WriteString ("sense:volt:dc:range:upper 10")

 

instrany.WriteString ("sense:volt:dc:null:state 0")

instrany.WriteString ("sense:volt:DC:aperture:enabled 1")

instrany.WriteString ("trigger:sequence:delay .0001") 'delay between readings in seconds

instrany.WriteString ("sense:volt:DC:aperture .0002")

 

'-----------------------------------

'Setup for reading into DMM memory

instrany.WriteString ("sample:count 1")  'samples per trigger, should always be 1

instrany.WriteString ("sample:source IMMediate")

instrany.WriteString ("Trigger:Sequence:source BUS")  'bus is software triggering

instrany.WriteString ("Trigger:Sequence:count 5")

instrany.WriteString ("INITiate:Immediate")

 

 

i = 1

For i = 1 To 5

instrany.WriteString ("*TRG")

Sleep 120 'time delay of 120ms, prevents lost *TRG commands

Next

-----------------------------------------------------------

Outcomes