08-09-2007 03:37 AM
08-10-2007 04:55 PM
Hello Zaboulou,
The reason you are getting an error is because you are trying to change a device level property on a board. Since you are using ibfind, you are opening a board level descriptor. In the documentation for ibconfig (NI-488.2 Help file), you will see that IbcUnAddr is a device level property. You can use ibdev instead of ibfind to open a device level descriptor.
Instead of using the same ibnotify mask, you should disable waiting for LACS when calling ibnotify after reading (only listen for other events).
I hope this helps.
Steven T.
08-13-2007 10:26 AM
Hi Steven,
Thanks for your answer.
There is no more error if I use ibdev (instead of ibfind) and then ibconfig with IbcUnAdrr parameter. If I follow your advice, I should have an error if I try to set IbcPad after ibfind calling. But no error appears ... Do you have any idea ?
Anyway, when I configure my controller device to UNL/UNT mode, it seems that LACS is still set to 1 because after executing my callback, the program re-excutes my callback. I don't want to re-enter in my calback. All of my events are reading. That s why I set enable LACS return in my callback.
In the attached file, my callback is GPIB_Callback and ibnotify function is in Init_GPIB function, which I call at the beginning of my program.
Thanks for your help.
Zaboulou
08-14-2007 07:58 AM
Zaboulou,
From your description, your callback will return under a variety of conditions. The first thing to do in this callback should be to see if you are addressed as talker, listener, or any other event you care about. Inside the if statement for each event, you need to disable listening for that event again. So if you get a talker addressed event, enable your events except for talker. This way you will not go into your callback function twice for the same event. Here is some code that uses a similar strategy. It uses polling instead of callbacks, but you can get the general idea.
I hope this helps.
Steven T.
08-16-2007 10:07 AM
Hi Steven,
Thx for your answer. It works now. I have to use multithreading application but it ll be alright.
Zaboulou.