From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1d array of boolean connect to boolean

Hi everyone, I am trying to simulate a high volatge square wave generator, which is controlled by a low square wave. 

In fact, it is just using a dymaic square wave (the rising edge) to control a relay turn on, and the droping edge to turn it off.

But I meet a problem that cannot link the boolean array (converted from the dynamic wave) to the case strcture.

Could anyone advice me how to modify it, please?

Switch.png

0 Kudos
Message 1 of 17
(19,864 Views)

There are functions that will help you.

 

Look in the Boolean palette and you will find "AND Array Elements" and "OR Array Elements.

 

If you use AND Array elements, all elements must be true to get a TRUE.

If you use OR Array Elements, a single true will get a TRUE.

 

Otherwise, it will get FALSE.

Message 2 of 17
(19,856 Views)

Well, if you have a square wave that you turn into an array of Booleans then you're going to have an array of False and True, right? A case structure cannot work on an array. It can only work on a single value.

 

That said, from a conceptual view, all you need to do is to set the amplitude of the square wave to be your level. Creating a DC signal and then modulating that DC signal with a square wave is redundant. Right?

0 Kudos
Message 3 of 17
(19,853 Views)

I think you just want to "pick" that booleon out of the array so they are both just boolean. Use this function: programming > array > index array. This lets you pick out one data element. 

 

Edit: I left the "index" input blank because it defaults to picking out the first element, but here is the link on the index array function: http://zone.ni.com/reference/en-XX/help/371361E-01/glang/index_array/

 

Is this what you needed?

0 Kudos
Message 4 of 17
(19,842 Views)

You can select your true case by monitoring the boolean array to select if for all high values

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 5 of 17
(19,831 Views)

Yes, it is ture. But I want to understand how to use a TTL signal to drive a relay or other components. I am a newbie 😄

0 Kudos
Message 6 of 17
(19,809 Views)

I am sorry I cannot open your attachment, coz the version I used is 8.6.  I did consider the Index array, but I do not know how to always pick out the latest value in the array.

 

And it that possible I can recognize the moment F turns to T, and the moment T turns to F in labview?

0 Kudos
Message 7 of 17
(19,808 Views)

Thanks for your reply. I am wondering the input square wave is contineously writing to the boolean array. So I cannot use AND/ OR to control the relay turns on/off.  Am I right?
 

0 Kudos
Message 8 of 17
(19,807 Views)

@SO222 wrote:

Yes, it is ture.


What is true? To which message are you responding?


But I want to understand how to use a TTL signal to drive a relay or other components. I am a newbie 😄

That's not a LabVIEW question. That's an electronics question. Are you a student?

0 Kudos
Message 9 of 17
(19,793 Views)

@SO222 wrote:

 I did consider the Index array, but I do not know how to always pick out the latest value in the array.


Use Array Size to tell you the size of the array. Then you'll know what the last index is, right?

 


 And it that possible I can recognize the moment F turns to T, and the moment T turns to F in labview?

 Of course it's possible. It's a basic programming question. Use a storage mechanism to store your last value. Compare to the current value. Did it change? In LabVIEW, if you have a loop, a shift register/feedback node is a convenient storage mechanism for data.

 

 

Have you taken any LabVIEW tutorials, or done any programming courses, for that matter?

0 Kudos
Message 10 of 17
(19,792 Views)