LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
eximo

String to byte/word Array improvement

Status: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined. 

The String to byte array instrument is locked into 8 bits only, which makes sense since it is taking a string and turning it into individual bytes.

 

An improvement would to have a right click feature on the instrument to change the size to bytes/words/dwords/qwords.

-Regards

eximo
_______________________________________________
UofL Bioengineering M.S.
Neuronetrix

"I had rather be right than be president" -Henry Clay
4 Comments
crossrulz
Knight of NI

But then you have to start worrying about endienness.  The Unflatten From String would be the better way to go since you can control this.  I have also used the Type Cast to do this just as easily.


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
eximo
Active Participant
Just add the endiness to the same right click menu and gray it out when single byte is selected
-Regards

eximo
_______________________________________________
UofL Bioengineering M.S.
Neuronetrix

"I had rather be right than be president" -Henry Clay
AristosQueue (NI)
NI Employee (retired)

String to Byte Array is a no-op primitive. There's no performance hit. If you want to go to another size, then wire the output of that node into a "To I16" primitive, or whatever other type you want. Or, if you're trying to put two characters in side-by-side, use the Type Cast node. It does what you're asking for (note that it does truncate rather than pad with zeroes).

Darren
Proven Zealot
Status changed to: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined.