LabVIEW Idea Exchange

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

Allow Unflatten from String to also accept an Unsigned Byte Array as input

Status: New

Traditionally LabVIEW has treated Strings and Unsigned Byte Arrays as being the same. This is nowadays a little unfortunate as all UI systems use some kind of encoding so Strings are not generally interchangeable with Byte Arrays anymore.

In trying to stay for binary data as much as possible with Byte Arrays instead of Strings, since that would be the sensible thing to do, the Unflatten from String (which should rather be called Unflatten from Stream) puts a totally unnecessary wrench into this.

I always had hoped that LabVIEW would change the default binary data stream format to a Byte Array at some point but this while it would be possible, is a fairly pervasive change that would require many backwards compatibility decisions that I unfortunately don't see NI going to spend time on anymore. This change however would be a very small change that has zero backwards compatibility concerns and almost no work to add to the existing LabVIEW software.

This same change has been for instance made to the TCP Write node some versions back already and could be also applied to the VISA Write! Smiley LOL

Rolf Kalbermatter
My Blog
5 Comments
TomOrr0W
Member

Note that LabVIEW NXG appears to use byte arrays as the default binary format.  This idea would help people get used to that before transitioning to NXG (and potentially make converting code between the LabVIEW types easier).

http://www.ni.com/documentation/en/labview/latest/node-ref/flatten-to-byte-array/

AristosQueue (NI)
NI Employee (retired)

rolfk: The changes you are requesting are fully implemented in LabVIEW NXG. We have no plans to make any variations in behavior for LabVIEW 20xx. Although I freely acknowledge that this would be a straightforward change to make with few downsides (and has the advantages noted by TomOrr0W), I do not expect us to expend any of the remaining development effort of LabVIEW 20xx on string-byte array handling issues.

 

Having said that, I will leave the idea open for kudos and see how it develops.

Manzolli
Active Participant

A VIM named "Unflatten From Stream" would do it? NI could add it to the next LV, no bi issues I guess.

André Manzolli

Mechanical Engineer
Certified LabVIEW Developer - CLD
LabVIEW Champion
Curitiba - PR - Brazil
rolfk
Knight of NI

With LabVIEW NXG being delegated to the "legacy" ranks, I do hope this suggestion is seriously reconsidered! It's basically nothing more than adding the according typedef string to the possible datatypes for this parameter. Code wise there is no real change required. And if at it, do the same for VISA Write and potentially other nodes I can't think of right now.

Rolf Kalbermatter
My Blog
crossrulz
Knight of NI

Just look in the Data Communication->Protocols palette for a more complete list of items this could apply to.


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