Error Handling | Arduino Compatible Compiler for LabVIEW Discussions | Forum

Avatar
Please consider registering
guest
sp_LogInOut Log In sp_Registration Register
Register | Lost password?
Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Feed Topic RSS sp_TopicIcon
Error Handling
March 17, 2015
8:43 pm
Avatar
Rohit
New Member
Members
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
Avatar
Steffan
Admin
Forum Posts: 408
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: 100
Currently Online:
3
Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
miche91: 33
scottj: 28
scadao: 23
Member Stats:
Guest Posters: 5
Members: 202
Moderators: 0
Admins: 3
Forum Stats:
Groups: 1
Forums: 2
Topics: 266
Posts: 1222
Newest Members:
pujacontrol
Administrators: geadmin: 22, filipealtoe: 96, Steffan: 356