02-26-2009 11:35 AM
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
02-27-2009 02:13 AM
02-27-2009 05:00 PM
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
02-28-2009 07:01 AM
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?
03-02-2009 06:47 AM
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
03-02-2009 10:50 AM
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
03-02-2009 10:57 AM
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.
03-02-2009 11:07 AM
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.