LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Boolean array bit by bit inversion

Hi,

 

In the attached image, I am trying to take an 8 bit Boolean array and compare bit by bit using an equal function. I then invert the result. I am tryinb to build a new results output array.

 

I believe the replace subset array is not the answer to logic error.

 

 

Any suggestions?

 

4Boysdad 

0 Kudos
Message 1 of 6
(3,533 Views)

Um.... is this what you're trying to do?

 

 

 

 

As for the code:

  • Use auto-indexing on loops when you need to iterate through an array. This eliminates your Array Size and Index Array.
  • Comparing a Boolean to a True constant is redundant. Think about it.
  • You Replace Array Subset does not have the index wired. Hence, it will always default to the first element.
  • Why do you have a Stop on the for loop?
0 Kudos
Message 2 of 6
(3,529 Views)

Hi;

 

The actual code I am working with is attached as an image. In the lower left of the image, I am taking in a 1D 8bit boolean array. I am comparing this bit by bit to see if the value is still True. If the value is still true, it ha been True long enough and I need to turn the bit off. If the value is False, the bit has not been set long enough. The resulting array needs to be fed into the Write DAQmx function.

 

Does this help clarify what I am trying to do?

 

 

4BoysDad

0 Kudos
Message 3 of 6
(3,520 Views)

If the value is still true, it ha been True long enough and I need to turn the bit off. If the value is False, the bit has not been set long enough.

That sounds like an Invert operation to me. What does it sound like to you?

 

 

Of course, I have no idea what you mean by "long enough".

 

And you're still not autoindexing, and you're still comparing a Boolean to True.

0 Kudos
Message 4 of 6
(3,507 Views)

Hi;

 

I think I was able to resolve my issue.

 

Thank you for your help I did save your input for future reference.

 

4BoysDad

0 Kudos
Message 5 of 6
(3,491 Views)

Saverio just smacks his head and shakes his head, and returns to his work...

 

But just to make this time worthwhile, he submits this to the Rube Goldberg thread.

Message 6 of 6
(3,489 Views)