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: 

Boolean flash within loop

Hello,

 

I have a loop in which a 2D boolean LED array lights up according to the timing within a seperate 2D array. I want this loop to run as fast as possible. Whenever a boolean within my array becomes true, I want a different 1D array (length = number of columns in 2D boolean array) to flash for a short amount of time, say 100ms. My problem is I am unsure how to incorporate this into my VI without slowing the functionality of the main loop.

 

I've considered getting the time when the boolean turns on and comparing it to the current time and wait until a certain difference arises but I am unsure how I would program this, and I also believe it would be very complicated and there is probably a simpler solution.

 

So to summarise, I wish to find a way to flash a 1D LED array for a short amount of time when a boolean in a 2D boolean array becomes true in the corresponding 1D column, without slowing the main loop.

 

Can anyone point me in the right direction here?

 

Many thanks

0 Kudos
Message 1 of 4
(2,801 Views)

Well don't be shy, share your code. This will make it easier to understand what you're doing and what you've tried already, so we can help better.

 

You may want to use the "Elapsed time" VI mixed with an OR statement in case that column goes true again while still illuminated, but it really depends how the rest of your code looks. 

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 4
(2,797 Views)

I agree with Jim -- show some code so we have some idea of What You Mean and What You Have Tried.

 

You do know, I presume, that LabVIEW supports parallel execution of code, don't you?  Dataflow is a wonderful concept ...

 

Bob Schor

Message 3 of 4
(2,769 Views)

@jimmycooney94 wrote:

I want this loop to run as fast as possible. 


Please explain what that means. Do you basically want to peg all CPU cores at 100% and starve all other processes running on the same PC or do you want defined timing that does not depend on the exact hardware? Just running "as fast as possible" will also give you huge amounts of jitter because of OS scheduling.

 


@jimmycooney94 wrote:

Whenever a boolean within my array becomes true, I want a different 1D array (length = number of columns in 2D boolean array) to flash for a short amount of time, say 100ms.


Define what you mean by "flash" ("invisible...visible..invisible", "different color for a short amount of time", etc.). What makes the boolean become true? What do the rows and columns of the boolean array represent?

 


@jimmycooney94 wrote:

So to summarise, I wish to find a way to flash a 1D LED array for a short amount of time when a boolean in a 2D boolean array becomes true in the corresponding 1D column, without slowing the main loop.



Since your main loop does not seem to have a defined timing, "slowing down" is equally poorly defined.

 

As already requested, please show us your VI. Also, please give a little bit of background on why you need that and how it is applied to the real world. Is there any DAQ hardware involved? Is this running on a desktop OS, on embedded hardware, or even on an FPGA?

 

0 Kudos
Message 4 of 4
(2,761 Views)