Home > Software engineering >  MSCOMM32. OCX occasionally call to use again
MSCOMM32. OCX occasionally call to use again

Time:09-25

I now use Wincc Advanced third party industrial control software, called the MSCOMM32. OCX for sweep code gun communication data, application, function is good, but two problems:
In a few days later, it doesn't work out, suddenly can't sweep data, using serial debugging software test is good, can only be invoked again once, deleting the controls on the screen (phone), add again, set parameters, to use again, restart the computer also not line, must call again,
2. After open the serial port, unplug the scanning gun, run the system crashed about a minute, can't operation, a minute later returned to normal, and plug in the scanning gun, also it doesn't work out, have to restart the computer to use, a serial port is a USB virtual serial port,

I don't know which you don't have to know where these two problems?

CodePudding user response:

One way to check whether resource leaks:
In the process of the task manager to see inside the column selection: memory, virtual memory size, handle number, number of threads, the USER object, GDI objects
Make your program (process) don't quit, cycle through main process many times, the more the better, like 1000000 times or even an infinite loop, record the above numerical, it through at least one hour, as long as possible, such as a month, to record more than the value, if the above two groups of numerical differential is bigger or increasing over time, will certainly have a corresponding resources resource leaks!

Search "GDI leak detection"

CodePudding user response:

You put your vb application generated exe after use, turn off after using exe, and then see if the process of task manager closed the exe,

Possible 1: application of a serial port not closed End of the program, tried to add form_unload event to End

2: usb itself easily disturbed, surprises, we usually don't use usb and rs232 interface

CodePudding user response:

Difference to the stability of various turn U series chip recommended FT232,

CodePudding user response:

Unplug the scanning gun in normal work, if drawn not only pulled out from the serial port, USB system cannot know, that is to say, do not support the "plug and play", in this case let software can still be normal processing, to add additional testing and processing code,
  • Related