USB HID Logger

Trust In Confidence!

For Windows 2000 - Windows 11 (2022) (incl. Server, x86 and x64). Latest version: 1.9.9 build 417. April 17, 2024.


USB HID to MSSQL: Write several HID report items to separate columns

If you need to not only log the changes of the USB HID item values in the MSSQL database, but also analyze and process them after that, it will be more convenient to create a table where there will be a separate column for every item. This method can be applied if there are not many USB HID report items.


CREATE TABLE [dbo].[usb_data_2](
   [REC_ID] [int] IDENTITY(1,1) NOT NULL,
   [TIMESTAMP] [datetime] NULL,
   [ITEM1] [nchar](30) NULL,
   [ITEM2] [nchar](30) NULL
) ON [PRIMARY]

ITEM1 - will store the value of item 1;

ITEM2 - will store the value of item 2;

TIMESTAMP - will contain the date and time when the value was modified.

1. Create a new user in the database or give the permissions to write and read data from the created table to an existing user.

2. Create a new configuration and select necessary USB HID devices from a list. If your USB device is not plugged yet, connect it temporarily before creating the configuration (fig. 1).

usb-hid-to-mssql1-1

Fig. 1 Selecting a USB device

3. Select the following options:

usb-hid-to-mssql1-2

Fig. 2 Selecting a logging mode

4. Click OK. Data like that should appear in the main window of the program:

usb-hid-to-mssql2-3

Fig. 3 Data

Every line contains the value of all items and the additional "UPDATE_DATE_TIME" item with the timestamp.

Steps 5-7 are similar to those from the previous example "Write a lot of USB HID report items".

8. Binding (fig. 4) is slightly different from that in the previous example because the table contains a different set of columns.

usb-hid-to-mssql2-8

usb_data_2

DATE_TIME_STAMP

BUTTON_5

ROTATIONAL_Z_AXIS

Fig. 4 Configuring the data export plug-in. Binding.

Click "OK" to save the changes.

9. Check the status bar to make sure the data is being successfully processed (fig. 5).

usb-hid-to-mssql1-9

Fig. 5 A message about data being successfully written

Related articles:

Read more about:

USB HID Logger