LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove the HTML formatting from error sources

Does anybody have a good way to strip the HTML mark-up that often shows up in the source field of an error cluster.  I would like to log the error source to a text file, and display the error source in a text control, without the HTML mark-up.
 
I'm using LabView 8.5, but I'm sure a solution for an older version of LabVIEW can be easily adapted to the latest version.
 
Thanks,
 
Mark Moss
0 Kudos
Message 1 of 11
(5,638 Views)
I don't think I've ever seen HTML markup in the error cluster's source string. That could be from a specific third-party VI or perhaps toolkit.

As for a way, you can use the Search and Replace String in regex mode, as shown in the attached. You'll need to try it to see how well it works (or not) in your case.

EDIT: Uploaded version with front panel elements set to default values.


Message Edited by smercurio_fc on 03-05-2008 05:39 PM
0 Kudos
Message 2 of 11
(5,630 Views)

Thanks,  looks easy enough.

Some of NI's toolkits return HTML in the error cluster's source string.  For example, DAQmx Create Channel.vi returns an error cluster like the following if you pass in a bogus physical channel:

DAQmx Create Channel (AI-Voltage-Basic).vi:4<append>
<B>Device: </B>1399D0Mod2
<B>Physical Channel Name: </B>ai19

<B>Task Name: </B>_unnamedTask<3>

0 Kudos
Message 3 of 11
(5,597 Views)
Interesting. Not sure how useful it is to have HTML markup inside the source string, as you would need to use something to render the HTML, and the error handler functions in LabVIEW don't do that. Whatever. Hope the code works for you.
0 Kudos
Message 4 of 11
(5,592 Views)

smercurio_fc

you are not up todate. The error handler functions can do that. Just make a small test. Make an error cluster, change the status to error and copy the text with the HTML into the source field. Then call "Simple error handler". You will get a dialog and the text is rendered correctly, e. g. Device: is bold.

Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 5 of 11
(5,580 Views)
Actually, I did try it before I posted my message to make sure I wasn't saying something stupid. Smiley Wink I did exactly what you said, and the dialog showed no special formatting.


Message Edited by smercurio_fc on 03-07-2008 09:18 AM
0 Kudos
Message 6 of 11
(5,567 Views)
Waldemar, please note: Do not misconstrue my statement as saying that I thought you were saying something stupid. I was referring to my comment being potentially wrong because I might have said something that wasn't true.
0 Kudos
Message 7 of 11
(5,562 Views)

smercurio_fc,

that is what I get on my system (Win XP Pro SP2, LV 8.0.1 and newer). If you see it different there must be something different between my and your system.



Message Edited by waldemar.hersacher on 03-10-2008 12:45 PM
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 8 of 11
(5,537 Views)
Hi Waldemar & smercurio,

in the "General error handler CORE.vi" you will find a "Format Message string.vi" which is searching for <b>/</b> tags to perform a string formatting...
So with LV8+ you can have HTML-style formatting in the error message, but it's limited to the bold-tag (until now ?).
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 11
(5,531 Views)
Hi Mark,

look at the vi mentioned in previous post, it will show you how to filter those tags!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 11
(5,524 Views)