LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview on a server? Also, my VI takes up too much processor resource

What I would like is a program that would run on a server and that would scan for data that is arriving via a TCP connection and place it in a file for another program to deal with.

2 questions:

1. Can a LabView program run on a server? (Maybe a stupid question but I thought I would ask anyway)

2. How do I prevent Labview using all the processor power available on a computer so that other programs execute as normal when running in parallel
          Is this down to how I structure the program and write the code? Is there any application notes available?

Thanks

Ken
0 Kudos
Message 1 of 5
(2,813 Views)
Your first question depends on what OS is running on the server. I'm not sure which ones are supported. The normal desktop versions of XP are, but I'm not sure whether the server version is. Even if it isn't officially supported LabVIEW may run on it ok. As to your processor usage, that depends on many things, but how you structure your program is probably the most critical, as well as the one you have the most control of. There has been a lot written and posted on the FAQ, threads etc. as well as the LabVIEW online manuals. Things like making sure you have a "wait (ms)" function in your loops can make an enormous difference. As a demo, write a simple vi with a loop, and run it without the wait, and then with and observe your processor loading. No other LabVIEW code running and you will still spike CPU usage. Look for threads and FAQ's about optimization.
 
P.M.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 5
(2,804 Views)
There is a way to make a LabVIEW exe run as a service on any NT based machine.  I don't remember where I put the docs for that but I will look over the next couple of days at home...usually where I keep little tidbits like that. 

Paul
0 Kudos
Message 3 of 5
(2,795 Views)

Hi,

You may want to check out some of the links pasted below. Essentially there is vast amounts of resources on LabVIEW's networking capabilities. I'm wondering what version of LabVIEW you working with and it may be helpful if you could elaborate on what in particular you want to achieve and perhaps attach your vi for us to inspect? LabVIEW basics 1 and in particular 2 courses outline good practices to employ when coding your block diagram code. For example it is more effiecient to use lower level vis and functions rather than express vi's. e.g. in some cases when doing data acquisition use specific the daq vi's instead of the DAQ Assistant express vi. For file io operations using intermediate level file io functions and vis allow better manipulation rather than LVM express vi's. e.g. doing opening and closing operations outside a while loop. etc.... Generally you should be able to do multi-tasking with a LabVIEW application that you have running just like with any other application on your computer it is all about how your operating system distributes resources / processor time between different applications you have running. Essentially there are ways to make code more efficient - even with parrallel loops in the block diagram the os is distributing processor time and other resources between applications - unless you are using RT operating systems and FPGA's.... where you look at developing deterministic apps.

About LabVIEW vi server

http://zone.ni.com/devzone/conceptd.nsf/webmain/b837d4f9277ec75786256990006ebe5b  

About developing a VI based server

http://zone.ni.com/devzone/conceptd.nsf/webmain/bb7a08241bb0797c86256812005d1f3c 

About internet protocols and LabVIEW

https://www.ni.com/en/support/documentation/supplemental/06/basic-tcp-ip-communication-in-labview.ht...
http://zone.ni.com/devzone/conceptd.nsf/webmain/ba7f1d7ce009be7686256a5b004f335d 

TCP read and write

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3EBED56A4E034080020E74861&p_node=DZ52052&p_source=External 


I hope this helps!

Kurt
Applications Engineer,
NI UK & Ireland.

0 Kudos
Message 4 of 5
(2,766 Views)

Labview can act as a network server by listening on certain TCP or UDP ports on any computer/OS supported by LabVIEW. (It does not need to be a "Server", whatever you mean by that ;)) Check the shipping examples.

 

You need to pace your UI loops. Use event structures if needed. A loop in LabVIEW will spin as fast as it can, millions of times a second, consuming all CPU available doing the same calculation over and over again. You need to esure that the loop only spins if e.g. inputs change or something new needs to be done.

  • in the simplest case, place a short wait statement in your toplevel loops.
  • To monitor UI elements, use an event structure
  • For precise timing, use a timed loop.
  • To wait for a TCP connenction, use an infinite timeout.

Connect an indicator to the iteration terminal to verify your loop execution.

0 Kudos
Message 5 of 5
(2,747 Views)