LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

IviPwrMeter Bug [ERROR 0xBFFA1190]

I have run into a problem using the IviPwrMeter interface provided with Compliance Package version 3.2.  After re-initializing my instrument driver after a previous initialilze and close the driver returns error code 0xBFFA1190 when IviPwrMeter_LockSession is called.  I reduced my application code to the following four lines and used a newly generated specific driver simulated and referenced with my driver session name and still I receive this error.  The session handle is valid at all times and no other calls return an error.  I can't see that this is a result of anything I have done.  Is this a bug in IviPwrMeter?  I am unable to revert to an older version of ICC because of linkage to many other drivers and applications I would surely regret uninstalling ang reinstalling.  Thanks.
 
        error = IviPwrMeter_init (<driver session name>, VI_FALSE, VI_FALSE, &vi);
        error = IviPwrMeter_close (vi);
        error = IviPwrMeter_init (<driver session name>, VI_FALSE, VI_FALSE, &vi);
        error = IviPwrMeter_LockSession (vi, &callerHasLock));
0 Kudos
Message 1 of 5
(3,582 Views)
Hello jtporter,
      My first recommendation is to only initialize the driver session once at the beginning of the application and only close it at the very end of the application.  Are there any factors that prevent you from doing that?

Do any functions other that IviPwrMeter_LockSession return the invalid session handle error?

Does this issue occur in non-simulation mode?

Cheers,

NathanT
0 Kudos
Message 2 of 5
(3,556 Views)
Hello jtporter,

Please confirm where you are getting the error:

error = IviPwrMeter_init (<driver session name>, VI_FALSE, VI_FALSE, &vi);
error = IviPwrMeter_close (vi);
(ERROR HERE)
error = IviPwrMeter_init (<driver session name>, VI_FALSE, VI_FALSE, &vi);
error = IviPwrMeter_LockSession (vi, &callerHasLock));


or

error = IviPwrMeter_init (<driver session name>, VI_FALSE, VI_FALSE, &vi);
error = IviPwrMeter_close (vi);
error = IviPwrMeter_init (<driver session name>, VI_FALSE, VI_FALSE, &vi);
error = IviPwrMeter_LockSession (vi, &callerHasLock));
error = IviPwrMeter_close (vi);
(ERROR HERE)


If you are getting the error in the second case, it may be because the session is locked and cannot be accessed.  You may need to use Un
LockSession function before you are able to close the session.
O. Proulx
National Instruments
www.ni.com/support
0 Kudos
Message 3 of 5
(3,555 Views)
The functionality of my application is to emulate a power meter with a soft-front panel which includes "on/off" control.  This control maps directly to the Initialize and  Close functions of the driver.  It is not a requirement that this functionality be implemented in my application, but this is how I have implemented all other soft-front panel applications and I see no reason why this should not work and I wonder what other issues/bugs (if any) may be linked to this behavior.  I should have explicitly mentioned that this is my only workaround at present.

"The session handle is valid at all times and no other calls return an error."

This error occurs in non-simulation mode as well.
0 Kudos
Message 4 of 5
(3,551 Views)
NO BUG...

I have to aplologize... I found the reason for the problem.  I still had an explicit setting of vi = 1 left over from debugging that caused the error when the session was re-initialized.  I did not see this before, sorry for the trouble.  Consider this issue closed.
Message 5 of 5
(3,549 Views)