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: 

Problem with running two different executables

Hi all,

 

I am having an issue with running two executables at the same time.

 

I have two programs that are set to communicate with two different Dose Calibrators through a simple Ascii RS-232 Interface. The programs take the strings returned by the Dose Calibrators, splits them, and saves them to arrays.

 

The strange thing is, I can initialize the DCs and they will run fine when I just have their reading displayed. I start saving/doing minor calculations with one of the exes and everything is fine. Once I start the second program, however, there gets to be a tremendous ammount of lag, the displayed arrays no longer update, the basic display cuts in and out, one program will start to read and then cut the other off...

 

I have no idea why it is doing this, as it simply is saving it to an array and performing a least squares fit elswhere in the program.

 

The only thing I can think is that the second program is exactly the first program, with the exception of some graphical and default com port changes. So this being said, the arrays being saved to are both called the same thing, but I thought there was program issolation, so I am at a loss.

 

Any help would be greatly appreciated!!

Thanks,

Luke

0 Kudos
Message 1 of 10
(2,382 Views)

Just a shot in the dark but it sounds like you may have greedy loops.  We would need to see the source code to be of more help


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 10
(2,376 Views)

1.png

0 Kudos
Message 3 of 10
(2,366 Views)

2.png

0 Kudos
Message 4 of 10
(2,365 Views)

3.png

0 Kudos
Message 5 of 10
(2,364 Views)

4.png

0 Kudos
Message 6 of 10
(2,363 Views)

These are the three loops that run once the user selects "begin recording" (excluding others that arent executing code). Off to the right of the first two is a wait loop, nothing special, just couldn't fit it on screen.

 

The last two screenshots are the same code, just moved the screenshot further to the right.

0 Kudos
Message 7 of 10
(2,362 Views)

I just realized I double posted the Array/Calculation loop. But just to clarify, the second post is the loop that has no issues apparent when running with the other. It is only when the array loops in both programs are running that I see the problem.

 

Any help would be greatly appreciated!!

Thanks

0 Kudos
Message 8 of 10
(2,335 Views)

Hey Sundown,

 

After looking at your code, I would have to agree with Jeff that you may be taking up a lot of CPU resources. I only saw one wait statement in the code you posted. A good way to test this would be to open your task manager and monitor your computer usage before and after you start your executables. If you run one executable and see your CPU usage jump to a large number then you are not giving your processor time to take care of other tasks while it is running and you may want to pay close attention to the CPU usage when you start the second executable. If this is the case, try inserting more wait statements in your loops.  

National Instruments
Product Marketer
0 Kudos
Message 9 of 10
(2,311 Views)

Yes, it does look like you have greedy loops. Also, I highly recommend that you learn how to use data flow correctly. You have unnecessary frame structures in your code. In general, You should avoid using frame structures. Besudes using data flow you should also look at state machines. State machines are much more flexible and maintainable than using frame structures.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 10 of 10
(2,307 Views)