LK202-25-USB error when reading and writing with .NET

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
ds232
LCD?
Posts: 2
Joined: Wed Sep 29, 2010 3:15 am

LK202-25-USB error when reading and writing with .NET

Post by ds232 » Wed Sep 29, 2010 4:15 am

Hi,

We are using a .NET class to read and write from/to a LK202-25-USB. We write every 25ms, and read (GPIs) every 500ms.
The .NET class throws the exception:

Code: Select all

Unhandled exception stack trace:     at System.IO.--Error.WinIOError(Int32 errorCode, String maybeFullPath)   at System.IO.--Error.WinIOError()   at System.Threading.EventWaitHandle.Set()   at System.IO.Ports.SerialStream.AsyncFSCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOverlapped)   at System.Threading.-IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
The exception is thrown at seemingly random intervals.

I know it's highly unlikely anyone knows why this is happening but we're sort of stuck as to where to go to find an answer.

Any comments appreciated.

Thanks

Ray
Matrix Orbital
Matrix Orbital
Posts: 729
Joined: Thu Dec 13, 2001 4:00 pm
Location: Earth.... I think..
Contact:

Post by Ray » Wed Sep 29, 2010 8:21 am

I'm suspecting something fishy in the .Net SerialPort class or ftdi driver problem is we have no control over either.

However this doesn't mean you are completly out of options, the FTDI drivers have an alternative mode called D2XX mode which bypasses the virtual serial port and gives you a more direct API to the chip.

You can find a C# interface library and some sample code on the ftdi page here do note however that that page is a little out dated, they tell you you need different drivers, this is however no longer the case. The current drivers support both d2xx and vcp at the same time.

ds232
LCD?
Posts: 2
Joined: Wed Sep 29, 2010 3:15 am

Post by ds232 » Wed Sep 29, 2010 10:22 am

Ray,

Thanks for this, I think your solution will work, developers are working on that now.

However we have another query; we need to be able to use the screen upside down sometimes (our chassis is sometimes mounted on a wall rather than a desk) therefore we were looking for a way to invert the displayed text. Would using the FTDI drivers allow us to invert characters? or define our own character set? or do you know of any way we could achieve this?

If not, can you recommend a display from your range which will allow us to invert the displayed text? Ideally of the same form factor with mounting holes in the same position so that we don't have to change our chassis designs.

Many Thanks

Ray
Matrix Orbital
Matrix Orbital
Posts: 729
Joined: Thu Dec 13, 2001 4:00 pm
Location: Earth.... I think..
Contact:

Post by Ray » Wed Sep 29, 2010 1:48 pm

Well the alphanumeric units are most likely out, the font table is stored in the rom table of the controller and cannot be changed. It allows 8 custom characters but i doubt that will be enough to fit your needs.

Any of the graphical units will do the trick though since you have full control over the fonts. If you want to stay near the same size of the 2x20 unit the GLK12232 would probably be a good choice (but not perfect)

Post Reply

Who is online

Users browsing this forum: Baidu [Spider], Majestic-12 [Bot] and 12 guests