Sign in to follow this  
Followers 0
andybiochem

Problems calling func with DllCall

3 posts in this topic

Hi,

I'm trying to call functions from a dll using dllcall. I have zero experience with dlls and after maybe 3 hours trying this, I'm close to giving up!!

This is the dll I'm trying to use.

The function is supposed to find usb thermometer devices, and return temperature readings.

so far i've got:

$TEMPer = DllCall("TEMPer.Communication.dll","str","FindDevices")
ConsoleWrite(@error & @CRLF)
ConsoleWrite($TEMPer & @CRLF)

but I keep getting @error = 3 , meaning the function doesn't exist in the dll.

I have tried numerous different names, but always get the same error.

I assume i'm making a complete hash of it, can someone point me in the right direction?

cheers


- Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!

Share this post


Link to post
Share on other sites



Hi,

I'm trying to call functions from a dll using dllcall. I have zero experience with dlls and after maybe 3 hours trying this, I'm close to giving up!!

This is the dll I'm trying to use.

The function is supposed to find usb thermometer devices, and return temperature readings.

so far i've got:

$TEMPer = DllCall("TEMPer.Communication.dll","str","FindDevices")
ConsoleWrite(@error & @CRLF)
ConsoleWrite($TEMPer & @CRLF)

but I keep getting @error = 3 , meaning the function doesn't exist in the dll.

I have tried numerous different names, but always get the same error.

I assume i'm making a complete hash of it, can someone point me in the right direction?

cheers

It looks like the dll is used to make a virtual com port to the usb interface for the thermocouple. The function you are trying to call is in the VB code which is just functions to communicate with the serial port. You need to get details of the dll from the suppliers, then when you have run that you should see a new COM port in device manager which you could communicate with using Hyperterminal, (or my udf for serial ports maybe), but you need more information first.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

I'm trying to call functions from a dll using dllcall. I have zero experience with dlls and after maybe 3 hours trying this, I'm close to giving up!!

This is the dll I'm trying to use.

The function is supposed to find usb thermometer devices, and return temperature readings.

so far i've got:

$TEMPer = DllCall("TEMPer.Communication.dll","str","FindDevices")
ConsoleWrite(@error & @CRLF)
ConsoleWrite($TEMPer & @CRLF)

This is a .NET dll. You just can't call it from AutoIt using DllCall.

If I were you, I'd download the source code and simply mimic what's done there into what's available in AutoIt, using Martin's COMM support for serial low-level.

From what I've seen in a quick look, is that they communicate with their I2C devices using a standard PC serial port.

For an accurate translation into AutoIt you may have to gather precise information about the source language, but it looks fairly straightforward.

Don't forget to turn this into a generic I2C UDF once fully working, for the rest of us to suck your work without any shame! :D


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)

Share this post


Link to post
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
Sign in to follow this  
Followers 0