Jump to content

Multiple USB Devices - GUI


Recommended Posts

For a model railway project only.  Using multiple  rfid readers. These readers have no PID or VID or serial numbers.
Only difference is the hub/port number allocated.

Using Win7  32 bit.

The only information I need to obtain from the HID devices is:

hub/port number
last string transmitted.  (14 character string of the rfid tag number)
timestamp of the latest reading.

The tag data will be moved to excel immediately after received by usb ready for the next read.  Timestamp and data would be overwritten by next set of data.

the GUI would have single line for each reader (by hub/port #) with 3 headings.  Timestamp, 14 character data, and hub/port # .

Is it possible for Autoitscript to have a GUI to do this ?

Thankyou

Charles Harris
 

Link to comment
Share on other sites

Where is this data being read to currently, Excel?

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

A listview control will suit your GUI needs nicely.    Interacting with the GUI will be the fun/challenge part. ;)
 

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>

Example()

Func Example()
    GUICreate("listview items", 300, 170, 100, 200, -1, $WS_EX_ACCEPTFILES)
    GUISetBkColor(0x00E0FFFF) ; will change background color

    Local $idListview = GUICtrlCreateListView("Timestamp|Data|Hub/Port#  ", 10, 10, 280, 150) ;,$LVS_SORTDESCENDING)
    Local $idItem1 = GUICtrlCreateListViewItem("Timestamp|0123456789ABCD|0/0", $idListview)

    GUISetState(@SW_SHOW)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd
EndFunc   ;==>Example

You could also use an Edit control to create a console-like operation.
 

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>
#include <GuiEdit.au3>


GUICreate("listview items", 300, 170, 100, 200, -1, $WS_EX_ACCEPTFILES)
GUISetBkColor(0x00E0FFFF) ; will change background color

Local $idEdit = GUICtrlCreateEdit("Timestamp | RFID TAG Data | Hub/Port#" & @CRLF, 10, 10, 280, 150, BitOr($ES_READONLY, $WS_VSCROLL))

GUISetState(@SW_SHOW)
AdlibRegister("_UpdateConsole",1000)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            AdlibUnRegister("_UpdateConsole")
            ExitLoop
    EndSwitch
WEnd

Func _UpdateConsole()
    _GUICtrlEdit_AppendText($idEdit, "Newest timestamp | 0123456789ABCD | 0/0" & @CRLF)
EndFunc

Depends on what you are looking for.  I assume you want a list of all of the RFID reader and the last TAG they read.  If that is the case I think a listview would work just fine.

Edited by spudw2k
Link to comment
Share on other sites

Hi

Thanks for quick responses.

 

Yes, they currently read into Excel.    Can the list view be set up in Excel ?

Yes,    "a list of all of the RFID reader and the last TAG they read"   is correct.

 

I will use the code above and get it working and get back to the forum in a day or two and let you know how it goes.

 

Any thoughts of using Excel for the list view ?

 

Thanks

 

Charles

 

 

Link to comment
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
 Share

×
×
  • Create New...