Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

ibwrt and ibrd is same with viVPrintf & viVScanf

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

0 Kudos
Message 1 of 6
(4,088 Views)

Solve what? You say you can do a read of the version.

 

0 Kudos
Message 2 of 6
(4,069 Views)

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??

0 Kudos
Message 3 of 6
(4,064 Views)

Is the OPN command actually supposed to return data? It's not SCPI compliant where every queury ends with a ?.

0 Kudos
Message 4 of 6
(4,062 Views)

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..

0 Kudos
Message 5 of 6
(4,057 Views)

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.

0 Kudos
Message 6 of 6
(4,049 Views)