Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

What does RegisterGpibGlobalsForThread() mean?

A Visual Basic example program calls function RegisterGpibGlobalsForThread() which is exported from Gpib-32.dll. But this function is not documented in NI-488.2 Function Reference Manual for Windows (321038g). Chapter 3 of that manual describes four important functions but does not mention this one and the related Unregister function. What does this kind of registration mean? (I might code in either VC++6 or VB6.)
0 Kudos
Message 1 of 7
(6,768 Views)
RegisterGpibGlobalsForThread() is a function used exclusively for the VB language interface. This function allows somebody programming in VB to access the NI-488.2 global variables: ibsta, iberr, ibcnt. This function was added as a workaround to allow VB users to access these variables, much as they would access them if using C or C++. You shouldn't need to worry about it, as this functionality is encapsulated in the vbib-32.bas.
Message 2 of 7
(6,768 Views)
Thank you very much. If your answer were included in the manual then I wouldn't have had to ask 🙂

There is a related question which I would like to ask for clarification on though. If I end up doing multithreading programming in VB, then the four functions which are documented in the manual for thread data can be called directly from a VB program? Even in VB, I will not have to call RegisterGpibGlobalsForThread() in that case?
0 Kudos
Message 3 of 7
(6,768 Views)
Does this mean that when  you are developing applications using C# , there is no need to use this call?

Thanks
Human knowledge belongs to the world
0 Kudos
Message 4 of 7
(6,271 Views)
Hi trashvin,

Yes that is right, you will not need to use this call if you are developing applications using C#. The NI-488.2 drivers do ship with example code that you may refer to as a starting point when developing your code. These can be found in this location on your hard drive:
C:\Documents and Settings\All Users\Documents\National Instruments\NI-488.2\Languages\DotNET2.0

Good luck!
Rasheel
0 Kudos
Message 5 of 7
(6,237 Views)

I'm using the C to communicate with a GPIB device and using the GPIB 488.2 Library. but I don't see

the RegisterGpibGlobalsForThread() function. any tips? I'm converting a code from VB to CVI and I came accross this line while Initializing the device.

Do I need to register the globals?

Thank you

0 Kudos
Message 6 of 7
(6,152 Views)

Hi Tiger81,

No, the RegisterGpibGlobalsForThread( ) function was strictly used as a workaround for Visual Basic. It is NOT needed for any other programming language such as C.

Hope this information helps.

gpibtester

0 Kudos
Message 7 of 7
(6,109 Views)