18.01.2015 Views

20000730_CLINIC_NMRA-00 Computer Interface App.pdf

20000730_CLINIC_NMRA-00 Computer Interface App.pdf

20000730_CLINIC_NMRA-00 Computer Interface App.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

KAM * Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Hands on training in using <strong>Computer</strong> Dispatcher® pro software<br />

Page 1<br />

KAM<br />

TM


KAM * CTC view of KAMville railroad<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 2<br />

KAM<br />

TM


KAM * Top view of KAMville RR<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 3<br />

KAM<br />

TM


KAM * Where we started with the layout<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 4<br />

KAM<br />

TM


KAM * Prep for the <strong>Computer</strong> Dispatcher® clinic<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 5<br />

KAM<br />

TM


KAM * The cows have arrived to the <strong>Computer</strong> Dispatcher® pro clinic<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 6<br />

KAM<br />

TM


KAM * Matt Katzer<br />

KAM Industries<br />

Portland, Or.<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

<strong>Computer</strong> <strong>Interface</strong> <strong>App</strong>lication<br />

Programming for DCC<br />

Page 7<br />

KAM<br />

TM


KAM * Agenda<br />

• History<br />

• Train Server ® <strong>Interface</strong> architecture<br />

– Key concepts and terms<br />

– Execution model<br />

• How the API works<br />

– Logical devices<br />

– Decoder structure<br />

– Command structure<br />

• API summary<br />

• Using the API in Visual Basic/MS Java or C/C++<br />

• Questions/Answers<br />

Clinic slides will be posted on KAMs website<br />

http://www.kamind.com by 8/30/2<strong>00</strong><br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 8<br />

KAM<br />

TM


KAM * Why are you here<br />

• Clinic will focus on API architecture<br />

– we will talk application programming<br />

– programming languages<br />

– implementation example programs (C++ and VB)<br />

• What are your expectations<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

• Clinic will review the proposed API architecture<br />

Page 9<br />

KAM<br />

TM


KAM * History of the API...<br />

• Train Server® API was developed to<br />

address an internal need at KAM<br />

– KAM needed a way to control schedules/costs<br />

» non standard mfg computer interfaces are costly to support<br />

» every command station vendor had their own architecture<br />

– Standardization was needed to address product<br />

development<br />

» API was required so KAM could decouple the GUI (client)<br />

» Required a full network backbone<br />

» Must support Windows 9x/M, NT 4.0 Win 2<strong>00</strong>0 and<br />

Microsoft.Net<br />

» KAM created a standard interface for a product family<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 10<br />

KAM<br />

TM


KAM * History (cont.)<br />

• KAM needed an API that was language friendly<br />

– Need flexibility to implement MS J++ (Java)/Sun Java<br />

– Visual Basic/Visual Basic for <strong>App</strong>lications (Excel, Word access..)<br />

– Needed support for C/C++ and C#<br />

– Needed support for our web servers via distributed Common<br />

Object Model (DCOM) and XML<br />

• Our next generation application <strong>Computer</strong><br />

Dispatcher® software was an object driven model<br />

which required integrated network support.<br />

– We needed an API that delivered functionality and implementation<br />

performance.<br />

– Required COM and CORBA standards<br />

– Required source level compatibility at the minimum<br />

– API must support different operating systems and processors<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 11<br />

KAM<br />

TM


KAM * KAM’s family of products<br />

– Engine Commander (manual control)<br />

– Layout Commander (automatic control)<br />

– <strong>Computer</strong> Dispatcher Pro (dispatching software)<br />

– Allows multiple applications to run<br />

– Share data model (either locally or distributed)<br />

– Implemented with KAM’s patent technology<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

• KAM has three product family’s supporting<br />

the API<br />

• KAM’s implementation is called Train Server<br />

Page 12<br />

KAM<br />

TM


KAM * Engine Commander®<br />

• Built on a modular philosophy<br />

– Implements all of the API’s<br />

– Simple interface, but uses abstraction to reduce complexity of task<br />

– An accessory through switches..<br />

– A throttle run trains..<br />

– A sensor displays state<br />

• All applications can run at the same time<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 13<br />

KAM<br />

TM


KAM * Layout Commander® Lite<br />

CTC panel view in Layout Commander®<br />

with automatic block operation<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

• Development of a non prototype application<br />

for the consumer….<br />

Switches and sensors<br />

<strong>Computer</strong> Dispatcher® Lite<br />

active elements<br />

Page 14<br />

KAM<br />

TM


KAM * N W 2 1<br />

