Jump to content

Serial Port problem using COMMG64.DLL


Recommended Posts

I was looking for a way to directly interface some AutoIt scripts with a Serial Port and ran across this link from Martin who was gracious enough to share his COMMG64.DLL for the rest of us to use. 

I originally tried the 32 bit version, but because I am running Windows 10, it did not work.  Thank you Martin for your work on upgrading your tool to 64bit.  I have been able to work my way through understanding it and put it to some use.  Currently, I have been playing with it to try to communicate with a GPS unit I have.  In the past I have been using Putty to send commands to it, but I wanted to write a program that could automate some of the tasks.  The GPS has two Serial ports that I can interface with at the same time.  Both ports on the GPS are set up for 9600-8-N-1 for simplicity.  Those are also the default setting for the GPS when a break is sent to it.  I can set up two Putty sessions and talk to both ports and send commands from either port to have the output also show up on either port from the Putty terminals.

I used the CommMG Example.au3 program that was included in the above link and modified it to look for CommMG64.au3 instead of CommMG.  I used this program to listen to and send data that comes out of COM1 on my GPS as a test to learn how it works.  I am using Putty to send and receive data on COM2 on the GPS.  In the process of my testing I am finding some odd behavior.

If I send a command from Putty  to the GPS (on COM2) asking it to log my current position and send it to COM1, the CommMG Example screen (which is monitoring COM1) shows me gibberish.  However, when I send the same command using the CommMG Example to display that information on COM2, Putty shows that the command was successfully sent to the GPS and the correct data shows up.  I can also command CommMG Example to send the data back to same COM1 port it was issued from as a test.  The command appears to have been understood by the GPS, but the same gibberish is displayed in the CommMG Example dialog.

For some reason, I just decided to change the "No of Data Bits" in the CommMG Example program from 8 to 7 and repeated the steps above.  To my surprise, when I issued the command to log the data out on COM1 from Putty on COM2, the information shows up perfectly in the CommMG Example dialog box.  However, now when I used the CommMG Example to display the information back to COM1 or COM2, the GPS did not recognize the command and no data was displayed for either CommMG Example or Putty.

It is looking like the CommMG Example is not setting the Data Bits correctly on the receive side, but it is on the output side.  If this is the error, I am suspecting I it is in the COMMG64.dll which I can't get into to look around.

Is anyone else having an issue like this or does anyone know why I might be seeing this behavior?  Any help would be greatly appreciated as I think this will be a great tool for me if I can get it to show me the right data.

Again, a special thank you to Martin for your work on this tool.  It is amazing.  I've even been able to get the _SendBreak command to work with this GPS with some minor tweaking to match what the GPS was looking for.

 

Link to comment
Share on other sites

1 hour ago, Husker_Jason said:

I originally tried the 32 bit version, but because I am running Windows 10, it did not work.

You could have compiled your script in X86 mode, making use of the X86 version of the DLL.  What can't work is mixed mode: X86 program and X64 DLL or vice-versa.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

Your choice. Anyway since the X64 version of this DLL is now available, there is no issue.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

My apologies.  I misunderstood what you were suggesting.  I thought you were just reminding me to make sure I had compiled all the X64 versions in X64 mode.  I now see that you were recommending that I try to compile the X86 versions in X86 mode to see if that solved the issue.  I did go back and download the X86 versions and compiled them in X86 mode.  I had discounted this as a possibility in the past as I tried using the X86 versions and I always got errors.  I now realize that was because I was compiling it in X64 mode.  Thank you for the clarification.

However, even after I compiled the X86 versions, I am still having this same issue.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...