Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Is the 0.8.5 gpib linux driver multithread safe?

I want to use the 0.8.5 gpib linux driver in a multithread environment.
I answer me if it's possible and which is the best way to do : polling or signal IT?
Thanks
0 Kudos
Message 1 of 15
(3,868 Views)
Julien,

Please download our latest GPIB Beta offering at www.ni.com/beta. See the shipping documentation regarding multithreaded support; this is supported on this release just as it is on Windows.

Scott B.
GPIB Software
National Instruments
0 Kudos
Message 2 of 15
(3,853 Views)
Can U tell me if the ibrd function is a non blocking function, ie if the CPU is tied up or not while waiting to read
the right EOS character?
0 Kudos
Message 3 of 15
(3,846 Views)
The ibrd function is a blocking call, meaning that it will not return until the EOS conditions have been met or a timeout has occurred. This does not necessarily mean that it is using much CPU time while it is waiting, because I believe that it is interrupt-based. The only real downside to ibrd is that it will tie up a thread while it is completing. You can also use ibrda for an asynchronous (non-blocking) call that does the same thing. See the documentation.

Scott B.
GPIB Software
National Instruments
0 Kudos
Message 4 of 15
(3,838 Views)
Are U sure that ibrd is interrupt wait?
In fact ibrd is not sleeping until an EOS or a timeout arrive.
ibrda is implemented in linux driver 2.2 for GPIB/ENET card, not in PCI/GPIB card like mine!!!
0 Kudos
Message 5 of 15
(3,836 Views)
Julien,

The 0.8.6 driver is not multithread safe. If you need this functionality you can download the 2.3 beta driver from www.ni.com/beta

Shawn B.
National Instruments
Use NI products on Linux? Come join the NI Linux Users Community
0 Kudos
Message 6 of 15
(3,820 Views)
Thank you Shawn.
Will a thread safe gpib linux driver be available soon?
See ya
0 Kudos
Message 7 of 15
(3,812 Views)
I have downloaded it on ni.com for my read hat 8.0

I have created a POSIX thread (pthread_create API) which ibwrt and then ibrd on my device.
The ibwrt is OK but the ibrd returns a blank buffer.
I have configured the ibrd to returns when EOS=0x0A is found, but it does not work!
What does beta mean in the 2.3.1 GPIB linux driver: what the limitations?


Can U help me ?
0 Kudos
Message 8 of 15
(3,754 Views)
There are no limitations to the beta driver, but it has not fully been tested such that we can "release it" and we are still making modifications and bugfixes to it. Your multithreaded operation should work. Are you sure that you aren't getting an error on the IBRD? What is the return value of the IBRD call?

Scott B.
GPIB Software
National Instruments
0 Kudos
Message 9 of 15
(3,748 Views)
ibrd returns with no error because ThreadIbsta() returns OK.

In fact, I have configured a EOS read with line feed character (0x0A) because my device returns linefeed.
But I can just read the first 16 characters and I never returns my ibrd function by a EOS !

Why the first 16 characters ?

If a choose a size of 128 in my ibrd, ibrd reads a blank buffer !
0 Kudos
Message 10 of 15
(3,744 Views)