ENT PO SD LPO LIN LIN<br />

A<br />

21 12<br />

1N<br />

CTC Panel view in <strong>Computer</strong> Dispatcher®<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

<strong>Computer</strong> Dispatcher® Pro 1<br />

• KAM needed to build an infrastructure so we<br />

could support prototype operation….<br />

1. Available in Q1’ 2<strong>00</strong><strong>00</strong><br />

ABS<br />

2N 1S<br />

ABS<br />

ABS<br />

21<br />

Page 15<br />

Active Objects<br />

B MC ABS 2S<br />

491<br />

<strong>Computer</strong> Dispatcher®<br />

model view of an active element<br />

with full Entry/Exit (route) control<br />

KAM<br />

TM


KAM * Agenda<br />

• History<br />

• Train Server ® <strong>Interface</strong> architecture<br />

– Key concepts and terms<br />

– Execution model<br />

• How the API works<br />

– Logical Devices<br />

– Decoder Structure<br />

– Command structure<br />

• API summary<br />

• Using the API in Visual Basic/MS Java or C/C++<br />

• Questions/Answers<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 16<br />

KAM<br />

TM


KAM * <strong>NMRA</strong> <strong>App</strong>lication S/W<br />

Architecture Model<br />

• There are four parts to the <strong>NMRA</strong> DCC<br />

software architecture model<br />

