Welcome to the forum   
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Share
Options
View
Go to last post in this topic Go to first unread post in this topic
Offline fvri  
#1 Posted : 20 January 2003 16:45:03(UTC)
fvri


Joined: 07/10/2002(UTC)
Posts: 773
Location: Zwevezele,
Hi all,

I'm trying to control my track by sending simple commands to the control unit Ma6021 by means of a PC(Pentium 2, Win98, COM1 port; RS232port, C program) and the Ma6051 interface. So far I only succeeded in succesfully sending the emergency stop and release command respectively the ascii decimal values 97 and 96. I can see that the leds on my control unit 6021 light up or disappear. But, I'm not able to send any working locomotive commands. Thus, I'm not able to start running a (digital)train. Eg. if I want to start train with address 2 having speed 10. I would simple have to send the ascii values 10 and 2. I'm doing this in C. In basic it is PRINT#1, CHR$(10);CHR$(2);. I didn't try it in BASIC as I'm not longer having a BASIC development environment running on my computer.
I'm also able to turn on/off the functions F1, F2, F3, or F4. But not the auxiliary function (done by the ascii value 16).

What can be the problem?
The program, the interface 6051 or the control unit 6021.
- The program is plain C, it's simple and sends just simple commands to the serial port. I don't think anything is wrong here as I'm able to send the ascii values 96 and 97.

- The control unit 6021 works fully without the PC and 6051.

- The 6051; it's able to send commands from PC to 6021. Of course not all commands are interpreted.

- All trains are running with the control unit 6021.

Can it be that my 6021 is not working well?

Thanks in advance!

Bye,
Frank Vieren

Offline PeFu  
#2 Posted : 20 January 2003 16:57:34(UTC)
PeFu

Sweden   
Joined: 30/08/2002(UTC)
Posts: 1,291
I suggest you test the concept using a commercial software like Railroad & Co, there is a demo you can download on http://www.railroadandco.com. If that would work, you probably have a software bug. The Bankquay site http://home.wxs.nl/~rvdhof/start.html maybe could be a reference for you (under "Digi Train Control" / "Motorola Protocol" / "Software"). Myself, I use it as a reason not to enter into model railroad programming...

<img src=icon_smile_cool.gif border=0 align=middle> Peter

Andreasburg-Mattiasberg Bahn is inspired by Swiss railways |Forum Thread |Track Plan |Youtube Channel | C and K track | CS2 | TrainController Gold
Offline fvri  
#3 Posted : 20 January 2003 23:17:45(UTC)
fvri


Joined: 07/10/2002(UTC)
Posts: 773
Location: Zwevezele,
Hi Peter,

Thanks for the tip. Indeed using a commercial software proves that all hardware is functioning fine! I downloaded the software and it works fine. In fact after running it my own program works also. May be what I did wrong I set the control unit also to the number of the train I wanted to control with my PC. You can only control the train with one unit. Thus when using the PC your control unit should be set on an address that is not used by the program. Thus for example 0.

Thanks again!!!


Bye,
Frank

Offline Webmaster  
#4 Posted : 21 January 2003 00:48:00(UTC)
Webmaster


Joined: 25/07/2001(UTC)
Posts: 11,165
When I wrote my own test programs some years ago, I noticed that the 6051 had some "garbage" bytes buffered that had to be read and "forgotten" to clear the communication channel (RTS/CTS signalling) for further use while establishing the connection...
Juhan - "Webmaster", at your service...
He who asks a question is a fool for five minutes. He who does not ask a question remains a fool forever. [Old Chinese Proverb]
Offline perz  
#5 Posted : 21 January 2003 01:06:57(UTC)
perz

Sweden   
Joined: 12/01/2002(UTC)
Posts: 2,578
Location: Sweden
I have also noticed that in rare occations the serial port on my PC just "dies". This has happened with my own programs as well as other programs. When it happens, I have usually been running two different programs after eachother that both use the same serial port. The only cure I have found for this is to reboot the PC. Something similar may have happened to you.

Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

| Powered by YAF.NET | YAF.NET © 2003-2025, Yet Another Forum.NET
This page was generated in 0.262 seconds.