Page 1 of 1

Closing com port

Posted: Mon Mar 24, 2014 9:02 pm
by carel
I'll try to keep this as short as possible:

I was at a guy that does engraving today - his engraving machine's LAN port got damaged by lightning, but I could help him set it up via a serial port, but the program he use is flawed (it works perfectly through the LAN port).

He first reads dimensions from the engraving machine, and then starts the engraving process, but after reading the dimensions the program does not release the com port, and when you want to start the engraving process it says "com port in use" - You then have to save the design, exit the program, go back in, look up the file you just saved and then when you start the engraving process it works.

Is there any way to write a little program that calls a Windows routine to close the port? - I know this is not a truly Livecode question, but I know you all are clever on here, and if possible I would like to code it in Livecode.

I found this on a VB forum:

use the mscomm32.ocx
mscomm1.portopen = false

Thanks,

Carel