Using C/C++ DLL with Python/Pyserial to communicate with Opticon barcode reader -


I have been trying to communicate with that which Opticon Opian -2002 barcode scanner IM I, officially Supports C / C ++ and .NET but I want to use it possibly with Python

I have opened the serial connection on device (or at least port (?), But when I use the function from dll it gives me the communication error (-1) when I get an OK ( 0) I'm hoping. I never did not use DLLs or serial communication so keep this in mind.

If you have been thinking I'm also someone else having a look at their SDK Very interested in call to call DLL-function or pyserial Yoga has made some obvious mistakes. It is expected to have a 4-byte long as well as appearing below. I thought that it would work so much that I have a little bit stuck. I know that there is only so much that you can help without the actual hardware. However, thank you for any help you!

the code which I have Sofhar:

  serial import ctypes Import * * opticonLib = WinDLL ('Csp2.dll') opticonLib.csp2SetDebugMode (1) to textfile #logs that .dll comport = 3 opticonSerial = serial (the debug version using port = Comport - 1, baudrate = 9600, bytesize = EIGHTBITS, parity = PARITY_ODD, stopbits = STOPBITS_ONE, timeout = 5) If opticonSerial.isOpen (): print ('Port is open. Using '+ opticonSerial.name +' ') Print (OpticonLibkcsp2InitEx (comport)) (instead of #Gives -1 0 opticonSerial.close)   

Windows keeps a lock on serial ports. Without looking at the SDK, I think it does that csp2InitEx serial port to try to open themselves and when it becomes an error from Windows and I'm going to fail.

Try not to open the serial port itself.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -