06-23-2016 05:27 AM
I would like to write a mocking FGV function for initialization and teardown of a device which remembers the refnun and
passes it back on demand. However i don't know how to provide sentinals for a valid refnum and an invalid one.
For example i simply could use a refnum constant from the reference submenu in the frontpanel elements palette.
As this constant is merely a NULL ptr with a type, this would function as the second sentinal.
The other sentinal i thought could be provided by f.e. casting of an integer with a value of 1 to the refnum type.
However this leads to a complete exceptional termination of the labview dev environment.
The fake refnums are used only in mock vis and there is no property/invoke node wired to them.
06-23-2016 05:52 AM
06-23-2016 06:26 AM
Yes, but the calling vi (also a mock vi) contains two parallel while loops where the second terminates on error.
An error is produced by the subvi when the reference is read but was set back to it's standard value, before.
To check, if an error should be returned the vi "not a number/path/refnum?" is used.
The crash happens, when this vi is called with the ref wire containing the casted "1".
Therefore i need two dintinguishable refnum values although they are not generated from a real init function but only mocked.