Programming LCD screen with VB

Knight

New member
Dexter said:
Right, but shouldnt there be a whole bunch of data. This is before the 'Split' function even comes into play. If i put multiple
MsgBox (Asc(ComPortData)), it just keeps saying 128, over and over.

Maybe it has to do with some setting of the MS Com control?
It's not likely to be a setting on the MSComm control.....

Is there any way you could send me the source via e-mail?

Or attach it to the message board.

First name at last name.com

David Bussanmas
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 

Knight

New member
Knight said:
It's not likely to be a setting on the MSComm control.....

Is there any way you could send me the source via e-mail?

Or attach it to the message board.

First name at last name.com

David Bussanmas

Ya know, I really outta take CF's example for the 633 in VB, and make it recieve fan reporting..... Using a packet analyzer.

I'll look into doing that this weekend.
 

Dexter

New member
Knight said:
It's not likely to be a setting on the MSComm control.....

Is there any way you could send me the source via e-mail?

Or attach it to the message board.

First name at last name.com

David Bussanmas
Sure thing. I just used the 631 demo app, changed the send test code and copied and pasted your code in there. You have to send the text message first, then the port is opened and then you can do a keypress. Yeah, sloppy coding, but its just to test stuff out.

Thanks alot!
 

Attachments

Knight

New member
I think I've figured out what's going on. I havn't had a chacne to plug up my 633 and test my theory though.


When VB recieves a single byte from it's device it instantly calls the OnComm routine. So, for EACH Byte it get's, it call's the oncomm.

My solution is to have two timer's. One a sleeper, and the other to delete the value.

It's kinda a complex workaround, but VB doesn't really do well with Comm ports.... Anyways, the method that I've always done with the Comm ports works, and works reliably.

I'll submit sample code on how to fix it so that it can get more than just hte 128. :)

Also, I'll modify the sample 633 code to work with reporting back stuff like fan reports, and stuff like that.

I might just make a API dll for the 633, I have one out for the 632 and 634. Then you wouldn't have to deal with alot of the other problems.

You'd just have code like this:

screen.clear
screen.write(1,1,"hello world!")
etc.

and it would raise events too. When it get's a fan report, it'd call the following subroutine and then you do with it what you want:

private sub FanReport(RPM as double, FanNumber as integer)

end sub

And you'd do what you want with that. It's relativly easy to make that, but it does take some time, a little bit of bug checking, but it works nice. :)

Also, your program wouldn't have a MSComm control on it anywhere.... the program would deal with that.

Anyways... Lemme know what you think about the API DLL, and if your interested.
 

Knight

New member
Knight said:
I think I've figured out what's going on. I havn't had a chacne to plug up my 633 and test my theory though.


When VB recieves a single byte from it's device it instantly calls the OnComm routine. So, for EACH Byte it get's, it call's the oncomm.

My solution is to have two timer's. One a sleeper, and the other to delete the value.

It's kinda a complex workaround, but VB doesn't really do well with Comm ports.... Anyways, the method that I've always done with the Comm ports works, and works reliably.

I'll submit sample code on how to fix it so that it can get more than just hte 128. :)

Also, I'll modify the sample 633 code to work with reporting back stuff like fan reports, and stuff like that.

I might just make a API dll for the 633, I have one out for the 632 and 634. Then you wouldn't have to deal with alot of the other problems.

You'd just have code like this:

screen.clear
screen.write(1,1,"hello world!")
etc.

and it would raise events too. When it get's a fan report, it'd call the following subroutine and then you do with it what you want:

private sub FanReport(RPM as double, FanNumber as integer)

end sub

And you'd do what you want with that. It's relativly easy to make that, but it does take some time, a little bit of bug checking, but it works nice. :)

Also, your program wouldn't have a MSComm control on it anywhere.... the program would deal with that.

Anyways... Lemme know what you think about the API DLL, and if your interested.

Also, I'd be willing to attempt to make it support the 631, but I don't have one to do actual bug checking on it. I can do what I can based on the manual, but no promises to it's reliability. If I had one to play with, I could get it more reliable....

*wink, wink, nudge, nudge, so no more!*
 

Dexter

New member
That would be cool Dave, if you have the time and energy to do it, but in the meantime I think I'll just try to use Visual C++ :)
 

Knight

New member
I've already started. I've got the test code and the packet analyzer integrated, but I'm still working on getting some more things done. Mostly I'm having a little trouble with the differences between the samp code for the 631 and changing it to 633 code, but I think I've got all that figured out. :)

Anyways, I'm seriously looking at getting this done hopefully by the end of the next weekend.
 

SnowJunkie

New member
Re: CFA-631 Visual Basic Demonstration Code

CF Tech said:
We put together a small Visual Basic program to demonstrate sending packets to the CFA-631.

http://www.crystalfontz.com/backlight/VB_631/CFA_631_Basic_Demo.zip

The code could also be modified to work with the CFA-633 with only minimal changes.
I've modified this VB code to work with the 633. Other extra features added:
- Scrolling text (speed options)
- Backlight Control
- Contrast Control
- Catch button press
- Menu Class (maintain a multi-level menu)

Thanks to all the snippets I found on this forum, plus taking apart the C++ wintest code.

I didn't appreciate the VB slagging comments in the original VB demo code BTW - very immature! ;)

Hope there are some people find this useful.
 

Attachments

CF Tech

Administrator
SnowJunkie said:
. . . I didn't appreciate the VB slagging comments in the original VB demo code BTW - very immature! ;) . . .
Everyone has their pet peeves, I guess mine is BASIC :)

There was a time when BASIC was a bit of a joke as a programming language . . . and (perhaps unfortunately) I'm old enough to remember.

In reality, pretty much anything you want to do in C could be done in BASIC, but some things are still pretty clumsy in BASIC (for instance having to initialize a look-up-table at run-time).

I do appreciate you sharing your modifications and additions with us.
 
Top