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 Xavicremades  
#1 Posted : 01 May 2018 16:01:36(UTC)
Xavicremades

Spain   
Joined: 01/05/2018(UTC)
Posts: 2
Location: Catalunya, Barcelona
Hello to everyone,

I am trying to be able to program with Labview and send the orders to the interface (6050), which is connected to the control unit (6021). Here find attached the easy and simple programm and I try to send the orders. I do not know if it is problem of the program or the orders I send. As a first step, I would like to run a locomotive with the number 10, which orders should I send. Is the programm right? I also have configured the COMPORT settings. Thank you very much for your attention!

Xavier



Untitled.png

Edited by user 02 May 2018 23:45:45(UTC)  | Reason: Not specified

Offline clapcott  
#2 Posted : 02 May 2018 01:17:29(UTC)
clapcott

New Zealand   
Joined: 12/12/2005(UTC)
Posts: 2,433
Location: Wellington, New_Zealand
Resurrecting a 605x for programming may be an intellectual exercise, however I would caution against frustration - given modern two-way , peer<>peer options.

Unless you know you have a good 6050, be prepared for the possibility that a 2nd hand one may be faulty.
However, I am not sure that flagging this forum thread as a Bug is appropriate.

You appear to have the COM setup definition correct 2400,8,N,2
However you may also want to confirm your wiring (loopback 1-4-6 for 9 pin D Serial port) at the PC side.

For 1st level connectivity testing I would suggest getting the Stop/Go to work before delving into Locomotive commands
Stop = one byte = x64(96 dec)
Go = one byte = x65(97 dec)

The loco commands are 2 byte
Byte 1 = speed 0-14 (15 = reverse)
ANDed with x10(16 dec) from the main function
Byte 2 = loco address (1-80)

for any string of command your programming MUST manage the delay between commands as there is no buffering in the 6050 and it must finish processing the first command before it will accept a second - any commands sent before it is ready will be lost.
The delay will vary depending on the command type. This is particularly important for turning the pulse to a turnout off.
Peter
Offline DaleSchultz  
#3 Posted : 02 May 2018 14:52:04(UTC)
DaleSchultz

United States   
Joined: 10/02/2006(UTC)
Posts: 3,997
without familiarity of LabView, we can't tell what you are sending to the 6050 from the screen shot.

I agree with what Peter wrote, but would clarify the comment on delay timing. If one uses proper CTS flow control then the timing of the commands is correctly handled. i.e. you should not have to build in manual delays betweens sending commands. You simply wait for CTS (Clear to Send) on the serial port and then send the next command. The 2400 baud is somewhat slow so you want to optimize the flow of commands using CTS flow control rather than code delays. Worry about that when you have some other commands working though.


Dale
Intellibox + own software, K-Track
My current layout: https://cabin-layout.mixmox.com
Arrival and Departure signs: https://remotesign.mixmox.com
Offline Xavicremades  
#4 Posted : 03 May 2018 00:13:04(UTC)
Xavicremades

Spain   
Joined: 01/05/2018(UTC)
Posts: 2
Location: Catalunya, Barcelona
Thank you so much for your quick answer to both of you. I will try everything you said and I will inform you if it worked since I am new in Märklin and I do not have much knowledge.

Peter, I think the interface hardware works well because my father used it with Basic and it worked like two or three years ago. Yesterday I could not check that the interface is working well because I think it was my own error. I will also try to check the wiring, but with the 6021 the system works well. The problems come when I try to control it by the interface connected to the control unit.

Dale, with that Labview screenshot you could not know the orders I tried to send with ASCII: Chr$(10) + Chr$(10); (the speed desired was 10 and the locomotive code is also 10).





thanks 1 user liked this useful post by Xavicremades
Offline clapcott  
#5 Posted : 03 May 2018 10:12:31(UTC)
clapcott

New Zealand   
Joined: 12/12/2005(UTC)
Posts: 2,433
Location: Wellington, New_Zealand
tip: Commands through the interface for a loco (Sreed, F0, Rev) wont work if the 6021 has that loco address dialed up.
Peter
thanks 1 user liked this useful post by clapcott
Offline Gregor  
#6 Posted : 04 May 2018 09:53:32(UTC)
Gregor

Netherlands   
Joined: 17/04/2003(UTC)
Posts: 996
Location: Netherlands
Hi,

I have built my whole control system using LabVIEW. I used to have an Edits Pro Controller which should be compatible with the 6050. I have rewritten the whole thing to IB-Com lately, but I can send you an earlier version for Edits Pro if you send me your email address by PM.

Best regards,
Gregor
Users browsing this topic
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-2024, Yet Another Forum.NET
This page was generated in 0.390 seconds.