Usb Data Collection


DetW

Recommended Posts

Hi all,

 

I have a piece of machinery which sends process data through a USB port, and I would like to collect this data to DAQFactory and use it in my process monitoring application.

The machine-mounted USB port would normally just send the data to a printer.

I use serial-to-ethernet converters on other machines that just have standard Serial connections, but I don't know how to achieve the same result through a USB port printer connection.

Link to comment
Share on other sites

It is an Engel plastic injection moulding machine. The machine collects cyclic process data such as timers, pressures and positions that occur during the plastic moulding cycle and prints the data out at the end of each cycle.

You can just plug in any standard printer into the USB printer port and the data prints out each cycle.

Rather than outputting to the printer I want to capture and parse the data using DaqFactory.

I already do this with other older moulding equipment that have RS232 printer ports instead of USB printer ports, using Serial-to-Ethernet converters (BlueHeats from Connect Tech) and DaqFactory.

Link to comment
Share on other sites

I don't think you can do it, any more than you can take a normal USB cable and string it between two computers and expect them to be able to communicate.  I believe USB requires a Master / Slave relationship, and the printer is a slave.  The PC is a master, and so is your moulding machine, and the two masters can't talk to each other.  They may be a way to make it work but it would require some specialized software.  This is actually one of many reasons I don't like USB: in most cases, it only works with the software that comes from the manufacturer.  Common stuff Windows will download drivers for (or already have), but more obscure stuff, even, for example, the LabJack or any other USB DAQ device, require custom software on the PC.  The same would go here.  As you noted, on the other equipment, its just RS232, so you didn't need special drivers.

 

I would imagine if you connected this thing to your PC, windows would complain that it can't find a driver for it.  If it doesn't complain and installs some driver, post what it did and maybe most of the things I just said are wrong...

Link to comment
Share on other sites

Well, if the press will print to any generic USB printer, then it's probably not using a driver per se, and just sending a string which the printer then prints (presumably including CR/LF's).    That was pretty commonly supported behavior with RS232 printers for example.  So it's probably just clear text, but sent over USB.  So you need some kind of bridge that will look like a printer to the press (since it doesn't care what printer is connected anyway), and accept the character stream, and then relay it via serial, Ethernet, or maybe also acts as a USB slave to the DAQ factory PC (and probably configures as a virtual serial port or something like that).

 

You can't connect two USB masters like two PC's or your press and a PC directly (electrically incompatible and can damage the ports), but they do make USB-USB devices with an isolation circuit in the middle to allow you to connect two PC's, for file transfer purposes for example.  Now that function used to be done with utilities like Laplink or Fastlynx with a null modem cable, so it could very well be that these new USB-USB ones do no more that emulate a serial port on both ends, which could work for you.

 

Then there are USB-serial (232 or 485) converters, which would work on the PC end, but they require drivers to be able to be viewed as a serial port, so unless your press control is actually a PC, you probably wouldn't be able to get the press end to work.  If you did, you could just install those on both ends and connect the 232 or 485 wires.

Link to comment
Share on other sites

Unfortunatelly, this will require quite a bit of hacking to get done.

 

If you say that your machine X can print to a printer, you will have to build yourself a printer emulator that will redirect the output to something more manageable, eg. text file.  Not impossible, but you will have to start with someone that can program USB clients, as that's not trivial . . . . .

Link to comment
Share on other sites

  • 3 weeks later...
  • 10 months later...

Archived

This topic is now archived and is closed to further replies.