09-17-2012 04:12 AM - edited 09-17-2012 04:17 AM
Hi, i want to ask ibwrt and ibrd is same with viVPrintf & viVScanf ?? because i use source code below can't control the algar AT8000 power supply..below is VB6. although my GPIB address is correct only can read the version for power supply only. Can you give me same example how to solve it thanks.
Public Strin As String
Public strRes As String * 200 'Fixed length string to hold results
Sub Main()
Dim defrm As Long 'Session to Default Resource Manager
Dim vi As Long 'Session to instrument
Call viOpenDefaultRM(defrm)
Call viOpen(defrm, "GPIB0::22::INSTR", 0, 0, vi)
Call viVPrintf(vi, "*RST" + Chr$(10), 0)
Call viVPrintf(vi, "*CLS" + Chr$(10), 0)
Call viVPrintf(vi, "VER" + Chr$(10), 0)
Call viVScanf(vi, "%t", strRes)
Call viClose(vi)
Call viClose(defrm)
End Sub
09-17-2012 09:18 AM
Solve what? You say you can do a read of the version.
09-17-2012 09:35 AM - edited 09-17-2012 09:41 AM
i mean is when i use other command for the AT8000 can't function except the "VER" command ...example:
Public Strin As String
Public strRes As String * 200 'Fixed length string to hold results
Sub Main()
Dim defrm As Long 'Session to Default Resource Manager
Dim vi As Long 'Session to instrument
Call viOpenDefaultRM(defrm)
Call viOpen(defrm, "GPIB0::22::INSTR", 0, 0, vi)
Call viVPrintf(vi, "*RST" + Chr$(10), 0)
Call viVPrintf(vi, "*CLS" + Chr$(10), 0)
Call viVPrintf(vi, "CH1 OPN" + Chr$(10), 0) -----> open channel one relay, but when run it cant get any result/ no function...
Call viVPrintf(vi, "CH1 CLS" + Chr$(10), 0) ------> i try to chg this command , to close the channel one relay, but also cant function.
Call viVScanf(vi, "%t", strRes)
Call viClose(vi)
Call viClose(defrm)
End Sub
So what should i do?? thank you.. Can you let me know what is different for ibwrt and ibrd is it same with viVPrintf & viVScanf??
09-17-2012 09:39 AM
Is the OPN command actually supposed to return data? It's not SCPI compliant where every queury ends with a ?.
09-17-2012 09:45 AM - edited 09-17-2012 09:45 AM
can you help me to modify wht is my error?? and give me the example, thank you.. because im beginer for GPIB sorry for that..
09-17-2012 10:11 AM
You would need to read the instrument manual. There is no example for understanding the basic instrument communication. Read what commands return data. If a command does not, don't do a read after doing a write. It's as simple as that.