Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted

06-05-2018 07:21 AM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Labels:

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.

06-05-2018 07:59 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions

Unofficial Forum Rules and Guidelines

06-05-2018 08:06 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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

If you need string array, you can convert like here

06-05-2018 08:07 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

@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

06-05-2018 08:11 AM - edited 06-05-2018 08:12 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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:

If Tetris has taught me anything, it's errors pile up and accomplishments disappear.

06-05-2018 08:51 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

06-05-2018 08:55 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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

If Tetris has taught me anything, it's errors pile up and accomplishments disappear.