12-12-2013 07:50 PM
I am using VBA excel with GPIB command.
Two instruments A and B talk to each other through buses controlled by firmware in A and B seperately. After talk, results displayed on screen of instrument A.
I can read result through GPIB connected with A correctly:
I used VBA:
call GPIBinit
call ibwrt (xxx,xx)
call ibrd(xxx,xx)
But I noticed part of the screen on A is blank now.
I understand I have to release control, so A and B will talk to each other correctly. I used:
call ibwrt(xxx, "*CLS")
call ibwrt(xxx, "*RST")
call ibwri(xxx, "GTL")
close visual basic code window
None of them working, I have to close excel sheet.
Can any one tell me which command to used at the end of sub to release the control? I don't want to close excel each time.
Thank
Mindy
12-13-2013 10:39 AM
Hi Mindy_Gortling,
The command for Request/release system control is ibrsc. Here is a pdf with all the commands for VB:
http://www.ni.com/pdf/manuals/320418.pdf
Let me know if that answers your question!!
12-13-2013 02:14 PM
HI, Peter T
Your suggestion is not working.
Here is my code:
Private Sub Test()
Dim Id As String
Dim T As Integer
Call GPIBinit ' instrument A result still on screen, means A and B still talk
Id = Space$(100) ' instrument A result still on screen
Call ibwrt(10, "*IDN") ' part of screen on A is blank, means my code take control
Call ibrd(10, Id)
.
.
. 'my code successfully obtain the results from A
Call ibrsc(10, T) ' your suggestion not working, part of screen still blank. I have to close excel, screen will be back to normal
End Sub
Do you have more command I can try to release the control? Call ibwrt(10, "GTL") not working also.
Mindy_Gortling
12-16-2013 02:35 PM
HI, Peter T
Do you have any other suggestions I can try? Anybody has good suggestion?
Thanks
Mindy_Gortling
12-16-2013 05:39 PM
Hi Mindy_Gortling,
I have a few questions which might help get to an answer. What devices are you using/communicating between? Where is the screen that is half blank located/connected?
12-16-2013 07:10 PM
Hi, Evan
The device A and B I am using to communicate is our own product. When hooked up using a cable, some select will on A. After I choose the selection, auto testing will start and result will be on left screen of A. More selection on the right screen of A will let me choose how to continue.
I used GPIB connected with A to get the result successfully, but the continue selection on the right screen disappear.
Good thing is I used "call ibloc (xx) " and the problem solved.
Thanks.
Mindy_Gortling
02-22-2014 09:51 AM