Error Handling | Arduino Compatible Compiler for LabVIEW Discussions | Forum


Please consider registering

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 4 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Error Handling
March 17, 2015
8:43 pm
New Member
Forum Posts: 1
Member Since:
March 17, 2015
sp_UserOfflineSmall Offline

I’d like do error handling by outputting specific text to an LCD based on the type of error my VI generates. I understand the compiler supports the LabVIEW error cluster, but once I try to unbundle the error code and error source, I get a compilation error “'NamedUnbundler' was not declared in this scope” which seems to be related to the unbundle action. Why?

March 17, 2015
9:39 pm
Forum Posts: 304
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Hi Rohit,

Even though the compiler won’t generate a compilation error if your target VI uses the LabVIEW error cluster, the error cluster is only used for data flow control. Its contents are meaningless within the scope of the compiler. Also, the compiler doesn’t support bundle/unbudle, as it doesn’t support clusters in general.
If you want to do error handling, you will need to use your own error handling mechanisms. I recommend using an error code only, simply stored in a numeric datatype. Pass that along your VI and use non-zero codes for any errors. If you require String errors, create a lookup table stored in a subVI to pull an error description based on the error code input. So when you must display the error code, check your error int, and if the value is non-zero, then call your lookup table to get the error string, and display that on your LCD. Will that work for you?

Please note that storing a bunch of string errors in a VI is very costly in terms of memory usage. What target are you on? If its something like the Uno with 2k of RAM, just be cautious of using a lot of string constants. Those will take up RAM. It would be much better to use an int only for error handling.

Forum Timezone: UTC 0

Most Users Ever Online: 33

Currently Online:
5 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

John: 18


Dan6077: 11

Member Stats:

Guest Posters: 0

Members: 80

Moderators: 0

Admins: 3

Forum Stats:

Groups: 1

Forums: 2

Topics: 58

Posts: 289

Newest Members: Geraldkix, ThomasSoogs, Angelvor, AngelaMuh, Nsneilohone

Administrators: geadmin: 5, filipealtoe: 35, Steffan: 89