11-22-2005 02:55 PM
11-23-2005 10:10 AM
Hello,
I think the best way to approach this problem is to test whether or not the
problem is related to the instrument driver or something in the LabVIEW
code. I recommend with starting by keeping your current architecture and
removing all calls to the instrument driver and replacing them with simulated
data. For example, if one call to the driver polls the state of the
instrument and returns some I32 value representing the state, you could use the
Random VI with the multiply (for scaling) and a conversion to simulate the
call. If Datasocket still brings your computer to a standstill this
problem is likely something in either your code, or the network/computer
setup. If datasocket works well, the problem is likely related to the
driver or some dependency between your code/datasocket and the driver.
Hopefully this may shed some light on the problem. Keep us posted how it
goes!
Regards,
11-23-2005 03:43 PM
11-28-2005 07:33 PM
Hello,
This is an interesting problem. I suspect that with 4 cpus there might be
a problem with some sort of non-threadsafe DLL somewhere along the way that is
being scheduled causing some sort of hang-up. If you change the timeout
value of the timed loop, is the average execution time always roughly equal to
the timeout value? What happens if you create a simple VI designed just
do basic datasocket? I assume that this runs fine until some of the
instrument drivers are loaded, but what about taking this basic datasocket VI
and gradually including more and more of the instrument driver in an attempt to
determine if the behavior is limited to a single component of the driver.
We could also disable multithreading in LabVIEW to see how that affects the
performance (under Tools->Options->Performance and Disk). I assume
that you are using the most recent drivers but it never hurts to double check
that too.....
Hope this helps, let me know how things go!
11-30-2005 06:05 PM
Travis;
I've paired down my vi considerably so it's easy to segregate the problem area and have pretty much narrowed down the library functions that I am calling that cause the poor performance. It's not just any function call in the Pacific Instruments (PI660DLL) library, but the calls that actually report back the real time channel data.
I've tried disabling multithreading, but this does not change the performance.
There are some interesting things going on as far as timing issues go. First, no problems at all if sockets are disabled. I get what I'd expect. Next, if I start out with a "Wait until next ms multiple" of 2000 ms or greater for my queries, the execution time of the function is approx. 300 to 450 ms. If I decrease the wait time incrementally to 1000 ms, execution time remains at 300 to 450 ms. Average loop time remains the same as the specified wait time. Once I drop below 1000 ms, even by 1 ms, both the loop time and the function execution time bounce from 990 ms to 1016 ms (avg 1000 ms). Simply raising the wait time back to 1000 ms does not rectify the timing. I have to raise it to 2000 ms before I see the times even out to what they were when I started. The CPU is hardly working during all of this.
One of my biggest problems is that there are 4 vendors (including NI) involved with this system. Each of which has written software.
If you can think of anything else, it would be appreciated.
Thanks;
cb3
12-02-2005 11:08 AM
Happy Friday!
One question I have for you is about how you are using Datasocket. Are you using the Datasocket VIs or are you sharing a data item via right clicking a control and choosing to connect to a Datasocket item? In either case, you need to have the Datasocket server running to communicate – does the slowdown happen when you turn on the server, or when you have Datasocket VIs in your program? I know it seems unusual that the VI can behave in one way (say with a 1001 ms wait), then behave badly (say with a 900ms wait), then continue to behave badly where it used to work (say by going back to 1001 ms wait). This can happen for any number of known and unknown reasons, but one possibility is that the hang-up could come from the driver. Anytime (well most of the time…) a DLL is used in LabVIEW, the DLL is loaded into memory. The state of the DLL is preserved between calls and is not reset until the DLL is unloaded when the program ends. This could mean that some condition in your code is putting the driver DLL in a bad state that it is not recovering from until you set the wait time back to 2000 ms. Additionally, the fact that your CPU is not busy further indicates that this is likely some sort of resource allocation/conflict problem (though I have NO idea why it would lock up your UI). One possibility for troubleshooting is to remove Datasocket from the picture completely and use the underlying TCP/IP VIs to send data (there are also UDP functionality which you can use). It’s no trade secret that Datasocket uses TCP/IP to transmit/broadcast data – removing the extra NI software associated with Datasocket may shed some additional light on the situation (though you may end up having to spend more time than you are comfortable with converting your program to use TCP. One tip is to start with a small VI which can reproduce the problem and try it with that before moving on to rewriting your program….I don’t really have any additional ideas at this point, except to continue the debugging process and eliminate as much as possible. Please keep us up to date with any new information available.
Have a great weekend!