Jump to content

Can I/How to read and log data from a USB port?


gte
 Share

Recommended Posts

I have an application for an oscilloscope that does not log data, only displays it real time.

I'd like to build something that logs data, from a piece of hardware (oscilloscope) that uses the usb interface, to a text file.

Is this possible with autoit?

The original application appears to be compiled with Delphi, and I'm not sure how to decompile it or what I would look for once it was decompiled, to find what protocols it is using to receive this data.

Any thoughts/help would be greatly appreciated.

[edit, after reading my title, before any asks this is not for a key logger! I can post the original application and pictures of the hardware if accusations start coming as to key logger stuff]

Edited by gte
Link to comment
Share on other sites

No one has ever done this?

Your request is a bit vague. Do you know anything about how the USB interface on the oscilliscope behaves? Does it need a special driver, does it act like a serial port if you use a USB to SRS232 driver for example. Have you tried to get any information from the manufacterers?

Maybe there is a dll available which handles the USB for the scope and then you could use the dll in AutoIt. Decompiling a Delphi application to find the protocol sounds very optimistic to me.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Hi Martin,

I believe that is what it is doing, in the device manager it shows up as usb serial device. Maybe you can help point me in the right direction?

Here is the driver it uses

http://www.ftdichip.com/Drivers/CDM/CDM%202.04.16%20WHQL%20Certified.zip

It also had this page, that looked like it was for development, but I couldn't make heads or tails of it

http://www.ftdichip.com/Documents/AppNotes.htm

Posted Image

Your request is a bit vague. Do you know anything about how the USB interface on the oscilliscope behaves? Does it need a special driver, does it act like a serial port if you use a USB to SRS232 driver for example. Have you tried to get any information from the manufacterers?

Maybe there is a dll available which handles the USB for the scope and then you could use the dll in AutoIt. Decompiling a Delphi application to find the protocol sounds very optimistic to me.

Link to comment
Share on other sites

In that case all you need to do is communicate with COM6. You will need to find the baud rate, number of data bits, stop bits and parity although some experimenting might find the values. Much more difficult is the communication because you need to know what is expected and that could be simple and it could be quite unpleasant.

There is a serial port UDF in my signature but without knowing how to communicate with the oscilloscope it won't be much use. You need some literature from the manufacturers if it's available. If that is difficult then google for the scope model and words like protocol.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I googled FTDI chip protocol and got this

http://74.125.113.132/search?q=cache:gydUd-At-aYJ:www.ftdichip.com/Projects/MPSSE.htm+ftdi+chip+protocol&cd=1&hl=en&ct=clnk&gl=us

or

http://www.ftdichip.com/Resources/Utilities.htm

or

http://www.ftdichip.com/Projects/FTDIChip-ID.htm

or

http://www.ftdichip.com/Projects/CodeExamples/VC++.htm

It sounds like they are pretty open about projects with their drivers? Can you skim it and tell me what you think? I'm new to this, and a little unsure as to what I'm reading.

I'm going to email them too.

In that case all you need to do is communicate with COM6. You will need to find the baud rate, number of data bits, stop bits and parity although some experimenting might find the values. Much more difficult is the communication because you need to know what is expected and that could be simple and it could be quite unpleasant.

There is a serial port UDF in my signature but without knowing how to communicate with the oscilloscope it won't be much use. You need some literature from the manufacturers if it's available. If that is difficult then google for the scope model and words like protocol.

Edited by gte
Link to comment
Share on other sites

Martin,

Here is what the company referred me to. Is this enough information?

http://www.ftdichip.com/Products/FT232R.htm

http://www.ftdichip.com/Drivers/D2XX.htm

It looks like all those links are to do with the chips used to create a USB interface for the scope. It doesn't tell you anything about how to communicate with the scope or how to get information from it. It could be I'm wrong but that's how I see it. I think you need to get information on how to communicate with the scope from the scope manufacturers not the suppliers of the components they use.

I think it is worth trying to get as much information from the scope manufacturers as you can, and if possible some program examples which you could translate to AutoIt. Otherwise you are on your own looking at a highly specialized programming project which will be difficult to get help with and is best taken on by a very experienced and knowledgable programmer. (Not me :))

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

If it's over your head, it's way over my head.

Unfortunately, I'm not even sure which information I should be asking the company for, I guess I'll just have to digress on this. :)

It looks like all those links are to do with the chips used to create a USB interface for the scope. It doesn't tell you anything about how to communicate with the scope or how to get information from it. It could be I'm wrong but that's how I see it. I think you need to get information on how to communicate with the scope from the scope manufacturers not the suppliers of the components they use.

I think it is worth trying to get as much information from the scope manufacturers as you can, and if possible some program examples which you could translate to AutoIt. Otherwise you are on your own looking at a highly specialized programming project which will be difficult to get help with and is best taken on by a very experienced and knowledgable programmer. (Not me :))

Link to comment
Share on other sites

There is an offical FTDI .Net dll to direct communicate with FTDI chip. I have done it in VB.Net before without going through the virtual COM. But then you stll need to know the proprietary protocol of every command bit by the scope manufacturer. Then you can interpret the meaning of every incoming bit.

Some Scope Manufacturer may not be willing to share this info as they afraid ppl will tap into their FW. So you may need to buy the offical SDK for the scope.Posted Image

Link to comment
Share on other sites

The problem is that they had a 3rd party person 1/2 ass the software, and so the scope manufacturer has no idea what is what.

Do you think there is a software developer kit for this?

There is an offical FTDI .Net dll to direct communicate with FTDI chip. I have done it in VB.Net before without going through the virtual COM. But then you stll need to know the proprietary protocol of every command bit by the scope manufacturer. Then you can interpret the meaning of every incoming bit.

Some Scope Manufacturer may not be willing to share this info as they afraid ppl will tap into their FW. So you may need to buy the offical SDK for the scope.Posted Image

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...