Visual basic and cfa-633

Then its not a hardware or cable problem, its a VB problem. Although, I'm curious why sending the text string using Hyperterm didn't work.

Your dialog that controls the mscomm object looks OK, but how can you know that the port is actually open and sending data.

I think the next step is to rig up some kind of diagnostic hardware to the serial TX and RX lines, to verify that data is actually being sent, even if the data is corrupt such that the 633 is ignoring it. Do you have access to any test equipment that would help??
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 
I'm sorry, but don't know how to help you any further, since I don't have a CFA633, and don't use VB. Without diagnostic tools, you can't prove your code is sending anything.

If you were using C++, then I could be more helpful.

What part of the world are you located in?
How much effort (meaning time & money) are you willing to invest to get your code working?
Does your comp have more than one serial port?
 

ejf28

New member
I primarily use visual basic .net 2003 but i also have visual studio 2008 which has c# and c++, but I dont know those at all. However if you want to write me a piece of sample code I could try it out there and see if that works any better? I'd be going into uncharted territory so to speak haha. Also thank you so much for all your trouble of trying to help me
 
Last edited:
I'd be willing to write a short "Hello World" app in C++, as I already have a serial port class that works very well. The problem is that I do not have a CFA633 to test with, and I have learned that its a bad idea to send out untested code. Especially if you have no familiarity with C++, that would be a steep learning curve for you.

As for the previous questions I asked, but you didn't answer, are you sufficiently motivated to try beating your VB code to death? I have some ideas for troubleshooting the serial data that won't cost much to try.
 

ejf28

New member
As for the previous questions I asked, but you didn't answer, are you sufficiently motivated to try beating your VB code to death? I have some ideas for troubleshooting the serial data that won't cost much to try.
yea anything vb related ill try, ive tried everything else anyways lol. Not going to buy physical equipment or anything since it is obv a vb issue. Also for you or anyone who is actually following my thread, that code for the cfa 631 that was posted earlier did not work off the bat for me even after changing the com port and baud rate or whatever to 19200 and got some errors...

Any ideas are def welcome and ill put whatever anyone suggests to code to test
 
... Not going to buy physical equipment or anything ...
Well, then I can't help you.

I was going to suggest using a 2nd comm port or a USB port to monitor the output of your VB code. But that would require, at minimum, a DE9 F/F null modem cable, costing $1.33.

Good luck.
 

ejf28

New member
I suppose I may be into trying something like that, didn't know how costly things were that you were talking about. For a few bucks I wouldn't mind though. I'm not very fluent in the actual serial port communications area, which is prob why i cant get by device to work in the first place, so if you have something for me to try I will be willing to go for it. Is it just a null modem that you were thinking i should get? If so I think I have an old one laying around back from when ethernet wasn't in existiance.
 
If you have two DE9 serial ports on your comp, these will have male connectors (DE9-M), so the Null Modem cable must have female (DE9-F) on each end, unless you want to use gender changers to get the right sex. You must use a Null Modem cable, a normal cable will not work for this.

http://www.monoprice.com/products/p...d=10212&cs_id=1021205&p_id=477&seq=1&format=2
You might be able to find a DE9 F/F N/M at Fry's or CompUSA or similar place, but the price will be a ripoff.

If you only have one serial port, but you have a spare USB port, then you would have to use a USB-RS232 adaptor. They are available for about $15. Actually, you can get them for less than $10, but the cheap ones are not reliable, and are a waste of money. I recommend the Cables Unlimited "USB-2920" model, which uses the FTDI chipset, available many places online
http://www.tigerdirect.com/applications/searchtools/item-details.asp?EdpNo=1104139

You can use the cable to connect your two comm ports. Open one port using the Hyperterm utility, setting for 19200,n,8,1. The other port is controlled by your VB program. Then you have a way to see what/if your code is actually sending.
 

ejf28

New member
and if I don't have a serial port at all, just tons of usb ports would I need two of those adapters and the cable or is there a cheaper solution using just the preexisting usb brackets? I think asus makes some serial brackets which could be cheaper too since i have an asus mobo? Just trying to save money on all this too
 
Please tell the exact model number of the display module that you are using (you should have told the model in your first post).
and if I don't have a serial port at all, just tons of usb ports ...
Then what are you using for a serial port now, what is COM3? Why don't you just be helpful and tell me what ports you have on your system? How is your CFA633 connected to your computer? Is it RS232 or USB?

I don't know what you mean by "preexisting usb brackets". As for "asus makes some serial brackets", are you implying that your mobo has serial port headers that are not brought out to connectors on the back? Explain what you mean.
 

