Jump to content

makeithere

Members
  • Posts

    5
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

makeithere's Achievements

Seeker

Seeker (1/7)

2

Reputation

  1. I know this question was asked many, many years ago. But after recent frustration in dealing with this box, here is the script I wrote to communicate with the Ontrak ADU200. Just copy AduHid.dll to the same folder and run. ;Tested with ONTRAK ADU200 Global $DisplayMsgBox='' ;global $DisplayMsgBox='1' Global $dll = DllOpen( "AduHid.DLL" ) Global $iHandle=0 _TestAduDevice() Func _TestAduDevice() $iHandle=_OpenAduDevice(1) ConsoleWrite(Number($iHandle)&@CRLF) if @error then ConsoleWrite('','','failed open'&@CRLF) _WriteAduDevice($iHandle,'SK0',0,500) sleep(500) _WriteAduDevice($iHandle,'RK0',0,500) _WriteAduDevice($iHandle,'SPK1011',0,500) ;Binary Output Relay Set 1011 _WriteAduDevice($iHandle,'RPK',0,500) ; Read Relay Bits $ret=(_ReadAduDevice($iHandle,'RPK',0,500)) ConsoleWrite('Relay Binary Bits Set to: '&($ret)&@CRLF) sleep(500) ;_WriteAduDevice($iHandle,'RC0',0,500) ; Clear Switch 0 Counter ; sleep(1000) _WriteAduDevice($iHandle,'RPA',0,500) ; Read input Switch Bits $ret=(_ReadAduDevice($iHandle,'RPA',0,500)) ConsoleWrite('Input Switch Bits Set to: '&($ret)&@CRLF) sleep(500) _WriteAduDevice($iHandle,'RE0',0,500) ; Read Switch 0 Count $ret=(_ReadAduDevice($iHandle,'RE0',0,500)) ConsoleWrite(Number($ret)&@CRLF) _WriteAduDevice($iHandle,'DB2',0,500) ; Set Debounce to 100ms _WriteAduDevice($iHandle,'DB',0,500) ; Read Debounce setting $ret=(_ReadAduDevice($iHandle,'DB',0,500)) ConsoleWrite('Debounce Set to: '&($ret)&@CRLF) _WriteAduDevice($iHandle,'WD3',0,500) ; Set Watchdog Timeout to 1min _WriteAduDevice($iHandle,'WD',0,500) ; Read Watchdog Timeout setting $ret=(_ReadAduDevice($iHandle,'WD',0,500)) ConsoleWrite('Watchdog Timeout Set to: '&($ret)&@CRLF) _WriteAduDevice($iHandle,'WD0',0,500) ; Set Watchdog Timeout OFF _CloseAduDevice($iHandle) DllClose( $dll ) EndFunc Func _OpenAduDevice($aduHandle) Local $ret $ret = DllCall( $dll, 'long','OpenAduDevice','long', 500 ) if @error then ConsoleWrite('failed open'&@CRLF) If $DisplayMsgBox <> "" Then MsgBox(0,"_GetLastErrorMessage",$DisplayMsgBox & @CRLF & $ret[0]) return $ret[0] EndFunc Func _CloseAduDevice($aduHandle) Local $ret $ret = DllCall( $dll, 'long','CloseAduDevice','long', $aduHandle ) if @error then ConsoleWrite('failed close'&@CRLF) If $DisplayMsgBox <> "" Then MsgBox(0,"_GetLastErrorMessage",$DisplayMsgBox & @CRLF & $ret[0]) return $ret[0] EndFunc Func _WriteAduDevice($aduHandle,$lpBuffer,$lBytesWritten,$iTimeout) Local $ret $lNumberOfBytesToWrite=StringLen($lpBuffer) $ret = DllCall( $dll, 'long','WriteAduDevice','long', $aduHandle, 'str',$lpBuffer, 'long',$lNumberOfBytesToWrite, 'long', $lBytesWritten, 'long', $iTimeout ) if @error then ConsoleWrite('failed write'&@CRLF) If $DisplayMsgBox <> "" Then MsgBox(0,"_GetLastErrorMessage",$DisplayMsgBox & @CRLF & $ret[0]) return $ret[0] EndFunc Func _ReadAduDevice($aduHandle,$sResponse,$iBytesRead,$iTimeout) Local $ret $ret = DllCall( $dll, 'long','ReadAduDevice','long', $aduHandle, 'str',$sResponse,'str',7, 'long',$iBytesRead, 'long', $iTimeout ) if @error then ConsoleWrite('failed read'&@CRLF) If $DisplayMsgBox <> "" Then MsgBox(0,"_GetLastErrorMessage",$DisplayMsgBox & @CRLF & $ret[0]) return $ret[2] EndFunc
  2. Here's a document management software. It's like having indexDocument Management System.zip cards for company documents.
  3. Saves the whole screen or specified area to png or jpg by pressing Alt-Shift-p or Alt-Shift-j. if no folder is specified saves to My Documents. If no size is specified saves the whole screen. screenshots_on_hotkey_specify.au3
  4. DICOM_SEARCHSAVE.au3
  5. Here is one quick DICOM image reading folder opening folder reading software. Because of the endian the tags are reversed. If images are not in a subfolder, that is opened instead of the folder. The idea is to convert the binary parts to hex, and use regex to search and replace. There is probably a better way to do this, but this has worked for me, hope this helps
×
×
  • Create New...