Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

can I create custom error message

I need to tell the user "NO listeners on GPIB::0:11 address, make sure instrument is connected". How do I use the Simple Error Handler to tell the user this. The error handler spits out error code 1073807265 when this does occur.
0 Kudos
Message 1 of 8
(4,233 Views)
Should I use the unbundle by name on the error cluster to trigger a "Display Message to User" express VI?

Is there a better way to do this?
0 Kudos
Message 2 of 8
(4,226 Views)
If you have LabVIEW 7.1, you can easily add your own error codes and messages. From Tools>Advanced>Edit Error Codes create a new error code file. Click the Add button and for the new code, enter the code you get and enter your description. Save the error code file and restart LabVIEW. When the error code is detected again, you will get the old description plus your new one. I don't know of a way to remove the NI provided description short of deleting it from NI's error code file and that's something I would recomend.
0 Kudos
Message 3 of 8
(4,222 Views)
Hello,

I believe Dennis' last note probably meant that he would not recommend editing the -errors.txt file to remove the code. In your case, I think the best solution is to, as you suggest, unbundle the error cluster and programmatically deal with it by launching a dialog box with your comment. You can do this using the One Button Dialog function found in the Time & Dialog pallete.

Repost if you continue to have trouble!

Best Regards,

JLS
Best,
JLS
Sixclear
0 Kudos
Message 4 of 8
(4,213 Views)
You're right JLS. I meant to say not recomend. Forget spell and grammar checkers. I want a stupid sentence checker.;)
0 Kudos
Message 5 of 8
(4,208 Views)
Lol... that would be a great feature of any text editor... everyone could use it at times 🙂

- JLS
Best,
JLS
Sixclear
0 Kudos
Message 6 of 8
(4,188 Views)
OK, I solved this issue using the error cluster and the express VI.

But, thinking about custom error codes numbered 5000 - 9999 allowed ranges, how does the app recognize a custom error code occurred? How do you design this so the app knows when the custom error code occurred?

I toyed around with the "Error Code File Editor" and no bells went off in my head about how this is done.

LV error codes I run into are usually look like this "1073807298" with a general explanation.
0 Kudos
Message 7 of 8
(4,179 Views)
Hello,

To use the custom error codes in your application (after you have used the editor to add them to a -errors.txt file) you simply use the General Error Handler from the Time & Dialog palette to generate your error when you detect the condition you'd like the error to occur on.

Thank you, and repost if you have any more problems!

JLS
Best,
JLS
Sixclear
0 Kudos
Message 8 of 8
(4,168 Views)