LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

GUI freezes in Debug Mode

Hi all,

 

I have a DLL library built with CVI that handles communications with one of my company's products over the serial port.  I created a unit tester GUI program to test all of the functionality of this API.  Both of these were created using CVI 6.0 and worked beautifully.  I recently installed CVI 8.5 and I am finding that the debugger is freezing the testing GUI as soon as I click on a control to set the com port or anything else.  I tried updating the CVI install to 8.5.1 and I am having the same result. 

 

Is there some conversion issue between the two versions of CVI that I need to know about?  This seems to be specific to the GUI panels and controls in debug mode rather than the code because I can run it in release mode with no issues.

 

Thanks in advance for any help.

 

Judy H

0 Kudos
Message 1 of 12
(4,624 Views)

Hi again,

 

I found a clue.  The freeze happens only when both the DLL and the tester GUI are built in debug mode.  This is something I had no issues with in CVI 6.0.  If I build the tester with the release DLL or Static lib, I can debug my tester code successfully. Have not tried to use the release tester with the debug DLL yet, but I was easily able to use both builds in debug mode in CVI 6.0.

 

Judy

0 Kudos
Message 2 of 12
(4,623 Views)

Tested the DLL in debug mode with the tester in release mode.  I ran the tester as an external process from the DLL project.  Could not debug the dll in this situation.  So, the upshot is that I cannot debug my DLL regardless.  I need to know why the tester and DLL cannot both be run in debug mode.  There is no appropriate workaround for this.

 

Please help.

 

Thanks,

 

Judy

0 Kudos
Message 3 of 12
(4,599 Views)

Yet more info...

 

I had previously found a registry issue with my compiler and fixed it.  A maintenence program caused it to get set to the wrong value again, so I uninstalled the maintenence software and reset the registry variable.  Now, I can run both in debug mode, but after a certain point (about 30 lines into a text box telling me the status of each function call) the SetCtrlVal function in the tester that adds a line to the text box seems to hang the program.  By this time, plenty of lines have been written out with no problem.  There is a function call afterward that may take some time, but I never get to it.  The hang up is on SetCtrlVal.  Any suggestions?

 

Code:

    sprintf(msgBuffer, "Connection Test 4: ConnectToTester(charData)...\n");
    SetCtrlVal(mainpanel, MAIN_STATUS, msgBuffer);

 

BTW, I am including the stdio.h header to handle sprintf.  Never did quite get used to the Fmt functions.

 

Thanks,

 

Judy

0 Kudos
Message 4 of 12
(4,583 Views)

Hello Judy,

 

I am glad to hear you solved the original issue. Have you checked to see what sprintf returns? You can check the CVI help for each function to see what parameters should be passed and what should be returned.

 

Let me know what sprintf is returning, I have a feeling the issue is not with SetCtrlVal.

With warm regards,

David D.
0 Kudos
Message 5 of 12
(4,572 Views)

Hi Dr. D.,

 

Thank you for your help.  Unfortunately, this bug does appear to have something to do with SetCtrlVal.  I did ad a return value on the sprintf function and it is correctly returning the number of characters in the string.

 

    error = sprintf(msgBuffer, "Connection Test 4: IFConnectToTester(charData)...\n");
    SetCtrlVal(mainpanel, MAIN_STATUS, msgBuffer);
    WriteFile (filehandle, msgBuffer, strlen(msgBuffer));

 

error correctly gets 50 for the number of characters.  As I step through the next line, the debugger hangs when I execute the SetCtrlVal statement.  mainpanel is my panel handle, MAIN_STATUS is the text box control.  I am also writing all the text off to a file as I go so I can easily look over the results after all the testing is done.  The program generates several hundred lines of text when done - or is supposed to anyway.  The strange thing is that code just like this executes about 30 times prior to it hanging up the debugger.

 

Another possibility... this appeared to run fine on another machine.  The user has since left and I had his license for CVI 8.5 taken off his machine and put on mine.  I have had some registry issues and I'm wondering if there is some registry value that may be set wrong that may affect this.  Any suggestions anyone?

 

Thanks,

 

Judy

0 Kudos
Message 6 of 12
(4,559 Views)

Anyone,

 

Another thought as I troll through the discussion group: Is there a publication for CVI 8.5.1 that can tell me what the registry values that affect the CVI IDE are supposed to be upon installation?  If so, where can I find it?

 

Thanks,

 

Judy

0 Kudos
Message 7 of 12
(4,554 Views)

Hello Judy,

 

I am checking on the list of registry defaults for you.

 

However, I am not sure that is the issue. Is SetCtrlVal hanging on the same line every time? Are you trying to put the same number of characters in every time? What happens if you reset the text box (I am assuming you are using a text box control) 15 lines in?

 

Let me know and I will post again to update you on whether or not we have a list of defaults available.

With warm regards,

David D.
0 Kudos
Message 8 of 12
(4,545 Views)

Hi David,

 

I did manage to clear up a few things and get the program moving further - and, no it does not die at the same line each time, but always at a line that uses either the SetCtrlVal or sprintf.  I had some issues with the Async timer and critical sections that I cleared up which seemed to get it past the usual place where it was dying only to croak a couple of function calls later again at the string and text functions.  A look at the registry may help.  I had some serious problems earlier with CVI 6.0 after running a tune-up utility that "cleaned" up the registry.  I'm hoping that if I can set all the appropriate registry variables to their proper defaults, that will get me going.  Meanwhile, no huge rush - I'm off now until after Labor day.  Happy Holidays and thanks again for all your help.

 

Judy

0 Kudos
Message 9 of 12
(4,532 Views)

Hi Judy,

 

I'm a tad skeptical that the problem you're having has to do with the registry. The reason being, that the problem is not happening with the ADE, but at runtime, and runtime behavior is not very much impacted by registry settings. Nevertheless, if you'd like to try it anyway, the quickest way to restore your CVI registry settings to their default state is first to make sure that CVI isn't running at all, and then remove (or preferably rename, in case you want to undo) the following key: HKEY_CURRENT_USER\Software\National Instruments\CVI\8.5.

 

In addition, after resetting the registry, you might want to completely remove your cvibuild.* folder and rebuild your project. If you can get it to reproduce the problem behavior each time you run it, regardless of whether it is inside SetCtrlVal or sprintf, then I would suggest installing CVI in a different PC and running your identical program there. If the problem also happens in other PCs, then it would be great if you could send us the program, so that we could investigate the problem. If you're not comfortable attaching it here publically, you could always use NI's FTP site.

 

Luis

0 Kudos
Message 10 of 12
(4,518 Views)