Katzer/Rice Draft Protocol Specification (7/9<br />

no activity<br />

Protocol Driver<br />

O/S Device Driver<br />

<strong>App</strong>lication Programming <strong>Interface</strong><br />

Object Architecture<br />

KAM Industries submission (7/98)<br />

updated 6/99<br />

specification located on Http://www.kamind.com<br />

Rosa Proposal by Tannersoft (7/97)<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 17<br />

KAM<br />

TM


KAM * API Architecture<br />

• API is a combination of a property/method<br />

model; with an execution framework<br />

– Objects are not passed in the API; states are passed<br />

– The state model reduces overhead on clients and improves<br />

the ability to port the API to different architecture<br />

(marshalling is expensive in software)<br />

– States are set; and execution is passed<br />

Train<br />

» DccEngSetFunction(…..)<br />

Set something(,,)<br />

» DccEngGetSpeed(…)<br />

» DccCommand(ObjectId)<br />

Get something(,,)<br />

• The API was designed to support prototype<br />

and non prototype operations<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 18<br />

KAM<br />

TM


KAM * Agenda<br />

• History<br />

• Train Server ® interface architecture<br />

– Key concepts and terms<br />

– Execution model<br />

• How the API works<br />

– Logical devices<br />

– Decoder structure<br />

– Command structure<br />

• API summary<br />

• Using the API in Visual Basic/MS Java or C/C++<br />

• Questions/Answers<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 19<br />

KAM<br />

TM


KAM * Architecture<br />

• API is built on the following concepts<br />

– Devices are logical devices. There is a mapping between<br />

logical to physical<br />

» DccPortGetMaxLogPorts(lMaxLogical)<br />

» PortGetMaxPhysical(lMaxPhysical, lMaxSerial, lMaxParallel)<br />

» DccPortGetName(iComPort, strComPort)<br />

» DccMiscGetControllerName(iController, strCntrl)<br />

» DccPortSetConfig(iLogicalPort, 0, iPortRetrans, 0)<br />

» DccPortSetMapController(iLogicalPort, iController, iPhysicalPort)<br />

– Abstraction for the client was the key.<br />

» Client does not need configuration ability<br />

» Client only needs to know how map a logical to a physical device<br />

» The configuration extension was added to accommodate new<br />

manufactures equipment using a standard driver.<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 20<br />

KAM<br />

TM


KAM * Demo<br />

• Command station support<br />

• 26 different command stations supported<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 21<br />

KAM<br />

TM


KAM * DCC Object (Cookie)<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

• DCC addresses are integrated in an object<br />

– Objects have a reference and can be translated<br />

– The object must be complete enough to use the API with as<br />

little information as possible<br />

– All information to control accessories or locomotives require<br />

and object as a reference<br />

» This allows developers to implement the sever as an<br />

object store independent of the operating system<br />

architecture.<br />

» The objects then become a “DccCookie”.<br />

• DccCookie encapsulate programming ports, command<br />

ports, decoder class and DCC addresss<br />

• The DCC cookie becomes the reference token for system<br />

calls and can easily be validated<br />

Page 22<br />

KAM<br />

TM


KAM * Architecture (cont.)<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

• Abstraction also extends to decoders<br />

– we needed a model that allowed flexibility and growth<br />

» Decoder classes were created to group decoders.<br />

» Each decoder class supports multiple decoder models<br />

• Classes are “Loco”, “Switch”,”Sensor”<br />

• Models are DH84, K87, LS110, Chub Detector1<br />

» A set of decoder management fucntions were added to<br />

support applciaiton development<br />

• DccDecoderGetMaxModels(…)<br />

• DccDecoderGetModelName(…)<br />

• DccDecoderGetMaxAddress(…)<br />

• DccDecoderGetMfgName(…)<br />

• DccDecoderGetPowerMode(…)<br />

• DccDecoderGetModelFacility(…)<br />

• DccDecoderSetModelToObject( …)<br />

– DccObjects are mapped to master models<br />

Page 23<br />

KAM<br />

TM


KAM * Demo<br />

• Decoder support and logical devices<br />

• 22 master decoder models supported<br />

– Grouped by loco, sensors and switches<br />

– DB store can be updated from web servers<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 24<br />

KAM<br />

TM


KAM * Agenda<br />

• History<br />

• Train Server ® interface architecture<br />

– Key concepts and terms<br />

– Execution model<br />

• How the API works<br />

– Logical devices<br />

– Decoder structure<br />

– Command structure<br />

• API summary<br />

• Using the API in Visual Basic/MS Java or C/C++<br />

• Questions/Answers<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 25<br />

KAM<br />

TM


KAM * API command summary<br />

• API Command classes<br />

– CV<br />

– Engine<br />

– Consist<br />

These are the major classes of<br />

– Accessory<br />

commands needed in most DCC<br />

– Command<br />

software applications. Clients are<br />

– Programming<br />

implemented for:<br />

– Communications<br />

– Command<br />

•Engine Commander® client,<br />

•Classic Panel® client<br />

– Decoder<br />

•Layout Commander® client<br />

– Cab<br />

•<strong>Computer</strong> Dispatcher® Pro software<br />

– Dispatcher operation<br />

– Block definitions<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 26<br />

KAM<br />

TM


KAM * Demo<br />

• API supported in KAMs Train Server®<br />

• 119 API’s defined!<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 27<br />

KAM<br />

TM


KAM * Agenda<br />

• History<br />

• Train Server ® interface architecture<br />

– Key concepts and terms<br />

– Execution model<br />

• How the API works<br />

– Logical devices<br />

– Decoder structure<br />

– Command structure<br />

• API summary<br />

• Using the API in Visual Basic/MS Java or C/C++<br />

• Questions/Answers<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 28<br />

KAM<br />

TM


KAM * • Lets look at how you program it<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Demo: Visual Basic Throttle<br />

• How is this Visual Basic application built<br />

Page 29<br />

KAM<br />

TM


KAM * Visual Basic 6<br />

• First step is to add the object reference<br />

This is the key for all<br />

programming<br />

languages<br />

We crete an object<br />

reference<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 30<br />

KAM<br />

TM


KAM * Visual Basic 5/6 (cont.)<br />

• next,<br />

– Write the subroutine to control the loco<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 31<br />

KAM<br />

TM


KAM * C++ Example<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 32<br />

KAM<br />

TM


KAM * Lets look at a C++ model<br />

// Identify the interface of the object that we want to use...<br />

MULTI_QI qi = {&IID_IEngComIfc, NULL, 0};<br />

hr = CoCreateInstanceEx(CLSID_EngComIfc, NULL,<br />

CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER,<br />

pServerInfo, 1, &qi);<br />

// add the security call at this point for compatibility for DCOM objects<br />

//CoInitializeSecurity<br />

This<br />

// Now make the com conenction for the interface<br />

This is is the the key key for for all all<br />

if (SUCCEEDED(qi.hr))<br />

programming<br />

programming<br />

{<br />

languages languages<br />

// Now get the remote TrainTools interface<br />

We<br />

short sError;<br />

We crete crete an an object object<br />

m_pEngIfc = (IEngComIfc*)qi.pItf;<br />

reference reference<br />

GetVersion(&m_csIfcVersion );<br />

m_pEngIfc->DccPortGetMaxLogPorts(&m_iMaxLogicalPorts, &sError);<br />

m_pEngIfc->DccPortGetMaxPhysical(&m_iMaxPhysicalPorts, &m_iMaxSerialPorts, &m_iMaxParallelPorts, &sError );<br />

m_pEngIfc->DccMiscMaxControllerID(&m_iMaxControlerId, &sError);<br />

Looks just like VB or Java, that is part of the design<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 33<br />

KAM<br />

TM


KAM * C++ cont.<br />

/*<br />

* NAME<br />

* DecoderGetModelFromCookie() - Get controller facilities.<br />

* RETURN VALUE<br />

* iModel - Decoder model ID.<br />

*<br />

* DESCRIPTION<br />

* DecoderGetModelFromCookie() gets the decoder model ID.<br />

*/<br />

int T<strong>Interface</strong>Device::DecoderGetModelFromCookie(long lCookie ) const<br />

{<br />

TRACE( "T<strong>Interface</strong>Device::DecoderGetModelFromCookie( 0x%08lx ) - Entering\n",lCookie );<br />

short iError;<br />

int iLogCmdPort, iLogProgPort, iDCCAddr, iDecoderClass, iDecoderModel;<br />

m_pEngIfc->DccDecoderTranslate(lCookie, &iLogCmdPort, &iLogProgPort, &iDCCAddr,<br />

}<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

&iDecoderClass, &iDecoderModel, &iError);<br />

TRACE( "T<strong>Interface</strong>Device::DecoderGetModelFromCookie( 0x%08lx ) - Exiting: (%X)- Error\n", lCookie, iError );<br />

return ( iDecoderModel );<br />

Easily supported in multiple languages<br />

Page 34<br />

KAM<br />

TM


KAM * Where to from here<br />

• The API is on the CD-ROM<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

• Engine Commander® Software packaged<br />

has a show special with the developers kit<br />

included.<br />

• All KAMs CD-ROM have have PDF versions<br />

• The proposed API is in the <strong>NMRA</strong> approval<br />

process<br />

Page 35<br />

KAM<br />

TM


KAM * Questions <br />

Matt Katzer<br />

email: mkatzer@kamind.com<br />

web: http://www.kamind.com<br />

home: 503-291-1221<br />

<strong>Computer</strong> Dispatcher®, Engine Commander®, ecomifc®,Layout Commander®, Smart Decoder®, The Conductor®,<br />

Train Server®, kamind®, Train Tools® and Video Speed® are registered trademarks of KAM Industries.<br />

KAM Industries is a division of KAMIND associates, Inc.<br />

Other brands, products, trademarks or registered trademarks are properties of their respective holders. Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 36<br />

KAM<br />

TM


KAM * <strong>App</strong>endix<br />

• Railroad environment<br />

• Proposed <strong>NMRA</strong> API version 1.1<br />

(Train Server® version 2.121)<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 37<br />

KAM<br />

TM


KAM * Railroad Environment<br />

• Must have <strong>NMRA</strong> DCC compatible engines<br />

– Pick a DCC supplier based on current requirement for your<br />

locomotive<br />

– By 2<strong>00</strong>0, all locomotives in a price range above $1<strong>00</strong> will most likely<br />

have a decoder integrated into the unit<br />

• Command station equipment<br />

– Expect a hybrid; plan for multiple command stations on layout<br />

– Model expected; one for programming the other for command and<br />

control<br />

Control(com1)<br />

Command station interface<br />

MS-1<strong>00</strong>, LI-1<strong>00</strong>,<br />

hardware interface<br />

Lenz<br />

Programming or Control(com2)<br />

Command Station<br />

EasyDCC<br />

EasyDCC, Lenz, Digitrax<br />

Personal <strong>Computer</strong><br />

Marlin, North Coast Engineering<br />

Wangrow, ZIMO<br />

Digitrax<br />

Multiple serial channel integration into DCC<br />

NCE<br />

Wangrow<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 38<br />

KAM<br />

TM


KAM * <strong>NMRA</strong> Proposed API<br />

• Engine<br />

DccEngGetSpeed( );<br />

DccEngSetSpeed( );<br />

DccEngGetFunction( );<br />

DccEngSetFunction( );<br />

DccEngGetFunctionMax( );<br />

DccEngGetName( );<br />

DccEngSetName( );<br />

DccEngGetFunctionName( );<br />

DccEngSetFunctionName( );<br />

DccEngGetSpeedSteps( );<br />

DccEngSetSpeedSteps( );<br />

• Consist<br />

DccEngConsistGetMax( );<br />

DccEngConsistSetParent( );<br />

DccEngConsistAddUnit( );<br />

DccEngConsistRemoveUnit( );<br />

DccEngConsistGetParent( );<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

Page 39<br />

KAM<br />

TM


KAM * • Functions<br />

• DccCVGetValue();<br />

DccCVSetValue();<br />

DccCVGetStatus();<br />

DccCVSetStatus();<br />

DccCVGetName();<br />

DccCVGetMaxRegister();<br />

DccCVGetMinRegister();<br />

• Accessory Commands<br />

DccAccGetFunction( );<br />

DccAccSetFunction( );<br />

DccAccGetFunctionAll( );<br />

DccAccSetFunctionAll( );<br />

DccAccGetFunctionMax( );<br />

DccAccGetName( );<br />

DccAccSetName( );<br />

DccAccGetFunctionName( );<br />

DccAccSetFunctionName( );<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

<strong>NMRA</strong> Proposed API (cont.)<br />

Page 40<br />

KAM<br />

TM


KAM * • Command Station<br />

DccOprGetStationStatus();<br />

DccOprTurnOnStation();<br />

DccOprStartStation();<br />

DccOprClearStation();<br />

DccOprStopStation();<br />

DccOprPowerOn();<br />

DccOprPowerOff();<br />

DccOprHardReset();<br />

DccOprEmergencyStop();<br />

• Programming<br />

DccProgramGetStatus();<br />

DccProgramSetMode( );<br />

DccProgramGetMode( );<br />

DccProgramWriteCV( );<br />

DccProgramReadCV( );<br />

DccProgramWriteDecoderToDataBase( );<br />

DccProgramReadDecoderFromDataBase( );<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

<strong>NMRA</strong> Proposed API (cont.)<br />

Page 41<br />

KAM<br />

TM


KAM * • Communications<br />

DccProgramGetStatus();<br />

DccProgramSetMode( );<br />

DccProgramGetMode( );<br />

DccProgramWriteCV( );<br />

DccProgramReadCV( );<br />

DccProgramWriteDecoderToDataBase( );<br />

DccProgramReadDecoderFromDataBase( );<br />

• Command<br />

DccCmdCommand( );<br />

DccCmdConnect( );<br />

DccCmdDisConnect( );<br />

• Cab<br />

DccCabWriteMessage( );<br />

DccCabReadMessage( );<br />

DccCabSetDccObject( );<br />

DccCabGetDccObject( );<br />

DccCabAdd( );<br />

DccCabDelete( );<br />

DccCabTranslate( );<br />

DccCabLookupDccObject( );<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

<strong>NMRA</strong> Proposed API (cont.)<br />

Page 42<br />

KAM<br />

TM


KAM * • Decoder<br />

DccDecoderGetMaxModels();<br />

DccDecoderGetModelName();<br />

DccDecoderGetMaxAddress();<br />

DccDecoderCheckAddrInUse();<br />

DccDecoderGetMfgName( );<br />

DccDecoderGetPowerMode( );<br />

DccDecoderAddAddr()<br />

DccDecoderGetModelFacility()<br />

DccDecoderReconnectObject( );<br />

DccDecoderChangeAddress( )<br />

DccDecoderTranslate( )<br />

DccDecoderSetModelToObject()<br />

DccDecoderGetMaxSpeed( );<br />

DccDecoderGetObjectCount()<br />

DccDecoderGetObjectAtIndex()<br />

DccDecoderDel( );<br />

DccDecoderGetErrorState( )<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

<strong>NMRA</strong> Proposed API (cont.)<br />

Page 43<br />

KAM<br />

TM


KAM * • Time<br />

DccMiscGetClockTime( );<br />

DccMiscSetClockTime( );<br />

• Command Station<br />

DccMiscGetControllerName( );<br />

DccMiscGetControllerNameAtPort( );<br />

DccMiscGetCommandStationIndex( );<br />

DccMiscMaxControllerID( );<br />

DccMiscSetCommandStationValue( );<br />

DccMiscGetCommandStationValue( );<br />

DccMiscGetControllerFacility( );<br />

• Misc<br />

DccMiscGetErrorMsg ( );<br />

DccMiscGetApiName( );<br />

DccMiscGet<strong>Interface</strong>Version( );<br />

DccMiscSaveData( );<br />

Matt Katzer<br />

San Jose, Calif.<br />

<strong>NMRA</strong> 2<strong>00</strong>0<br />

Copyright 2<strong>00</strong>0 KAM Industries<br />

all rights reserved.<br />

*KAM Industries is a division of<br />

KAMIND Associates, Inc.<br />

<strong>NMRA</strong> Proposed API (cont.)<br />

Page 44<br />

KAM<br />

TM

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!