02-15-2006 02:17 AM
02-15-2006 02:25 AM
02-15-2006 05:22 AM
Shane, thanks for the appreciation.
Our success is mostly attributed to common sense programming and clear engineering domain knowledge. Truly, we are not great at LV programming.
Would you believe that we have never used stuff like VI server, occurences, queues, notifiers, semaphores, CIN, data sockets? When I think of all this and other great LV tricks, I feel awed how much more there is to learn, happy that we know what is the right direction and hurried that time is running out. Its been great fun until now.
I do know of the coding challenge but feel inequipped to really make myself noticeable in the company of other LV giants. Correct me if I am wrong, but is not the coding challenge a test of ONLY coding skills?
Lets make things better (picked from Philips' punchline).
Rgds,
Gurdas
02-15-2006 08:01 AM
5) Avoid locals and stick to property nodes. Also avoid globals.
7) Use the best fit number type. Most of the code runs on U16. At some stage it becomes DBL. We are still to test speed gain/loss if we keep it DBL from the start. However, we do not expect any surprising gain/loss. Any thoughts on this?
02-15-2006 10:32 AM
Kevin,
I too read that thread a few days back and yes, it was very informative. Infact I had posted some questions in the same thread (page 2). Maybe you could help me with those.
The thread says that Property Node is expensive because it spends time updating the control/indicator. But what if its a subvi with no front panel display? We assumed it will be OK to use property nodes for such cases even when we are trying to save time.
Any thoughts on how right we are?
Rgds,
Gurdas
02-15-2006 11:15 AM
@Gurdas wrote:
But what if its a subvi with no front panel display? We assumed it will be OK to use property nodes for such cases even when we are trying to save time.
Any thoughts on how right we are?
You're probably very wrong as a property node is only something that is used to update a control. If you get rid of the front panel (when you build the application) you will probably get an error because LV can't find the control and if you do it in LV you will probably force LV to allocate the needed memory for the FP control (something it might do anyway, I'm not sure). In any case, using a property node forces LV to update the display and to go through the UI thread which definitely takes up time.
In general, the best ways of trasferring data (memory wise) is through wires, using an in-place global (lv2 global, same as JP's example from earlier) or (if you don't care about the copies) using locals\globals which would be the fastest after wires if you don't need to allocate a lot of memory. You can try reading the performance and memory management white paper found in the LV bookshelf in the help menu.
02-15-2006 10:53 PM
tst wrote:You're probably very wrong as a property node is only something that is used to update a control. If you get rid of the front panel (when you build the application) you will probably get an error because LV can't find the control and if you do it in LV you will probably force LV to allocate the needed memory for the FP control (something it might do anyway, I'm not sure). In any case, using a property node forces LV to update the display and to go through the UI thread which definitely takes up time.
We have never seen that error when building and then running an exe/installer. I am not sure what you mean by "get rid of front panel". What we do is set the subvi property to not display the FP when called. Do you think the property node would still be going through the UI thread?
We would be implementing LV2 globals next version onwards.
Rgds,
Gurdas
02-16-2006 04:10 AM
02-16-2006 06:28 AM
@tst wrote:
When you build an application, the FPs for some of the VIs get removed (you can see this in the VI Settings tab of the builder). I'm guessing that if you're using a property node the panel doesn't get removed because it knows it needs the FP. And yes, as far as I know, using a property node will always go through the UI thread and may even cause a copy for the indicator, even if you don't open it.
02-16-2006 07:39 AM
OK, here's a simple example. Watch the memory monitor. When running the VI without using the Value property, the usage is 16 MB. The usage will only go up after you open the FP of the subVI. When using it, it takes another 16. That's why you don't want to use property nodes to transfer data. Also, it's much slower because of going through the UI thread and it breaks your dataflow. One thing I don't understand is why the first time I run the VI the memory monitor doesn't show any memory consumption, but run it twice and you will see it.
To better see how using property nodes forces you to have the FP in memory, try putting a reference of the array in the subVI. Just create a reference of the array with nothing attached to it. At least in LV 7 this forces LV to create the FP and requires the extra 16 MBs each time you run the caller.
Try running the application builder for this and you will see that it removes the panel for the subVI. If you add a reference or a property node inside the subVI, though, it will not remove it. I'm pretty sure that if it had been removed, attempting to use a property node from the caller like I did would fail and return an error.