01-27-2015 07:03 AM - edited 01-27-2015 07:12 AM
Hi friends.
I would like run three loops in different speed which one. Also have only one stop button.
In my project I am using local variable but the computer brakes always.
Reviews will be welcome for all code.
Thanks,
Alexandre.
01-27-2015 07:46 AM
Hi alex,
it really is a problem when the "computer brakes"… 😄
Can you describe your problem more detailed? Error codes? Specific problems?
Using more locals will seldomly help. Adding zero to a number also isn't needed. Using wrong datatypes forcing typeconversion isn't preferred…
Why do you need a parallel loop just to show a numeric value?
01-27-2015 08:30 AM
Hi
The big problem that I am facing is the frozen screen; the mouse cursor don't move or move slowly. Another problem is to stop the vi. I need a unique button to stop all loops.
In my project there are four while loops: 1-process the image and calculate the widht; 2-store the widht in a spreadsheet (here I need adjust the speed to store each 2 minutes); 3-display the widht (speed 1000msec); 4-show the widht in a graph (20msec).
Alexandre
01-27-2015 08:36 AM
Hi alex,
it's spelled "w i d t h"…
- Loop 3 and 4 can be made into just one loop: update the numeric display only every 50th iteration!
- Loop 3 and 4 can be included in loop 1, no need to transfer a scalar value to two different loops.
- Use a notifier to transfer your data from loop 1 to loop2…
How much CPU load does your program consume? Check the task manager!
Put a wait statement in the acquisistion loop to minimize CPU load…
01-27-2015 08:44 AM - edited 01-27-2015 08:45 AM
Ok, width, thanks.
Please, could you give me an example code about "50th iteration" and "notifier"?
About the stop button, how can I manage to one button?
The CPU is about 80%, maybe due the linescan camera.
Alexandre.
01-27-2015 08:51 AM
Hi Alexandre,
use a "quotient and remainder" operation to divide the loop iterator by 50. When the remainder is zero you execute a case of a case structure…
You already use local variables for other items. Why not use a local variable of the STOP button?