Why Does LabVIEW 2024Q1 Override C# Optional Constructor Parameters?

Updated Sep 26, 2024

Reported In

Software

  • LabVIEW

Programming Language

  • C# .NET

Issue Details

I recently discovered an issue with the .NET constructor node in LabVIEW. It appears that the node is inadvertently overriding the default values for optional constructor parameters that were previously set in the C# code.
111.png

In instances where an optional constructor parameter is not wired in LabVIEW but has been set to a default value of 6000 in the C# code, LabVIEW seems to enforce a default value of 0. This occurs even when the input remains unwired, leading to unexpected behavior.

Solution

LabVIEW doesn't recognize the .NET DefaultParameterValue attribute, which is used in C# to store predefined values. Therefore, users need to manually input these values in LabVIEW.

This can be confusing because leaving an optional parameter unwired in LabVIEW doesn't work the same way as not specifying it in C#.