LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to split an array into chars for comparison

Hi Guys,

 

I'm new to LabVIEW but I'm trying to convert a 64 bit binary string of numbers to single char values. The reason for this is to compare the individual bits with another string of 64 bit values. I'm not sure if I'm going about this a very awkward way but any help would be appreciated.

 

 

 

0 Kudos
Message 1 of 7
(2,317 Views)

I see you are already doing the direct comparison (Not Equal To).  So what exactly are you trying to accomplish once you prove that they are different?

 

As far as formatting your strings, use %064b as your format if you want to see all of the bits.  That will eliminate a bunch of your logic.  But I feel like this is a side issue since I think you are looking to do something else in the end.


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
0 Kudos
Message 2 of 7
(2,298 Views)

if you want only compare strings, use byte array (top of example)

If you need string array, you can convert like here

 

compare.png

0 Kudos
Message 3 of 7
(2,289 Views)

@Anto_1904 wrote:

 

I'm trying to convert a 64 bit binary string of numbers to single char values ... to compare the individual bits with another string of 64 bit values.

 


You start by doing an "Is Equal?" comparison of the two U64 integers.  If they differ, then you know some bits are different.  What is the next question -- do you want to know which bits are different, which bytes are different, or what?  I'm assuming that the U64 isn't a concatenation of 8 8-bit Ascii (or 4 16-bit Unicode) values, but if it were, then you might want to know if the characters are different.

 

Let's assume your question is about "bits", and you want to know which bit positions differ.  Can you think of a Boolean operation that returns True (or False) according to whether or not two bits are the same (or different)?  [If the answer is "No", learn about the elementary Boolean Operators shown on the top row of the Boolean Palette].  Finally, assuming that a Boolean Operation on two U64s yields another U64, can you find a function (probably on the Boolean Palette) that might turn a number into its corresponding bits?  [Hint -- "bit" is an acronym -- look up its meaning].

 

Bob Schor

 

0 Kudos
Message 4 of 7
(2,287 Views)

as crossrulz said, it is unclear what you want to accomplish.

 

i guess you want to know where the two numbers (no string inputs to be found in your VI) differ:

a2.png


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 5 of 7
(2,283 Views)

Why don't you convert it like this?
Number to boolean string array.png

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 7
(2,269 Views)

that little bugger "?1:0" i always forget it exists


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
Message 7 of 7
(2,261 Views)