LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory and CPU Allocation for Messaging Device

Hey Everyone.  

 

I'm writing a code for a UDP-based controller right now.  The gyst of the code is that it takes in command inputs, writes it to a UDP message, and passes this message to aconditioning unit.  The conditioning unit passes a message back ensuring that it received the initial prompt.  This happens at a rate of 1 Message per 2000 us, back and forth.  My problem with this system is that when other, additional programs are launched upon the same computer (the HOST) the message rate drops and they system initiates a shut down.  The new programs are not wire-communication based.

 

Are there any practical ways to reduce data/memory usage within this program?

 

Attached is my current code.  

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

I can't open your VI as I'm currently using a machine that has only LabVIEW 2012. However, what makes you think the problem is inefficiency in your code? If you're running on Windows, you have very little control over how quickly your program will respond, regardless of how much you optimize it. You're trying to get out a message every 2ms, which is difficult if not impossible to do reliably on a desktop operating system, especially if you can't limit the other activities that the computer is performing. If it's absolutely necessary to get that level of timing, you'll need to consider a different solution, such as a real-time operating system.

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

I agree with what nathand has said - it's almost impossible to get accurate timing from a Windows OS and anything the computer decides to run in the background (defragment, anti-virus scan, some scheduled service, launching another program) will have an impact on the reliability of the timing.

 

There are things you can do to reduce it (stopping all unnecessary services, running your application as higher priority) but Windows really isn't designed for determinism so you wouldn't really be able to eliminate it.

 

If you need deterministic timing you need to think about using a Real Time OS. Otherwise you'll need to make your timing requirements more relaxed as in try to send a message every 2ms but don't shutdown the system unless you don't receive a message for 500ms.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 3 of 4
(2,664 Views)

Ah, thanks for the heads up.  I'm a student right now in EE and didn't realize that Windows would lack this capability.  I was just looking for an easy way around it.  Thanks for all the help!

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