Click here to Skip to main content
15,913,669 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hi friends
i have wrote a program in c# that can send information to the LPT port and the device that connected to it can recive this information
using System.Runtime.InteropServices;




using System;
using System.Runtime.InteropServices;
public class LptPort
{
    [DllImport("inpout32.dll", EntryPoint = "Out32")]
    public static extern void Output(int adress, int value);
}

i use the output method to send information to the LPT(888) port
C#
LptPort.output(888,10);

now i want to use usb instead of LPT.
i mean i want to use usb to lpt adaptor
https://www.google.com/search?q=usb+to+lpt+adaptor&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a[^]
but the program don't work when i use this adaptor
can you help me?
thanks

update : no idea for how to do it ?
Posted
Updated 28-Apr-12 19:36pm
v2
Comments
[no name] 29-Apr-12 8:33am    
"but the program don't work when i use this adaptor" does not mean anything to anyone but you. Did you change your code to use USB instead of LPT? Did you get an SDK from the manufacturer of the device? Did you ask the manufacturer about whatever problem you are having? We cannot see your project or read your mind.

I think you can't do it in that way.

If you have connected your devices to USB port, do you see it? Try to enum usb devices[^] with the following software.

Maybe in your job, you'll need to create usb virtual port[^] to send data into it.

And a little tip: How to send and receive data to USB port?[^]
 
Share this answer
 
You are probably completely out of luck with a USB/parallel adaptor.

See http://www.logix4u.net/parallel-port/15-a-tutorial-on-parallel-port-interfacing[^]

They are the inpout.dll people and they say

I don't have parallel port on My machine! What do I do ?

Unfortunately, as of today parallel port is a completely deprecated interfacing standard. It is impossible finding a new laptop with parallel port these days. Even almost all branded PCs already shed Parallel Ports from their back panels. Other alternative available in market such as PCI parallel port expansion cards and USB to Parallel Port converters aren't good for anything other than connecting your old printer because of their architectural difference.


Alan.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900