sswcharlie

Multiple USB Devices - GUI

5 posts in this topic

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
 

Share this post


Link to post
Share on other sites



Where is this data being read to currently, Excel?


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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
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

 

 

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

  • Similar Content

    • FrancescoDiMuro
      By FrancescoDiMuro
      Good morning
      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"
                                                 "B";
      - 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?
      Thanks
    • FrancescoDiMuro
      By FrancescoDiMuro
      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
      Francesco
    • bdenn
      By bdenn
      Hello,
      I have searched and searched the web for an answer on how to get data from a webpage and paste it into a notepad document.
      The problem is I need to access a website that is not on the internet but yet only on our local network so the IP will be "192.168.125.xxx"
      This site only displays a few things but what I need to do is pull two parts of information that are located in a table. looking at this as an excel point of view this would be cells B2 and C2. These cells hold two numbers that say 850 Watts and 3 Watts, but they change all the time.
      If I do a page "inspect element" I can see these exact numbers in the source code but very deep.
      Currently I have the following code:
      run ("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe")         sleep(500)         Send("192.168.125.xxx")         Send("{Enter}")         sleep(100)         Send("password")         Send("{Enter}") How do I get AutoIT to see these two data points and copy and paste them into a notepad.
      I do not really need the webpage to open, but will deal with it if I need to.
      ** I have attached an image of the data I need.
      Thanks,
      Bdenn

    • tommytx
      By tommytx
      Help autoit has lost its mind and the screen is so wide i cannot see my borders.. so no access to minimize or X or - or anything..Seems ok otherwise and its just thee autoit window  as atje rest of my windows work fine..
       
    • MattG1991
      By MattG1991
      Hello all, 
      I've written a script that pulls info from some web pages, saves the results to variables, and prints it out to a Word document. I've tried to make this script work with a minimum of user interaction. I've noticed an issue happens when I run the script and I have another window set as active, like SciTE for example. It inserts an "ETX" character. I've done this with Notepad too. It displays an upside down L character. Any particular reason why? Unfortunately, I can't post any code. Basically, it gets a collection of tags, applies a test to find the values I want, then pulls the innerhtml from said tag. Then it assigns the results to a global variable.  Any help would be appreciated.