[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do i display messages on a fare display board using vb6 and mscomm controls

Posted on 2007-10-15
14
Medium Priority
?
283 Views
Last Modified: 2013-12-26
Language used: VB6
Details: I am writing a software to send text strings to a 2 line Fare Display Unit (Via Comm controls), The supplier of the fare display has given me the following instructions:-

Port Settings: Baud Rate:4800,n 8,1
Command Syntax:
1)Start of transmission command
2)Send Character "a" for first line followed by 13 characters(Message Text)
3)Send character "b" for second line followed by 13 characters(Message Text)
4)End of transmission command

Problem:..The only thing i am good at is to sound intelligent..
I have tried all the above given instructions..given below is a sample code of what i have tried

Private Sub Command1_Click()
MSComm1.PortOpen = True
MSComm1.Output = "a" + Chr(13)
MSComm1.Output = "1234567891234" + Chr(13)
MSComm1.Output = "b" + Chr(13)
MSComm1.Output = "1234567891234" + Chr(13)
MSComm1.PortOpen = False
End Sub

Regarding the hardware wiring part. The Fare display has only two wires coming out, one for the ground and the other which is connected to presumable the RX pin of the display unit, I have soldered the ground wire to pin 5 of my Comm connector(female db9) and the RX wire to the pin 3(TX) of the connector, The rest of the pins on the comm connector as left empty. so basically this is a one way communication that is happening here, Therefore i have set the mscomm control's DTR and RTS to false and the handshaking to none.
0
Comment
Question by:viju_j
  • 8
  • 6
14 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 20076597
This is a very wide question.
I suggest that you first make sure that your PC and the display board work together. When you are sure about that, you can go forward with the software with more confidence. Try using Hyperterminal to test it.

You have listed the necessary settings like 4800 baud, but it isn't clear that you have set them in the programme. You will need a line like:

Mscomm1.Settings = "4800,n,8,1"
0
 

Author Comment

by:viju_j
ID: 20076762
Hi grahamskan..
You are right..and i did try it using hyperterminal too..needless to say..that didnt work either...and yeah..i have set the mscomm to the required properties at designtime....it seems to me that maybe the fault could also be in the wiring of the comm connector. I have just connected the rx wire from the device to the tx pin (pin 3) in the female db9 comm connector and the ground wire to the ground pin (pin 5). do i need to short the dtr, rts and cts pins (Pins 7 and 8, 6 and 4)?
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 20076886
I don't have much experience with such a simple (two-wire) interface. My instinct would be to do what you do and to set the handshaking to none.

I don't believe that any pins need shorting, because without handshaking, you are not trying to monitor any of the signals, so their state shouldn't matter.

This code should wait for nothing and report the buffer count to be 0, whether or not there is a device plugged into the port.

MSComm1.CommPort = 1
MSComm1.Settings = "4800,N,8,1"
MSComm1.Handshaking = comNone
MSComm1.PortOpen = True
MSComm1.Output = Text1.Text
MsgBox MSComm1.OutBufferCount
MSComm1.PortOpen = False
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:viju_j
ID: 20076989
I tried it out, but this code isnt working either.According to the fare display supplier i am supposed to send a "Start transmission" signal first and then i am supposed to send the special command  "A" character followed by 13 character message text for the data to be displayed in the first line and then the special command "B" character followed by a 13 character message string to display that message string in the second line of the display unit..finally i am supposed to end it with at "End transmission" signal
0
 

Author Comment

by:viju_j
ID: 20077017
BTW...i do get a "0" as the outbuffer count in the code that you sent me..sorry..i forgot to mention it in my earlier post
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 20077022
I'm not sure what a Start transmission signal is, but it might be another name for Start of Text.

This page shows the ASCII codes for SOT and EOT

http://encypher.net/ascii
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 20077043
I am not sure what is meant by special command "A" and "B" characters.

Perhaps they are device control characters (DC1 & DC2) or perhaps DC1 followed by "A" or "B"
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 20077412
Re your last comment. The messagebox displays 0. I think that this demonstrates that a short buffer is emptied by the time that the code is executed.
0
 

Author Comment

by:viju_j
ID: 20083154
Hi Graham..The characters "A" and "B" are commands specific to this particular display unit that i am using, they tell the fare display hardware which line to display the message text in. (The unit is a two line display-LED Based).
BTW.. I tried out various combinations of the SOT, EOT commands but this too didnt work


0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 20083376
I think that you desperately need to find out more about the equipment that you are working on, especially the manufacture's name.

Are there any clues? E.g, what sort of environment is the display intended for? What is the physical size of the display letters?

We might be able to find some generic information out there on the kit like it if we had a few more details.
0
 

Author Comment

by:viju_j
ID: 20083889
Hi graham
The main circuit is about 15"X4", its a 2 line led display unit with each line about an inch high, The main board has a programmable IC and the markings on it are as below:-
ATMEL-AT89C52
24PC
0122
The unit is bought from a local manufacturer called "Envoys"
Many thanks for the effort you are putting in
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 1500 total points
ID: 20084017
Sounds as if it might be intended for a taxi.

Yes. There is plenty of documentation on the IC. Unfortunately, because it is programmable, we aren't much further forward. Have you tried contacting "Envoys?"

Do you have any other devices that you could use to give you confidence that you can get something working? Before I threw it away, I used to test my serial comms programmes on an old free-standing modem.

If you have another PC and can make a cross-over cable you could try that. If you do get it working you could then try with a two-wire cable, TX data crossed to RX data.

Thanks, but you aren't much further forward, and I'm pretty well out of suggestions.
0
 

Author Comment

by:viju_j
ID: 20091780
Well...finally the manufacturer has confessed that the engineers who programmed this chip originally are no longer with the company and nobody else has a clue as to what has been programmed in or what the keys are........so i guess i will just have to get them reprogrammed as per our specifications..!! Thanks for your help graham.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 20092355
Thanks. Sorry we couldn't work out a 100% solution.

The number of times we've heard that sort of thing... At least, you'll know what you're dealing with for certain. Hacked solutions have a habit of coming up with some sort of blocking problem when you are a long way down the line.

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month17 days, 21 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question