LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wait function alternative

Hello,

 

I have been using auto indexing tunnels to extract values from an array to be used for further operations. Now the problem is within the program when this auto indexing is being run all the other loops and readings are stopped until this for loop is being executed. Is there any< way to sort this issue?

 

Thanks in advance,

Safar

0 Kudos
Message 1 of 9
(2,789 Views)

Split the program into several loops so they're not dependant on each other.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 9
(2,785 Views)

From your description, it sounds like you have everything running inside of the same loop and the FOR loop is the slow part.  It would help us a lot to help you if you shared your code.

 

Perhaps you could share some more about what your code is supposed to do.  We could make a lot more informed advice that way.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 9
(2,780 Views)

@safskm wrote:

 

I have been using auto indexing tunnels to extract values from an array to be used for further operations. Now the problem is within the program when this auto indexing is being run all the other loops and readings are stopped until this for loop is being executed. 

 


That is a bit thin to tell what's wrong.

 

Do you mean the loop takes a long time? You could start it in parallel (dynamically). Or use for loop parallelism to speed it up if possible.

 

In stead of auto indexing you can use a queue (or channel wire) to communicate the results as they are found to another loop. This loop will process the results as they come in, not when the first loop is done. You can repeat this to consecutive loops. You do need a way to stop all the loops. For instance, the results might include a Boolean that stops the next loop...

0 Kudos
Message 4 of 9
(2,774 Views)

The program is huge and I don´t know if i have the liberty to share it.

I ll explain what the program does though. It is a nozzle spray system. We give Air and water pressure values as inputs using which the nozzle sprays water.

Earlier the program was written in such a way that we have to manually insert pressure values one by one and record. Now I have tinkered with it and using index array I was trying to change the program in a way that when i click start the values from the arrays are taken as pressure inputs automatically with 5 seconds gap between each values.

 

Now the system as a whole has other datas and parts as well such as a heating system to increase the temperature of the water and air so that it can be tested under various temperatures.

When i click start the program runs but the issue is as soon as the iteration is started i.e the pre defined values in the array is being taken the other values such as the temperatures are stopped the readings from those are not being taken. The whole program is inside a timed structure.

 

I hope you got the idea. I ll share the screenshot of the code if you need.

 

Thanks,

Safar

0 Kudos
Message 5 of 9
(2,719 Views)

Judging by your description of the problem, I am guessing your program is "one big loop" and you have a data dependency.

 

Using a proper program architecture could fix this, but we really need to see your code to offer more than general advice.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 9
(2,744 Views)

@safskm wrote:

The program is huge and I don´t know if i have the liberty to share it.

 


"Huge" might be part of the problem. Obviously, you have a dataflow problem due to basic misunderstandings. You definitely don't want to autoindex with a 5 second wait. Keep the current index in a shift register and use a simple state machine Whenever time is up, increment the index to go to the next element while keeping the state machine running at regular intervals and to deal with user interactions and IO.

 

You do not need to share the gigantic code. Nobody wants to look at it anyway. Simply create a very small program demo that show the basic things you are doing, and we will point you in the right direction.

0 Kudos
Message 7 of 9
(2,712 Views)

I did not quite understand what you said here. So if i use the current index in a shift Register how do i put the wait time between each values. For me that is very important inorder to automate everything.

Anyways I ll try o make a small program demo and Show you.

 

Appreciate your help.

Thanks

0 Kudos
Message 8 of 9
(2,667 Views)

@safskm wrote:

I did not quite understand what you said here.


"You" who? Me?

 

Please specify who you didn't understand (and pref. what exactly and why). Quoting (like I did) helps...

 


@safskm wrote:

So if i use the current index in a shift Register how do i put the wait time between each values.


It's impossible to tell what you want exactly.

 

Current index, Shift Register and Wait Time are three unrelated things, and can be combined to a gazillion ways.

 

What I get is this. You have an array. You want to do something, on specific elements, one by one with a wait between them. But once you found an item, you want to continue processing it immediately, not when the for loop is completed.

 

That's not too difficult. There are numerous solutions. Guessing what you have now is impossible.

0 Kudos
Message 9 of 9
(2,650 Views)