Incorporate with Visual Studio .NET (VB)

tonymgr

New member
I have an application that utilizes the CFA-631 LCD. I want specifically to be able to write to the LCD and I want to trap a keypress on one of the four buttons. I dowloaded WinTest Source Code and for the life of me, I cannot figure the calls.

If someone could please provide me instructions on what library to reference, how to instantiate the class properly, and how to call print functions.

Also, I want to be able to capture an event when one of the buttons are pushed.

Please HELP!!!

Once again, this is written in VB.NET
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 

tonymgr

New member
Sending Okay. Help with Receiving...

Okay, I was able to incorporate your code into a working .dll file so I can send text out to the LCD Panel.

However, I need to know how to check for a button being pressed....I realize I will probably have to setup a timer in my .NET Program, but I still don't have the code necessary to pull data of the buffer.

Please help!!!
 

CF Tech

Administrator
The only difference should be the baud rate. CFA-633 is generally 19,200 and the CFA-631 is always 115,200.

If you knock the speed up to 115,200, it should work.

You should be able to carve his key reading routines out and transplant them to your code, the packet structure is the same.
 

tonymgr

New member
Okay. I did it. I am able to send and receive packets.

I am working on creating a .dll that can be referenced from a vb.net application. The .dll will be .NET also.

Once the .dll is complete I will post a link. I am sure that there are a lot of people interested in this solution.

This .dll will also work with the buttons.


Tony Buonopane
www.bonacosystems.myfileserver.com
 

CF Tech

Administrator
That is great that you have it working. If you are going to support CFA-631 buttons, you might as well support CFA-633 buttons at the same time, they are just a different group of return codes:
Code:
#define KEY_NONE            0

// CFA-633 key codes returned
#define KEY_UP_PRESS        1
#define KEY_DOWN_PRESS      2
#define KEY_LEFT_PRESS      3
#define KEY_RIGHT_PRESS     4
#define KEY_ENTER_PRESS     5
#define KEY_CANCEL_PRESS    6

#define KEY_UP_RELEASE      7
#define KEY_DOWN_RELEASE    8
#define KEY_LEFT_RELEASE    9
#define KEY_RIGHT_RELEASE  10
#define KEY_ENTER_RELEASE  11
#define KEY_CANCEL_RELEASE 12

// CFA-631 key codes returned
#define KEY_UL_PRESS       13
#define KEY_UR_PRESS       14
#define KEY_LL_PRESS       15
#define KEY_LR_PRESS       16

#define KEY_UL_RELEASE     17
#define KEY_UR_RELEASE     18
#define KEY_LL_RELEASE     19
#define KEY_LR_RELEASE     20
 

tonymgr

New member
Buttons 631, 633

Thanks for those codes. I will incorporate that into my Class. Also, thanks to .NET any buttons that are pushed raises an event so it is not necessary to use a timer to check if data is present.

Plus, for those of you still using VB, there is a very useful function in .NET that does Byte Conversions automatically.
 

tonymgr

New member
Working DLL

Hello Everyone. Sorry it took me so long to respond. I will not be able to incorporate a working class because it required customization for the current project I am working on. However, if you download the code from this link it will allow you full functionality to talk to both the 631 or 633.

<a href = "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncodefun/html/code4fun12102003.asp">Click Here</a>

Just remember from the test program, you need to expand the constructor for Sub New and change the instantiation parameters for your unit...

If you are working with the 631 set the baud rate to 115200 otherwise it is 19200. Make sure you also specify the correct Com Port.

The Program catches the 631 keypress events. Listed above in this Thread are the Keycodes for the 633. Remember, this code is free. There is no charge for its use. If you have any questions, feel free to contact me via my website.

http://www.bonacosystems.myfileserver.com

Happy Coding!!!
 
Top