08-23-2011 01:05 AM
The first bit of Minutiae illustrated some surprising results that can be obtained when comparing flattened objects:
Now, a new bit, also dealing with flattened values and the Equality ("Equals?") Operator :
In this snippet, a reference to "This VI" is compared against another reference, which also points to "This VI", but has a different Refnum (the hex value, when probing or flattening to string is different). The result of each Equality Comparison is not necessarily surprising, as long as you understand how the "Equal?" operator works in the context of comparing Refnums.
Instead of simply comparing the hex value of the Refnum, the comparison operator is overloaded to evaluate whether the objects to which the references point are indeed the same object. As shown below, two Refnums can have different Refnum values yet be "Equal" to each other. Simple!
One of the most important take-aways here: visually inspecting probes to determine equality is not necessarily sufficient! Although the refnums may be different, they could still be referring to the same object (see below):
08-23-2011 03:05 AM
@JackDunaway wrote:
Instead of simply comparing the hex value of the Refnum, the comparison operator is overloaded to evaluate whether the objects to which the references point are indeed the same object.
Which is better than the previous behavior. Before LV 8.0, the comparison was for the specific reference (at least I'm assuming that's how it was done), so comparing two references to the same thing from different sources could* output a false result.
* I say "could" because sometimes it would work (I'm guessing that in those cases the reference had the same value even though it was obtained from different sources) and other times it didn't.
08-24-2011 07:45 AM
First I want to thank Yair for pointing me at Stephen's blog found here where I quote;
A rumor has reached my ears. A false rumor about LabVIEW, inlining subVIs and buffer allocations. A rumor in need of quashing.
If you want to discuss this issue please started a new thread and link it back here. We don't want to foul this thread with what could be quite a "rat-hole".
Keeping you updated,
Ben
08-24-2011 07:49 AM
@Ben wrote:
First I want to thank Yair for pointing me at Stephen's blog found here where I quote;
LabVIEW Field Journal is worthy of a spot in your RSS reader.
The National Instruments Field Architects are a small, elite group of LabVIEW experts. We help your engineers become more proficient in LabVIEW. We guide software architectures, develop technical leaders, and teach and encourage good software engineering.
Each of the NI Field Architects has a minimum of twenty years of industry experience.
08-24-2011 03:14 PM
I knew this and STILL bit myself
Inrange and coerce is inclusive of the upper and lower limit regaurdless of configuration properties if the limits are integer data types DUH! <face-palm>
08-25-2011 08:15 AM
I don't recall this being added previously (please forgive if this is a repeat).
Removing events from a dynamic event registration node can scramble your events so add comments before changing the evnt registrations, see here.
Ben
09-21-2011 08:57 AM
Here is one with serial IO. I remembered it from years ago but it still appears to be biting people. The original discussion is here.
The gist of it is that you have to set a value in a property node as well as turning termination characters off in order to turn termination characters off.
So to turn off the termination character, set Term Char Enable to false AND set ASRL End In to 0.
Rob
09-21-2011 09:07 AM
10-04-2011 06:19 AM - edited 10-04-2011 06:21 AM
Scrutinize the VI tree for legacy vi.lib functions if you build executables. Look for filenames containing "compat" or LLBs named "oldvers"
I have a four year old stand-alone application that uses a plugin architecture. The plugins used are standalone VIs that store common test data into a specific repository. In one plugin, I needed to store data in a reloadable format in the event that the repository was off-line. I chose XML and TRIED to use the NI "Write to XML File" function.
The plugin reported a 1003 runtime error. Looking at the VI, I discovered it was a polymorphic VI, it and it's instances were in an LLB that calls an unsupported VI (as noted in VI description) in another LLB with a call to another VI in the same LLB just to pop a dialog! I tried to add the various VIs to the project for my executable to no avail. NI forum searches indicate that plugins that need to use subvis (including those in user,vi and instr.lib) should be packaged as a source distribution (inside an LLB!) I finally decided to modify the "Write to XML File" instance VIs to use a native Open/Create/Replace node. I added the XML VIs to the project as dynamic and my plugin worked.
Lesson: Just because a VI is in the NI palette or NI folders (which we tell people to never edit) doesn't mean that it will seamlessly compile into an EXE.
10-19-2011 05:26 AM
Talking to user32.dll can do cool things to integrate with Windows, like simulate keyboard and mouse commands. When you build an exe, it includes a local copy of user32.dll in the data support directory. The runtime engine checks this directory first, and so calls the wrong version of the dll causing all sorts of errors.
I include the errors I encountered for anyone trying to search for info:
Access violation 0xC0000005
Procedure entry point wcscat_s could not be located in the dynamic link library ntdll.dll
To fix, remove the dll from the support directory before running the application.
I may have missed an option to exclude items in a build, but I made a post-build action to remove the dll from the build directory.