I know that this theme was discussed several times but I read all These threats with no helping result.
I have two pieces of TEMPer1F USB Thermometer.
It is a Standard Windows HID device with no add. Driver needed.
With the device I got an App reading from it and showing Graphs and much more and which can handle several devices.
With the Software came also a RDingUSB.dll file handling the communication with the device.
I can call the dll without any error. But the Problem is how to Access the device using the DLL and Access more than one of same VID/PID
by Serial or anything else useful.
I have also sources in c# doing the Job, but no experience in C# to successfuly port it to AutoIT.
So my question: Can anyone help me to realize the simple pull of the temperature value from the devices based on C# source?
The rest to write it to MySQL DB and repeat it etc. is no Problem for me.
The C# part with the DLL functions class:
internal class RDing
public static extern IntPtr OpenUSBDevice(int VID, int PID);
public static extern IntPtr CloseUSBDevice(IntPtr hDevice);
public static extern bool WriteUSB(IntPtr hDevice, byte pBuffer, uint dwBytesToWrite, ref ulong lpNumberOfBytesWritten);
public static extern bool ReadUSB(IntPtr hDevice, byte pBuffer, uint dwBytesToRead, ref ulong lpNumberOfBytesRead);
public static extern ushort GetInputLength(IntPtr hDevice);
public static extern ushort GetOutputLength(IntPtr hDevice);
public static extern uint GetErrorMsg(ref string lpErrorMsg, uint dwErrorMsgSize);
The C# code snippet working with the functions of the class above is in the attachment
this is the interesting part where the data is sent and pulled which I
do not understand to transcode to AutoIT
Important my devices are the type2 (TEMPer1F) :
So in the end I Need: Call DLL, read all devices in array
Loop the Array until ubound(Array) and for each device in Array read the temperature value and prepare the data to
decimal 6,1 (SQL Format) and °C
So how to pull the value from the devices?
Maybe somwbody finds the important part in the C# (the code above is for different models, mine is TEMPer1F
Or maybe someone has solved this and has maybe a uDF for this
Needed a way to store global temporary & permanent information and came up with this.
This is inspired by NodeJS's store and store2 packages, as well as W3 specs' localStorage and sessionStorage, offering multiple ways of usage.
This is not related to any browser's storage, nor will allow you to access or modify browsers storage - although this is possible and not a hard task, this is not what this UDF is intended to do.
This UDF offers functions for temporary storage (that gets cleaned up once the application is shutdown) that is kept on memory using ScriptingDictionary, as well as for permanent storage, that is saved on the harddisk as an encrypted file.
sessionStorage (temporary storage)
It's useful to keep application state and temporary settings accessible by any part of your script (although it could also be done with a global variable, I still prefer this method).
You have multiple ways, at your choice, to:
; add or modify a key sessionStorage("foo", "bar") store("foo", "bar") sessionStorage_set("foo", "bar") sessionStorage_setItem("foo", "bar") ; read a key (returns false if key does not exist) $read = sessionStorage("foo") $read = store("foo") $read = sessionStorage_get("foo") $read = sessionStorage_getItem("foo") ; delete a key sessionStorage_remove("foo") ; delete all keys sessionStorage_clear() sessionStorage_clearAll() localStorage (permanent storage)
It's useful to store user-defined settings.
; initialize ; this is optional, but allows you to control ; how things are going to be saved localStorage_startup([file where you want the settings to be saved], [crypt password]) ; by default, if not supplied, if supplied the "Default" keyword (or if you dont initialize), ; the file will be a random-named file (based on @ScriptFullPath) at user's %APPDATA% ; and the password will also be based on @ScriptFullPath ; you can set only the crypt password if you want: ; localStorage_startup(Default, "mypassword") ; the usage is the same as sessionStorage ; add or modify a key localStorage("foo", "bar") store2("foo", "bar") ; notice the '2' localStorage_set("foo", "bar") localStorage_setItem("foo", "bar") ; read a key (returns false if key does not exist) $read = localStorage("foo") $read = store2("foo") $read = localStorage_get("foo") $read = localStorage_getItem("foo") ; delete a key localStorage_remove("foo") ; delete all keys localStorage_clear() localStorage_clearAll() Download
in need the path/text present int above shown input box to be copied or retrieved into a variable .. how can i do that?
I'm working on a little project, and I was wondering if there's a way ( sure there is ) to insert data to a ComboBox control everytime the user insert some text in the ComboBox which is not in the ComboBox data. I'll try to explain with an example:
- Form with some data ( ComboBox is empty );
- User prompt something in the ComboBox: if what the user prompts is not in the ComboBox values ( at the moment empty ), then insert the value in the ComboBox values, in order to have, next time the user prompts the form, the value that he entered.
More pratical example:
- First call of the form, ComboBox empty;
- I prompt "A" in the ComboBox;
- Second call, in the ComboBox I should see "A";
- I prompt "B" in the ComboBox;
- Third call, I should see "A"
- And so on...
Everytime the form is called, I re-create it, so I think I can't use _GUICtrlComboBox_AddStrings().
I tried with
Global $strCboStrings = "" ; When the user prompt the form, the code below is executed. ; I.E. : User prompt "A", after the if I should have "A"; ; In the second call, If I write "B", I should see "A" ; "B"; ; If I write "A" again, in the combobox values should not be any changes. If Not StringInStr($strCboStrings, GUICtrlRead($cboVoiceCategory)) <> 0 Then $strCboStrings &= $strCboStrings & "|" & GUICtrlRead($cboVoiceCategory) EndIf Any suggestion?
Good morning community!
I am working on a script which read from a text file ( .txt ) and should import all the content in a SQLite3 DB, in order to execute some queries that should be difficult to execute on a text file.
So, I was looking for something very very fast, because the file could be very large ( I don't know exaclty how much can became big, but I know a lot of rows, it's a log file ... )
I found the "Import method", but I don't know If I can implement it in a query ( @jchd, it's your turn! )
Do you know some methods that I can implement in my script to have a very very fast import of thousands and thousands rows in a SQLite3 DB?
Thanks a lot