Serial port comms using Mscomm

Does anyone have any experience I can leverage for using MScomm ActiveX component to access serial ports in FMX? I have been using the old CreateFile method but noticed that this now uses heaps of memory and CPU time as well as slowing down overnight. A friend was using my program to monitor hi Solar panel voltages logging (via an Arduino board) at once a second but this became once every 4 seconds overnight.

This link looks good: DELPHI+MSComm serial communication example free download source

Anyway, I have the MSComm activex library installed now and working well. This 3 minute video was excellent in learning how to import ActiveX controls and now there is a simple MsComm component on the pallette.

I was hoping to use this with FMX but when switching to FMX, the component disappears and a quick search reveals it is only compatible with VCL.

I am pretty sure it’s not a visual control, so I imagine you could just instantiate it at runtime, hookup any event handlers and and use it. (windows only)

There is also the asyncpro package via turbopack in getit, You may be able to use the nonvisual stuff from this a bit, also windows only. seem to have an array of comport stuff.

Thanks for the reply Roger.

Yes the Mscomm component is non-visual. Super easy to use - just try MsComm1.Output := ‘string of data’ and Result := MsComm1.input to read. I was hoping to use this for FMX.

I did see the Asyncpro package in getit but it didn’t seem to load for some reason.

I have tried and purchased Winsoft for Mac osx a few years ago and it works extremely well. A bit pricey at $90 or whatever and there are frequent upgrades.

Looks like I will have to do some rewriting in VCL. VCL is so much easier than FMX that it shouldn’t be a hard task. Also, with Mscomm the cpu usage drops to 0% and memory is quite low.