AnsweredAssumed Answered

Need to do a "Power-On Reset" for 34972A

Question asked by bwalch on Jun 1, 2016
Latest reply on Jun 30, 2016 by hognala

Through my (VB6) programming debugging process, the 34972A DAQ gets configured every time the program is ran. Generally, there are no issues, where the initialization commands include a "*CLS" then a "*RST".

USB_ErrNum = viOpen(VISA_DRM, "USB0::0x0957::0x2007::MY49017771::0::INSTR", 0, 15000, VISA_VI_DAQ)
If (USB_ErrNum <> VI_SUCCESS) Then HandleVISAError VISA_DRM ' USB_DRM
USB_ErrNum = viSetAttribute(VISA_VI_DAQ, VI_ATTR_TMO_VALUE, 10000) ' Set the I/O timeout to ten seconds.
If (USB_ErrNum <> VI_SUCCESS) Then HandleVISAError VISA_VI_DAQ

' =====================================================================

USB_ErrNum = viClear(VISA_VI_DAQ)
If Not (USB_ErrNum = VI_SUCCESS) Then HandleVISAError VISA_VI_DAQ ' Clear the interface.
USB0_Str_SendOnly "*CLS"
USB0_Str_SendOnly "*RST"

USB0_Str_SendResp "*IDN?", DSO_ValueStr ' Get and display the device's *IDN? string.

Every so often, after the system goes through it's initialization process, I read various analog instrument sources, such as a pressure gauge (0-10V) and a 4-W RTD. It's when I switch between the DCV to 4-W Ohms mode where I get a "VISA Timeout" error. It's when I get this, that once active, shutting down the program and restarting it (with full initialization) that this timeout error won't go away.

 

The ONLY way I've found is to physically cycle the power to the DAQ. I've yet to find a way to error trap and reset the DAQ through software. I also believe that I'm opening and closing the VISA sessions properly (see below).

 

Any help would be greatly appreciated.

 

Thanks,

Bill

 

Sub Setup_VISA_Instruments()

CloseAll_VISA_VI

VISA_ErrNum = viOpenDefaultRM(VISA_DRM) ' Open the default resource manager session.
If (VISA_ErrNum <> VI_SUCCESS) Then HandleVISA_VISAError VISA_DRM
' Global VISA_DRM As Long    ' 1) Session to Default Resource Manager.
' Global VISA_VI_DAQ As Long ' 2) 34972A Session - USB
' Global VISA_VI_PS1 As Long ' 3) E3640A Session - GPIB Dev# 7

Setup_34972A_DAQ ' VISA_VI_DAQ
Setup_E3640A_PS1 ' VISA_VI_PS1

End Sub

' ==================================================================================

Sub CloseAll_VISA_VI()

'USB_ErrNum = viClose(VI)
'USB_ErrNum = viClose(VISA_DRM) ' USB_DRM
' Global VISA_DRM As Long    ' 1) Session to Default Resource Manager.
' Global VISA_VI_DAQ As Long ' 2) 34972A Session - USB
' Global VISA_VI_PS1 As Long ' 3) E3640A Session - GPIB Dev# 7

USB_ErrNum = viClose(VISA_VI_PS1)
USB_ErrNum = viClose(VISA_VI_DAQ)
USB_ErrNum = viClose(VISA_DRM)

End Sub

Outcomes