Two Methods of Programming VISA GPIB in VB6
Two Methods of Programming VISA GPIB in VB6
1 of 2
I:\VISUAL_BASIC_PROGRAMMING\Two_methods_of_Programming_VISA_GPIB_in_VB6
VisaAddress = Trim(Text_input.Text)
' trim the result from the text box to remove spaces
Label_output.Caption = "Talking to address :: " + VisaAddress + vbLf
Set rm = CreateObject("VISA.GlobalRM")' Set visagpib connection
Set msg = rm.Open(VisaAdress, NO_LOCK, 2000, "") ' Timeout=2000mS max 3000mS
msg.Clear
msg.WriteString "*IDN?" & vbLf ' write SCPI command to VISAGPIB Device
Label_output.Caption = Label_output.Caption + "Sending IEC bus command *IDN? "
+ vbLf
Result = msg.ReadString(256) ' READ SCPI command to VISAGPIB Device
Label_output.Caption = Label_output.Caption + "Information return by
instrument " + vbLf
Label_output.Caption = Label_output.Caption + Result + vbLf
End Sub
2 of 2