LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parallelism - widht gage

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.

Download All
0 Kudos
Message 1 of 6
(2,698 Views)

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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,674 Views)

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

0 Kudos
Message 3 of 6
(2,659 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(2,651 Views)

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.

 

0 Kudos
Message 5 of 6
(2,643 Views)

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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 6
(2,631 Views)