03-12-2008 03:56 PM
The problem I am having is that I can only switch tabs and activate the command button when the CVI .dll is running code, and not the C++ app. I would like for the user to be able to switch tabs at any time because placing a part in the fixture takes a bit of time, but events seem to be only processed when some form of the .dll code is being run, and ignored otherwise.
I've tried a couple of different ways to get the interface to recognize input. One try was to start a new thread when I load the .dll with a call to SetActivePanel and RunUserInterface hoping that the thread would keep an instance of the .dll running at all times, but that didn't work.
Any suggestions on a possible fix here would be welcome.
03-13-2008 06:27 PM
Hi MattZ,
I had a couple of clarifying questions, I just want to make sure I understand your setup correctly...
The CVI dll:
I understand that it collects the data and graphs it. You mention that the graph panel (I assume that is in CVI) contains a button and a canvas. What do you mean by the canvas?
Algorithm:
You mention that you move/put parts into the fixture. What do you mean by the fixture?
Do you run the measurement several times and add the new measurements to the graph? If so, do you re-load the dll or simply call a function on the dll?
Also, you want to be able to switch tabs and be able to click the button from the UI. Are the tabs in the CVI UI dll or in the C++ dll? I assume from your problem that they are in CVI. What do the other tabs contain?
You mention that you can manipulate the dll UI when the dll code is running. What specifically is running in the dll at this point?
Thanks.
03-17-2008 02:03 PM
Thanks, to answer your questions:
Understand that it collects the data and graphs it. You mention that the graph panel (I assume that is in CVI) contains a button and a canvas. What do you mean by the canvas? To get the tabs, I use the CVI function EasyTab_ConvertFromCanvas to convert the canvas into a tab control. The tab control consists of several panels with graphs corresponding to different measurements, so the canvas is is the tab control I want to be able to switch.
You mention that you move/put parts into the fixture. What do you mean by the fixture? The fixture is just a mecahnical housing that a robot puts a part to be tested in. The only reason I even mentioned the fixture was to illustrate that the process takes a little time. If you just think of the situation as an application takes a lot of time and then calls a .dll function that takes a couple of seconds and then returns to the application again, that's probably a good enough idea of what's happening.
Do you run the measurement several times and add the new measurements to the graph? Yes, the measurement is ran several hundred times and a new plot is added to one of the graph tabs.
If so, do you re-load the dll or simply call a function on the dll? The .dll is only loaded once when entering the program. Everytime the .dll takes a measurement, it graphs the resulting data.
Also, you want to be able to switch tabs and be able to click the button from the UI. Are the tabs in the CVI UI dll or in the C++ dll? The tabs are from the CVI dll.
What do the other tabs contain? Each tab contains a different graph corresponding to a different measurement.
You mention that you can manipulate the dll UI when the dll code is running? What specifically is running in the dll at this point? It is one function that takes a measurement, collects data, and graphs the data to the appropriate CVI tab. It's pretty envolved. The one function and it's subfunctions probably run about 2500 lines of code, but most of that is opening files, processing data, doing GPIB calls, some DCOM calls, and graphing.
I might be able to take a screen shot of the entire user interface, if you are interested. A picture might explain things much better and faster. Thanks for the help. I was thinking about putting together a experiment where I just sit in a Visual C++ application for a number of seconds and then call some CVI .dll code and see if I can manipulate the CVI user interfaces, but I don't know Visual C++ well enough to do that.
03-18-2008 06:33 PM
Hi MattZ,
A screenshot might be helpful in understanding what you have setup.
Meanwhile I can try to create a similar setup on my end and see what I get. Basically I am thinking:
1. Create CVI dll that has a UI with buttons and graph. The graph displays data from an analog input and the buttons start/stop the acquisition.
2. Create a VC++ application that loads the CVI UI on it.
3. Now, the dll code should not be running, since I did not tell it to acquire. I will test to see if I can manipulate the 'Start' button.
Would that be a similar enough setup for test purposes?
03-18-2008 09:39 PM
03-19-2008 11:40 PM
03-20-2008 06:00 PM
03-24-2008 10:59 AM
03-24-2008 12:50 PM