Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a VISA function to convert a ViStatus code to the English description

I've searched high and low, but I can't find it.

It seems so obvious that I'm sure it must exist.

Does anyone know if there is a VISA function (or otherwise) that will take a ViStatus code and return the text description?

 

So if the system returned: BFFF000F I could call the decode function with this code and it would return:

"Specified type of lock cannot be obtained or specified operation cannot be performed, because the resource is locked"

 

Thanks,

 

Ronnie

TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Message 1 of 8
(4,767 Views)
I support this question, Can these status/error descriptions be added by NI or myself to the error list vi, or is there an example where to find these?
greetings from the Netherlands
0 Kudos
Message 2 of 8
(4,756 Views)

Ronnie,

 

I could be wrong, but I am not familiar with a pre-written function that will accomplish this and don't believe there is one.  The best place I look for these cods is the NI-VISA help file.

 

Eric K

Applications Engineer

National Instruments

0 Kudos
Message 3 of 8
(4,744 Views)

These error codes must be available in some VI reachable form. The help file could be a place where these also are described but in ffact this is an extension of the errorcodes and as such should be available somewhere in LabVIEW, to easily be added to the error reporting vi.

So can somebody point us to such a vi or constant or can somebody add it to the new release?

greetings from the Netherlands
0 Kudos
Message 4 of 8
(4,736 Views)

Hi,

 

 

IVI drivers have a function that will return a text description of the error code usually call <instr driver name>__error_message(). I believe this same function will handle both VISA and IVI errors.

 

But  also some non -ivi drivers have an equivalent error message functions. This tend to be an hardcode array of known errors for that instrument.

 

But isn't there a User defined table where you can define your own errors and descriptions that the Error Handler VI will pick up.

 

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 5 of 8
(4,722 Views)
Yes - what you say is true Ray, but it is part of the IVI-C code base and is not really designed around VISA errors - although it does handle some. For example it doesn't handle:

VI_ERROR_INV_ACC_MODE

BFFF0013h

Invalid access mode.

 

I shouldn't really complain, after-all it took me about 15 minutes to develop a routine in CPP to handle all the VISA errors and return the actual string. It just seems that the VISA library should have this already. Here's my code, which takes the error code and returns the decoded string, in case anyone can make use of it - sorry about the formatting, the web site messes it up. [The post was too long with the code, so I'll post it immediately after this post]

 

Ronnie

TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Message 6 of 8
(4,712 Views)

Sorry - still couldn't submit the code even though the character count was less than 10,000 charcaters - must be the overall length of the entire message topic is limited to 10,000 and not just each new post.

TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Message 7 of 8
(4,708 Views)

For Info, and IIRC....

 

10000 limit is for characters AFTER HTML tags are added (automatically) as required.  The HTML tags increase the overall length of your otherwise OK post.

 

Shane.

0 Kudos
Message 8 of 8
(4,702 Views)