Naresh Posted October 7, 2005 Report Share Posted October 7, 2005 Hi all! I am naresh. my primary interst is in biomedical signal analysis and wireless communication. My question to the LAVA society is that in the scenario where LabVIEW takes more time than C or VC++ to manipulate arrays, execute a for loop how well does LabVIEW counter VC++ or JAVA in the world of biomedical signal anlysis when it comes to analysing the signal in realtime. Here i am addressing to bedside monitoring and similar critical cases where decission delayed be fatal. reagrds naresh Quote Link to comment
Yair Posted October 9, 2005 Report Share Posted October 9, 2005 Hi all!I am naresh. my primary interst is in biomedical signal analysis and wireless communication. My question to the LAVA society is that in the scenario where LabVIEW takes more time than C or VC++ to manipulate arrays, execute a for loop how well does LabVIEW counter VC++ or JAVA in the world of biomedical signal anlysis when it comes to analysing the signal in realtime. Here i am addressing to bedside monitoring and similar critical cases where decission delayed be fatal. reagrds naresh I have no experience with using LV in medical fields or with directly comparing LV to other languages, but I will give you a general answer. First, to get real time performance, you will need a real time device with a real time OS. You will also need RT programmers. These should all affect the decision. For example, is there Java support for real time platforms? Do you have access to LV programmers with experience in RT programming? There is no direct relation which says "LV will take twice as long to execute a loop", but in general, it is considered to be slower than C, even by NI. However, NIs RT devices can be very fast, and have been used in the medical field (search NIs site for examples). These targets also have built in ethernet handling, which is good for wireless comm. The bottlenecks are often in the I/O itself, in things like handing really big data structures and in non-deterministic operations, like file I/O or communications. Managing memory in LV RT is very important - you need to make sure you don't continuosly allocate more memory and that your deterministic operations are shielded. The best solution is probably to get a LVRT programmer or to take one of NIs courses (and at least to read about it on the net). Quote Link to comment
Rolf Kalbermatter Posted October 16, 2005 Report Share Posted October 16, 2005 There is no direct relation which says "LV will take twice as long to execute a loop", but in general, it is considered to be slower than C, even by NI. While it will be virtually impossible to create a LabVIEW routine which could beat an optimized C routine, the speed difference in general is not very large, as long as you understand how LabVIEW handles the data. LabVIEW always uses resizable data structures for arrays while in C you typically work with preallocated memory chunks. The reason is simply because in C you have to deal with memory allocation and deallocation anyhow you usually won't even think about reallocating an array in a loop as you add new values to it. LabVIEW doing all the memory allocation stuff for you, it is easy to build a loop where you use the Build Array function to construct an array and then people are surprised that this loop takes ages to execute. Instead using the auto indexing feature on the tunnel of the loop border (or sometimes for more complicated solutions doing a preallocation of the array with a shift register on the loop and a Replace Array function inside the loop) will basically create a loop which does at least as well as a non-optimizing C compiler will do. So in general speed difference in typical applications between LabVIEW and C, if you know what you are doing in LabVIEW, is minimal. The only areas where LabVIEW usually will be hard to code in a way which comes close to a well programmed C code program is for algorithmes with lots of bit manipulations and complicated array manipulations. The most important difference between LabVIEW and C in my opinion is that you can write quite extensive LabVIEW programs, albeit quite often with very bad performance and architecture, eventough you have no idea about programming, whereas you need at least a good basic idea about programming before you can create even the most simple C program. Java having similar high level advantages as LabVIEW such as implicit memory management etc. will basically suffer from the same issues where you can write very bad performing routines if you don't know how to make the algorithme in such a way to help Java use the best programming structures for the problem at hand. Rolf Kalbermatter Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.