LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

identical error codes for GPIB and General?

I'm working on adding some proper error handling to an instrument driver.   However, I don't understand all the error code numbers.   It seems that you can have the same numbers for different errors?
 
For example:  error code numbers 1-20 apparantly apply to error messages for both GPIB and General Labview. 
 
How does this work?  The error handler doesn't know what kind of vi caused the error code, does it?
0 Kudos
Message 1 of 4
(2,582 Views)
I believe this goes a long, long way back when those at at who defined the LabVIEW error codes happened to use the same error codes that already existed for the GPIB drivers. GPIB cards were the first products of NI. The error codes have been much improved since, but I suspect that they haven't changed the earliest ones so that when upgrading old applications, nothing will get broken. Instead of using the low level GPIB functions, you should use VISA, which does have unique error codes. Then, if you get an error in the 1-20 range, you'll know it's a LabVIEW error. If you want to submit your driver to NI for approval, you have to use VISA and VISA makes the driver much more portable.
Message 2 of 4
(2,567 Views)
Thanks!  I was afraid that I misunderstood something about the error codes when I saw these identical error codes for GPIB and General.  
 
The driver I'm modifying, I've actually downloaded from NI.  (for the SR5113 pre-amp).  It's error handling is really awfull.  Basicly, it doesn't give any instrument errors over the 'error out' line but does so via 4 booleans.   That's really ackward, so I was thinking about changing the driver a little to properly use the error line.  
 
I'll think about sending the modified one back to the company when I'm done, asking them if they agree to the improvements.... 
 
 
Thanks again.
0 Kudos
Message 3 of 4
(2,555 Views)

I can't find an SR5113 driver on NI's site but I there are an awful lot of very old drivers that don't come close the obeying the latest Instrument Drivr Guildlines. Any driver that someone cleans up and can meet these guidelines can and should be submitted here. Both NI and future users will appreciate it.

0 Kudos
Message 4 of 4
(2,537 Views)