취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

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 포인트
1/6 메시지
4,309 조회수

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 포인트
2/6 메시지
4,305 조회수

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 포인트
3/6 메시지
4,296 조회수

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 포인트
4/6 메시지
4,283 조회수

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 포인트
5/6 메시지
4,267 조회수

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.

6/6 메시지
4,265 조회수