Recently Browsing 0 members
No registered users viewing this page.
I am trying to open a dll using DLLOpen, however everytime i try to do so the function fails and returns -1 result.
I have the dll in the same folder as the auto it script.
Local $hDLL = DllOpen("C:\Users\310255155\Downloads\COMMGvv2\commg.dll") DllCall($hDLL, "int", "MessageBox", "hwnd", 0, "str", "Some text", "str", "Some title", "int", 0) DllClose($hDLL) MsgBox(0,'result',$hDLL)
So I'm trying to send a string of data to Arduino using CommMG UDF. It seems that Arduino is not receiving it. I used Device Monitoring Studio and it shows that the data is sent fine and looks exactly the same as if I sent it from Arduino Serial Monitor. Is CommMG compatible with USB?
Global $CMPort = 9 Global $CmBoBaud = 9600 Global $sportSetError = '' Global $CmboDataBits = 8 Global $CmBoParity = "none" Global $CmBoStop = 1 Global $setflow = 2 _CommSetPort($CMPort, $sportSetError, $CmBoBaud, $CmboDataBits, $CmBoParity, $CmBoStop, $setflow) If @error Then MsgBox(16,"Error!","Can't connect to Arduino on port - "&$CMPort) Exit EndIf _CommSetRTS(0) _CommSetDTR(0) _CommSendString("x" & 128 & "y" & 256 & "e", 1)
Local $sAxName Local $oMSComm $sAxName = "MSCOMMLib.MSComm.1" $oMSComm = ObjCreate($sAxName) MsgBox(0, Default, StringFormat("Name: %s, Obj %d, Err %d", $sAxName, IsObj($oMSComm), @error)) I'm talking to serial ports (for Arduino) using the MSComm object. It all runs fine from SciTE or .exe. If I compile to .a3x the object is not created. I could manage without .a3x but I like it because it compiles faster.
Hello everyone, I usually use the include commMg.au3 to control the Arduino through some COM port via serial, in previous versions of Windows until version 8.1 works perfectly. Recently I updated my windows to version 10 and when I use this include no longer works and the error that appears is "Port does not exist." Someone is going through a similar situation? Please can help me solve?
This topic was solved, see >Post #15 for the codes and setup that worked for me.
I downloaded the COMMGvv2.zip & CommgExample.au3 From >this topic.
Ran the example GUI with default parametres, in the Send text field entered number 1 & pressed Send button. Sending 1 as char worked, the LED on my Arduino Leonardo board went on, then I sent 0 & led went off, just the way I programmed the board.
But I can not figure out how to make a custom code, a little help would be appreciated. Please.
my port: COM 25 baud: 9600 data bits: 8 stop bits: 1 parity: 1 flow control: 0 MY code so far: (consolewrite returns 0)
#include <GUIConstants.au3> #include 'CommMG.au3';or if you save the commMg.dll in the @scripdir use #include @SciptDir & '\commmg.dll' $iPort = 25 ; COM 25 $sErr = 'errormsg' $iBaud = 9600 $iBits = 8 $iPar = 0 $iStop = 1 $iFlow = 0 $RTSMode = 0 $DTRMode = 0 $resOpen = _CommSetPort($iPort, $sErr, $iBaud, $iBits, $iPar, $iStop, $iFlow, $RTSMode, $DTRMode) ConsoleWrite($resOpen & @LF) _CommSendstring('1')