Assembly InpOut32.dll polling from a usb port - dll

Is there a way to use InpOut32.dll to poll for input from a USB port? I have a parallel port to USB adapter and the driver it installed is USB Printing Support. Is there a way to find the hex value of the port? I'm going to write this in MASM.

It is not possible to use an USB->Parport Adapter with InpOut.dll - these adapters work only with printers. They speak the printer protocol over USB.
These adapter types simply provide no port to control for InpOut.dll.
You might get away with a PCI/PICe parport adapter, these have I/O ports.

Related

Having a problem using the Ossila x200 LabVIEW driver to initialize the communication

I am trying to establish a connection with the Ossila x200 using the LabVIEW driver. The HelloCloi Command requires you to choose between USB and Ethernet and enter an address.
My question is: What is the address? Is it the USB address on my laptop? And, if so, how could I find it?

Virtual COM Communications Issue

I'm working on a Communications Device Class (CDC) driver for an embedded device, a Full Speed implementation of USB 2.0. The COM port settings are 115200, 8-bit, no parity, 1 stop bit, no flow control. Our PC application (32-bit, Windows 7, .NET 2.0) communicates with the target device through a virtual COM port, which on the target device can connect to either a FTDI (USB-to-SCI bridge) chip or the integrated USB peripheral in the microcontroller, depending on which port is selected by the application.
Both virtual COM ports work without any problems using Realterm. However, while our desktop application works using the virtual COM port connected via the FTDI chip, it hangs when attempting to use the virtual COM connected via the microcontroller's integrated USB peripheral.
When connected via the virtual COM port using the integrated USB, the application consistently hangs on the second call to SerialPort.Write(...). Using Serial Monitor from HHD Software I can see that the data is transmitted on the first call to SerialPort.Write(...). However, that data is never received by the target device.
It's odd because the only time I have seen similar problems on previous projects was when the flow control settings on each side of the bus were mismatched.
Additional info...
Here is the data captured from various port monitoring tools while running our PC application connected to the target device via its integrated USB peripheral. Any insight would be appreciated.
Sysinternals Portmon
Advanced USB Port Monitor
Device Monitoring Studio - Request View
Device Monitoring Studio - Packet View
For those that are interested, I am using CodeWarrior 10.2 with the MCF51JM128 from Freescale.
Any ideas or suggestions would be appreciated. Thanks.
It is clear from the logs that you are making the classic mistake of not taking care of the hardware handshaking signals. That only ever works by accident, a terminal emulator like Realterm will never make that mistake.
You must set the DtrEnable property to true. That turns on the Data Terminal Ready signal. It is important because RS-232 is an unterminated bus so is subject to electrical noise when the cable is disconnected or the power turned off. DTR convinces the device that it is in fact connected to a powered device. This is emulated of course in your case but the driver or firmware will still typically implement the RS-232 behavior.
And the RtsEnable property is important, used to handshake with the device and prevent the receive buffer from overflowing when the app isn't emptying the buffer in a timely matter. You really should set the Handshake property to Handshake.RequestToSend, the most common way a device implements it. Which then also takes care of turning RTS on. If you have to use Handshake.None for some reason then you have to turn it on yourself by setting RtsEnable to true.
This ought to take of the problem. If you still have trouble then use PortMon to spy on the way Realterm initializes the driver. Compare the commands you see against the commands that the SerialPort class sends. Make sure they are the same. In value, not in sequence.

VB.NET USB to Parallel programming

Before I was working on PC that had integrated Parallel port, but now I have laptop computer and I bought USB to Parallel port converter hoping that I can work on application that will communicate with Data pins of that Parallel port...
Can this converter be used as regular integrated parallel port?
I checked pins and all data out pins have signals all the time...
I tried with inpout32.dll scripts that I used for my PC ( that works 100% ) but it doesn't look to work on laptop...
Does programming has to be different when it uses converters like this?
Thanks!
From computer to computer, the IO address used for the Parallel port can vary. This page has a good explanation of how to find the port address for the computer. http://www.codeproject.com/Articles/20545/I-O-Ports-Programming-Parallel-port-Reading-Writin

communication to usb port by using vc++2008

I want to communicate to halios system(hardware) through usb port. I have a code which shows that the device is attached. I used USBTrace which shows that how many bytes are going in and out from the device to the host. But I do not know how to implement this is vc++2008 and by using windows xp.
If this is an evaluation board for an Elmos optical sensor IC I would guess that a USB to serial converter is involved. You could confirm this by watching Windows Device Manager for a new COM port appearing when you attach the device.
If that's the case you can use Basic example of serial communication with Windows XP/win32 but you may need to contact Elmos for the command protocol.

Program hardware without Printer Port

My motherboard is small and don't have a printer port, all the tutorials (program LEDs, motor etc.) of hardware programming tell the use of this port or a USB to printer port converter to program hardware.
Is there any other way and any other port (for example USB) to program hardware?
I suggest to buy Arduino which can easily be connected to USB and use it's outputs as parallel port. Why parallel port is popular when working hardware? Because it can be easily controlled programmatically. With USB you can't just set certain bits. Bu Arduino comes with build-in USB support on one side and easily programmable output on another. Plus it is cool device by itself.
That depends on the hardware. If your hardware has a printer port (or parallel port, more specifically), you will need that one. If your hardware has a serial port (COM) which is quote common too, you need one of those. Some hardware will need the game/midi port that you used to plug in your joystick on your old 386 PC. I think convertors are available to convert USB to each of those ports.