
brunomusw
Active Members-
Posts
35 -
Joined
-
Last visited
Everything posted by brunomusw
-
Sorry Ascend4nt's, that's what I was looking for, is like the Martin's code. Create an Struct for signed and unsigned to receive the values from the DLL. But why the DLLCall didn't work? $ret = DllCall($dll, "byte", "ReadByteComP") $ret = DllCall($dll, "ubyte", "ReadByteComP") Regards, Brunomusw
-
Thanks Martin, it´s worked. But, why using the DllCall didn´t work? Regards, Brunomusw
-
That's what I mean, your code is another solution, but the on the sameway that doing calculus it's a trick. Actually We did it on the DLL, and just to add we found some bug over there. If $sign = 0 Then ;unsigned $ret = DllCall($dll, "byte", "ReadByteComP") ElseIf $sign = 1 Then ;signed $ret = DllCall($dll, "int", "ReadByteComP") EndIf Using the ubyte and byte both are giving unsigned byte. How to report it? Regards, Brunomusw
-
Thanks guys... But I the way that I see is by calculus. Once the computer uses 2´s complements and I´m receving a byte, when I want that it be an unsigned I will need to + 256. func() returns -100. Reading it as unsigned it will be = -100 + 256 = 156. Regards, Brunomusw
-
Thanks Brett, I´ve read this already and it not help. Let´s example this. I have a return value from a function, that´s a signed char, but sometimes I need to interpret it as unsigned char. Reading "Language Reference" there is no way to do it. Regards, Brunomusw
-
I´m using a DLL and Autoit Library (I create the library, BB) that acess this DLL and on my program a receive a signed variable from the BB library, but sometimes I want use this value as signed or unsigned, how I declare a unsigned variable on Autoit? Regards, Brunomusw
-
The autoit function. Func ConfigRTSDTR( $rts,$dtr ) $dll = DllOpen("SerialFuncs.dll") $ret = DllCall("SerialFuncs.dll", "int", "ConfigRTSDTR","dword",$rts,"dword",$dtr) EndFunc Brunomusw
-
Richard, It worked with the _stdcall and the function stay like I said: CODE__declspec(dllexport) int _stdcall SF_Beep(DWORD par1, DWORD par2);regards, Brunomusw
-
Richard thanks for the ideia, it didn't work but I could find the way. The cdecl didn't work because I was calling a function on Win32 so I use the _stdcall. So the call function on C stays: __declspec(dllexport) int _stdcall SF_Beep(DWORD par1, DWORD par2); Thanks... Brunomusw
-
Hi... I create a DLL in C, on my DLL I'm acessing the windows DLL. I'm having problem when I pass a parameter to the DLL's function, the functions executes but after finished, the Autoit crashes. But when I execute the same function without passing parameters (the parameters are already on the DLL) the Autoit runs ok. Any thoughts? Brunomusw
-
Martin, any news about the library??? best regards, brunomusw
- 680 replies
-
- serial port
- virtual port
-
(and 2 more)
Tagged with:
-
Just a function for set RTS and DTS let it better... Talking about it, is it hard to read the DCD, DST and CTS? Is it possible with Tx and Rx? Thanks Martin... I'll way for your answer... Brunomusw
- 680 replies
-
- serial port
- virtual port
-
(and 2 more)
Tagged with:
-
Martin, I tested your new functions and I couldn´t control the RTS and DTR pins. When flowcontrol = 0 (flowcontrol on) it doesn´t matter if RTS and DTR are 0 or 1 or 2 or 3, both changed to 1 to 0 logics and stayed on 0, but when I turn the flowcontrol = 2 (flowcontrol off) both goes to 1. Soo both are changing the logic levels on the same time and It couldn´t stay on diferents logics levels. One thing, on your CommMG2_5.au3 on the _CommSetPort you include the Commg.dll and not the new one. I did It but still have the same problems. Could I separete the _CommSetPort function just to control the RTS and DTR pins? Change the dll?? regards, Brunomusw
- 680 replies
-
- serial port
- virtual port
-
(and 2 more)
Tagged with:
-
Thanks Martin... In some days I'll try it and we came back to talk... The site that I downloaded the file is a server that you did with autoit? Martin's Autoit Downloader. Regards, Brunomusw
- 680 replies
-
- serial port
- virtual port
-
(and 2 more)
Tagged with:
-
That's it, now it's working without the needed of the commg.dll be on the same paste that the script. Martin, one question, how could I control a pin on the serial port? I mean like control the pin 7 (request to send), toggle it. regards, Brunomusw
- 680 replies
-
- serial port
- virtual port
-
(and 2 more)
Tagged with:
-
Heyyy... I update my Autoit to the last version and when i run the the CommgExample I need to put more libraries to it work. Now I´m getting a problem with a script that is working in a computer that is next to me but in mine it doesn´t work... The problem is with this part of the code $portnumb = _CommListPorts(0) If @error = 1 Then MsgBox(0,'trouble getting portlist','Program will terminate!') Exit EndIf For $pl = 1 To $portnumb[0] GUICtrlSetData($Port,$portnumb[$pl]) Next GUICtrlSetData($Port,$portnumb[1]) WinActivate($janelac)I'm getting this error: ==> Subscript used with non-Array variable.: For $pl = 1 To $portnumb[0] For $pl = 1 To $portnumb^ ERROR Some tip??? Brunomusw
- 680 replies
-
- serial port
- virtual port
-
(and 2 more)
Tagged with:
-
Thanks... I will try it and let you know the result... thanks... Bruno
-
Thanks... But i'm thinking to try on my on... May be something that detects the mouses events and always come back to the MsgBox window to type the password... Or always stay focus on the MsgBox window, couldn't ? Bruno
-
Hi to everyone... Some could give some tip where i could begin to write something that works like this: I want that a MsgBox appear on the window and the computer stay block on it, it's only get out when type the right password.. But when this MsgBox is open, others program could run on back-ground, like block your computer but you're passing a anti-virus scan. Hope that some could give some tip... Thanks.. Bruno
-
Martin it works, i need to make some changes on the code. I use some part of your code. The final code: Func SendEvent();send the text in the inputand append CR dim $recbuf[3],$macadress[4],$i,$x,$y = 0 For $x = 52 to 55 _CommSendByte(255) _CommSendByte(2) _CommSendByte(254) _CommSendByte($x) For $i = 0 To 2 If _CommGetInputCount() = '0' Then Sleep(300) If _CommGetInputCount() = '0' Then MsgBox(0, 'ERROR ', 'No data after 300mS') Exit EndIf Else ;either an error or data available If @error = 1 Then MsgBox(0, 'Error', 'Failed to call _CommGetInputCount') Exit EndIf EndIf $recbuf[$i] = _CommReadByte(0) Next If $recbuf[0] = 6 Then $macadress[$y] = Hex($recbuf[2],2) $y = $y + 1 EndIf Next If @error <> 0 Or $recbuf[0] = -1 Then MsgBox(0, 'Resultado', 'Erro') Else MsgBox(0, 'Resultado', 'Ok') $received = _ArrayToString ($macadress," ") GUICtrlSetData ($valor,$received) EndIf EndFunc Taking out the _CommGetInputCount it needs to run two times to get the right values. Thanks. Bruno
- 680 replies
-
- serial port
- virtual port
-
(and 2 more)
Tagged with:
-
Martin, i will try it... Now i'm traveling... But when i came back i will make some tests and let you now... Thanks.. Bruno
- 680 replies
-
- serial port
- virtual port
-
(and 2 more)
Tagged with:
-
Hi martin... Now i'm working on the bytes functions of you UDF... I don't know what is happen, if i'm doing something wrong or is the function... dim $recbuf[3], $i _CommSendByte(255) _CommSendByte(2) _CommSendByte(254) _CommSendByte(52) For $i = 0 To 2 $recbuf[$i] = _CommReadByte(0) Next ;$recbuf = _CommReadByteArray(1,3,0) ; le os 3 bytes If @error <> 0 Or $recbuf[0] = -1 Then MsgBox(0, 'Resultado', 'Erro') Else MsgBox(0, 'Resultado', 'Ok') $received = _ArrayToString ($recbuf," ") ;MsgBox(0, 'Resultado', $re) GUICtrlSetData ($valor,$received) EndIf The problem is that only in second time that this run that the _CommReadByte works, on the first time that this code run it gets @erros = 1 and run the MsgBox(0, 'Resultado', 'Erro') and the second, third... it runs ok... My mistake?? Thanks. Bruno
- 680 replies
-
- serial port
- virtual port
-
(and 2 more)
Tagged with:
-
Use DllCall or translate code?
brunomusw replied to brunomusw's topic in AutoIt General Help and Support
Thanks.... I miss other thing in the other post... Bruno -
Use DllCall or translate code?
brunomusw replied to brunomusw's topic in AutoIt General Help and Support
You mean to use this archive from VB? http://www.ftdichip.com/Projects/CodeExamp...D2XX_Module.zip Isn't easier to declare the functions direct using the DllCall like Nwfu said on this topic ? http://www.autoitscript.com/forum/index.ph...=28112&st=0 Thnaks... Bruno -
Hi.. I have a chip that is an USB to Serial converter, but it has a dll that i can program the chip for direct acess the chip's I/O. The problem is that i don't know how to get start with this, i don't know if i acess direct the dll using the DllCall or if i translate the VB or Delphi code to autoit (how i already saw some topics about this)... Here are the description of the Dll (driver). http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf And here are the examples code for VB or Delphi... http://www.ftdichip.com/Projects/CodeExamples.htm I think using the DllCall and create functions like Nwfu put on this topic: http://www.autoitscript.com/forum/index.ph...=28112&st=0 Could be a good choice, could be like this? I hope you could give me some tip to start... Thanks... Bruno