Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Go to local

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                     

0 Kudos
Message 1 of 7
(8,503 Views)

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

Peter T
Applications Engineer
National Instruments
0 Kudos
Message 2 of 7
(8,496 Views)

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

 

0 Kudos
Message 3 of 7
(8,493 Views)

HI, Peter T

Do you have any other suggestions I can try? Anybody has good suggestion?

Thanks

Mindy_Gortling

0 Kudos
Message 4 of 7
(8,475 Views)

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?

Evan See
National Instruments
0 Kudos
Message 5 of 7
(8,469 Views)

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

0 Kudos
Message 6 of 7
(8,464 Views)

i likie this forum very much.......

 

http://forexpunch.com/

0 Kudos
Message 7 of 7
(8,011 Views)