FOUNDATION Fieldbus

cancel
Showing results for 
Search instead for 
Did you mean: 

curDevice.Open() is throwing exception with Error code E_OK

Hi,

 

I am developing an application where in i need to use the device.open() method. When i am trying to use this method, i am seeing an exception with error code E_OK. This is not consistent and i am seeing this once in a while. Is this expected and we need to handle this exception, please let me know.

 

Regards,

Sundar

0 Kudos
Message 1 of 10
(9,189 Views)

Hi, sundara,

 

Would you please specify the exception type? Please read  the exception's property Message to see more details.

This might be caused by inproper operation in the code. 

 

 

0 Kudos
Message 2 of 10
(9,179 Views)

Hi,

 

I am seeing the exception to be of the type "FBUnknown expecption" but the error code of the exception is E_OK.

 

Regards,

Sundar

0 Kudos
Message 3 of 10
(9,171 Views)

Hi,

 

FBUnknown works like the default of a case scenario.

In this case, would you please tell me how to reproduce this?

The more detailed, the better.

Also with version info please.

 

Thanks.

 

0 Kudos
Message 4 of 10
(9,165 Views)

Hi,

 

I am using NIFBus communications manager 4.1 .

In this i am justing using the API curDevice.Open() where curDevice is an object of the device class.

Using it a couple of times, i am seeing this behaviour.

Please check this and let me know for any other clarifications. Below is the log of the exception

 

NationalInstruments.FieldBus.ExceptionHandler.FBUnknownException: Unknown exception, check the code!

   at NationalInstruments.FieldBus.Device.Open()

 

Regards,

Sundar

0 Kudos
Message 5 of 10
(9,158 Views)

Hi,

 

I'm using the same version of CM as yours, but I can't reproduce the error.

The application I ran is in the directory <National Instruments>\NI-FBUS\MS .NET\examples\CsharpExample , which comes along with the installation of NI-FBUS software.

If you have not tried this, would you please see if the same problem happens here? Also you can check if there's any inproper implementaion in you code.

Or, if possible, send us your reproducible example, and we can start from there.

Thanks a lot.

 

Regards

 

0 Kudos
Message 6 of 10
(9,149 Views)

Hi,

 

Can you share me an email id so that i can sent the code. I can share the code in Forums.

 

Regards,

Sundar

0 Kudos
Message 7 of 10
(9,124 Views)

hi,

 

You can send it here: yishi.liu@ni.com

Thanks

0 Kudos
Message 8 of 10
(9,122 Views)

I am having similar issues with receiving ErrorCode 0, E_OK when other ErrorCode is expected.

 

An easy example is when the API is used to perform a write to a Read-Only parameter. 

 

E.g..

        Write 1 to ResourceBlock.ST_REV

        Expected Result:  Write Fails with ErrorCode= E_DATA_NEVER_WRITABLE
        Obtained result: Write Fails with ErrorCode=E_OK

However when using NI-Dialog, ErrorCode I receive is E_OTHER (-46)

0 Kudos
Message 9 of 10
(8,804 Views)

Hi Issac.

 

The error returned from a Rosemount device here for test (Type 3051 Dev_Rev03 DD_Rev01) is also -46 (E_OTHER) (NIFBUS version 4.1.1), because from the frimware of the DUT this value is returned.

It's most likely that the firmware of this( or certain) Rosemount device doesn't conform to the standard in this respect.

 

A test on another FF device (Honeywell's) writing the same parameter returned the appropricate value -41(Error: This data is never writable.)

 

FYI, In order to returned the correct value, these conditions have to be met:

silRtn == SIL_NEGATIVE_CONFIRM

(errorInfo->errorClass == ECL_OTHER) &&(errorInfo->errorCode == ECO_OTHER)

errorInfo->additionalCode == (-E_DATA_NOT_WRITABLE)

0 Kudos
Message 10 of 10
(8,790 Views)