LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Petru_Tarabuta

The detailed help of each node and each native VI should list all error codes that can be produced by that node or VI

Problem: Currently it is impossible to know in advance what errors (what error codes) a node or native VI can produce. (Native VI = VI that ships with LabVIEW)

 

For example, I recently implemented a module that communicates with another endpoint using the LabVIEW TCP primitives we know and love: TCP Open Connection, TCP Read, TCP Write, TCP Close Connection. In order to create robust software I needed to understand what error codes each of these primitives can generate, and in what circumstances.

 

Through initial testing I discovered that TCP Open Connection can generate errors 56, 62, and 66. I then handled these errors locally in the code.

 

Around two weeks later, during further testing of what I thought was a fully complete and tested module, the module unexpectedly started experiencing error 60 many times per second. The module had never experienced error 60 before. The module was configured to broadcast an event each time an error was detected. This flooded the listener (the DQMH tester VI that was listening to all broadcast events) with thousands of error messages per second. The tester VI front panel buttons became unresponsive, because the tester was flooded with so many incoming broadcasts. The only way to break out of the cycle was to abort the tester, then close the project to shutdown the module.

 

This way I learned "the hard way" that that TCP Open Connection can generate error 60 in certain circumstances, in addition to the error codes I had handled already.

 

Solution: The detailed help of each node and each native VI should list all error codes that can be produced by that node or VI. For example, in the case of TCP Open Connection, the detailed help should contain a description similar to the below.

"

TCP Open Connection can generate the following errors:

  • Error 56
  • Error 60
  • Error 62
  • Error 66
  • and so on listing here any/all error codes that can be generated by the node.

"

 

This list would be extremely useful, as it would make us (professional LabVIEW programmers) aware of the various error codes a node or VI could occur generate. This would encourage the programmer to think of ways to handle all those possible errors, thus resulting in more robust code.

 

By reading the "Explain Error..." message of each error code the programmer could also understand the circumstances in which the node or VI generates each particular error.

 

Notes

  • In summary, this idea suggests an improvement to the detailed help documentation of each node and native VI.
  • It should be possible to automate the creation of the lists for each node and native VI.
    • For nodes whose source code is written in C++, a program could be created to scan the source code files and return the list of possible error codes generated by the function.
    • For native VIs, VI scripting could be used to achieve a similar purpose and output the list of errors that could be generated by that VI.
4 Comments
Petru_Tarabuta
Active Participant

The In practice, how do you handle errors? NI Community thread contains the following exchange:

Petru_Tarabuta_0-1725213043414.png

 

Notice that user ijustlovemath asks "Do you have any suggestions for looking up error codes for a given VI? Sometimes I just dive into the block diagram, but it's often the case that the low low level subVIs are locked.". It is clear that that user would have benefited from the error codes being written in the detailed help of the nodes or VIs he was working with.

crossrulz
Knight of NI

Duplicate: List every error code a function can give out! 


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Petru_Tarabuta
Active Participant

Totally a duplicate. Sorry. Have kudo'ed the original idea.

Christina_R
Active Participant
Status changed to: Duplicate

Duplicate of List every error code a function can give out! - NI Community


Christina Rogers
Principal Product Owner, LabVIEW R&D