10-06-2008 07:28 AM
Hi,
The "FindRoute" function returns a "Path Capability" parameter, which expresses the capability of finding a valid route between Channel 1 and Channel 2.
This parameter is a code. All possible values of this parameter are defined as constants in the nise.h file.
The help for the parameter gives a description of each code.
Currently I have to redefine the messages in my own code and associate manually the descriptions to the codes.
If the niSE code changes, then I have to modify my code or the program could have an unexpected behaviour.
How to get the description automatically ? Is there a function to get the description ?
Thanks,
Bruno
10-06-2008 09:20 AM
What did you mean by "niSE code changing"? Those values for path capability are the part of niSE API, and as such are bound to the rules of backwards compatibility. You should not expect those values to change, let alone to start meaning something else.
We may possibly add a value (theoretically, not that we have plans for it), in which case you will have to modify your code to account for it. This is the worst scenario you may have with respect to the enumerated values returned from the API.
That said, there is no function to get a description (a string corresponding to the enum value, akin to those related to error codes and error strings). There might be someadvantage to you defining your own strings, i.e. you can tie the actual channel names to your message, have it apply to the particular situation you have, while if we were to define the strings, we would have to stay on a highly generic grounds.
best regards,
10-06-2008 10:20 AM
Thank you for your quick response.
You are right that the codes should never change (that's really the worst case).
But as you say some codes could be added. In that case I should modify my code and distribute a new revision.
I used to find a function that returns the description of the code in the other NI APIs.
I think I could not define a better description than NI did (Currently I copied the messages from the niSE help)... And in most cases I use the original messages.
I can just concatenate some additionnal informations to the message (like the channel names).
The messages adapted to a particular situation or the messages more comprehensible for the end user can still be defined in a top level module.
Never mind. I did that function in my code.
Best regards,
Bruno