ejf28

New member
Please tell the exact model number of the display module that you are using (you should have told the model in your first post).Then what are you using for a serial port now, what is COM3? Why don't you just be helpful and tell me what ports you have on your system? How is your CFA633 connected to your computer? Is it RS232 or USB?

I don't know what you mean by "preexisting usb brackets". As for "asus makes some serial brackets", are you implying that your mobo has serial port headers that are not brought out to connectors on the back? Explain what you mean.
My lcd is the CFA-633 is that what you mean? It is connected through the usb cable to a usb header directly on the motherboard to com3. http://www.newegg.com/Product/Product.aspx?Item=N82E16813131320 is my motherboard I have.
 
USB LCD Displays - Graphic and Character LCDs with a Keypad
My lcd is the CFA-633 is that what you mean?
No. I mean what are the other letters following the 633 number. You know, the WHOLE number, like what you used to order it by. There are 6 different varieties of CFA633.

I am amazed that in the 30+ posts in this thread, you never mentioned "USB" even once, except in the last post. When someone talks about "serial ports", it is understood to mean "async serial rs232" ports. When referring to USB ports the term to use is "USB port", not "serial port".
to a usb header directly on the motherboard to com3
USB ports only have a "COMx" designation if there is a driver installed which emulates a serial port. I presume this is what you have.

In any case, since your signal output from your VB program is through a USB port, my idea for using another rs232 port for troubleshooting will not work. So once again, I can't think of a way to prove your VB code is sending data to the display.
 

ejf28

New member
I'm sorry like I said I am new to posting and not very familiar in this area of programming, so I apologize if I caused any frustration by lack of information. Yes it is a usb header.
https://www.crystalfontz.com/product/cfa633tmcku is my lcd, I got the one with the usb header attachment as well as the 12 volt power cable used to turn the computer on with.

So does a usb port not use a com address like a serial port, or is it just specified differently?
 
I have not done a great deal of programming for USB peripherals, but there seem to be two ways they can be handled.

1. The peripheral mfgr provides a DLL or a LIB that accesses the windows api functions for USB devices. Your program calls the DLL or LIB functions to manipulate the device. I have two USB-to-parallel port devices that use this method; they're handy for "USB'ing" parallel type character displays.

2. The peripheral mfgr provides a driver that you install, which emulates a serial comm port (i.e. creates a "virtual" comm port whenever the device is on the USB bus). Your program opens the virtual comm port, just as though it was a standard hardware comm port. This is the method that the CFA USB displays use, I believe.

In order to sniff the traffic that your program is supposedly sending to the port, you would have to have a software tool that "hooks into" the API calls and reports the data. I personally am not familiar with a tool that can do that.

Or, one other method, if you only have USB ports, might be to install two USB-to-RS232 adapters, each of which would create a virtual serial comm port. Then you could connect the two adapters with a null-modem cable. One of the virtual ports (COM3) would be opened by your VB program. The other (COM4?) would be opened by your monitoring app, such as Hyperterm. This would cost you about $35-$40 in hardware. I notice that Crystalfontz also sells the USB/RS232 adapters for $15 each.

So the question remains, how are you going to troubleshoot your VB code? Unless you have a way to "see" your data, you are shooting blind. Virtually all professional programmers depend on these kinds of hardware & software tools to get them out of trouble. Trying code changes blindly just leads to frustration.

BTW, early on, you said your VB suite did not come with the MSComm library, so you downloaded the ActiveX control instead. Why didn't you try to find the actual library?
 

Heffo

New member
When you downloaded the MSComm ActiveX control, did you just put it in the windows system32 directory, or did you also use the regsvr32.exe program to register the control with windows?

Which version of VB are you using?
Can you post your entire VB project here?
 

ejf28

New member
I downloaded the mscomm32.ocx, put it in my c drive directory for no better place, registered it and it registered correctly using regsvr32, having it say it was successful. If it wasn't registered correctly, vb would error actually when trying to use it. My program doesn't error actually just doesn't display on the lcd, thanks for the input though, any more would be great too
 
Since there are so many mentions online about mscomm32.ocx, and nothing about a mscomm "library", I'm just assuming your MSComm control is the correct way to impliment the serial port usage.

Now, I have to wonder if you are, in fact, opening the correct comm port. Have you looked in your "Device Manager" (in Control Panel) list, and see what port numbers you have (when the CFA633 is attached)? You should see something like the attached image. What port numbers are shown in your list?

 

Attachments

Last edited by a moderator:
Top