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.
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.
05-24-2012 11:49 AM
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?
05-24-2012 12:20 PM
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.
05-24-2012 12:29 PM
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?
05-24-2012 01:36 PM - edited 05-24-2012 01:39 PM
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?
05-24-2012 01:57 PM
You can select your true case by monitoring the boolean array to select if for all high values
05-25-2012 03:52 AM
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 😄
05-25-2012 03:58 AM
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?
05-25-2012 04:02 AM
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?
05-25-2012 06:26 AM
@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?
05-25-2012 06:27 AM - edited 05-25-2012 06:29 AM
@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?