Installation

The installation program copies the PC*MILER Rail TCP/IP files into the default directory:

 

c:\ALK Technologies\PCRWINXX\TCPIP


PC*MILER Rail-Connect must be installed prior to running the TCP/IP interface.  The interface program (pcmsock.exe) or the Windows Service (tcpsvc.exe) requires a command-line parameter—a unique port number to which they will be listening.


For PC*MILER Rail-Connect: 

pcmsock PC_MILERRAIL 2001


The server program comes with a tester program: tcptest.exe to connect to PC*MILER Rail-Connect. This test program sends commands to the server engine that is running via TCP/IP. It includes a sample trip (tcptest.in) to send to the engine.



Syntax (do not include brackets)

pcmsock [product code] [port number]

Product Code
Product Name
PC_MILERRAIL
= PC*MILER Rail-Connect
(The above parameter is to be used as the Service’s ‘start’ parameters.)



Interface Specifics

The interface is completely text based. You can use a telnet application to test the installation and familiarize yourself with the interface. For example (assuming that the host PC has a 127.0.0.1 address):


For PC*MILER Rail-Connect: 

  • telnet 127.0.0.1 [Port #]


When the connection is made the host PC (server) sends a prompt ending with the word READY.  Most of the routing functions listed in the corresponding Connectivity manuals are available. The mapping functions and the functions listed below as "APIs NOT Available Via TCP/IP," below are not available. Also note that there are a few differences in the syntax. PC*MILER Rail-Connect functions do not require (and will not accept) the ServerID parameter. The strings in the parameters must be quoted if they contain commas and/or parentheses. 


Example:

# telnet 127.0.0.1 [Port #] <Enter>

PCMILER RAIL SERVER READY

pcrsnewtrip()<Enter>

0 -- this is a good return code

14460364 -- this is the trip ID

pcrscalctrip(14460364, "CHICAGO IL", "NS", "C","PHILADELPHIA PA", "NS", "C") <Enter>


0 – this is a good return code

8468 – distance in tenths of miles

  READY


pcrsdeletetrip(14460364) <Enter>

0 – this is a good return code

 READY


NOTE:  When finished testing, simply exit your telnet session; there is no “kill” command.    


Syntax errors (wrong spelling of functions, missing parameters, etc.) will result in textual error messages. 


Example:

# telnet 127.0.0.1 2001 <Enter>

PCMILER SERVER READY

pcrssetrouteformula(14460364, "P") <Enter>

-401 – this is the error code associated with a parameter error



APIs Available Via TCP/IP

The following APIs are EXPOSED to the TCP/IP interface in PC*MILER Rail:


PCRSARGetRptLength
PCRSGetGeoMatch
PCRSAbout
PCRSGetNumAutoRoutes
PCRSAddAutoRouteDest
PCRSGetNumGeoMatches
PCRSAddAutoRouteOrig
PCRSGetNumRptLines
PCRSAddAutoRouteVia
PCRSGetNumStops
PCRSAddStop
PCRSGetRpt
PCRSCalcAutoRoutes
PCRSGetRptLength
PCRSCalcTrip
PCRSGetRptLine
PCRSCalculate
PCRSGetRRMatch
PCRSClearAutoRouter
PCRSGetStop
PCRSClearStops
PCRSJunctionLookup
PCRSConvertGeocode
PCRSLatLongsEnRoute
PCRSDeleteStop
PCRSNewTrip
PCRSDeleteTrip
PCRSRRLookup
PCRSGeoLookup
PCRSRRName2Num
PCRSGetAllStateRRMileage
PCRSRRNum2Name
PCRSGetAllStateRRMileage1
PCRSSetIntermodalOnlyIncEx
PCRSGetARNumRptLines
PCRSSetRouteFormula
PCRSGetARRpt
PCRSSetRouteIncEx
PCRSGetARRptLine
PCRSSetRouteMethod
PCRSGetAutoRouteLine
PCRSSetRouteType
PCRSGetAutoRouteMiles
PCRSSetUnitsKilometers
PCRSGetErrorString
PCRSSetUnitsMiles



APIs NOT Available via TCP/IP

Mapping APIs
Other APIs
PCRSAddRouteToMap
PCRSPlotLine
PCRSCleanupSrv
PCRSCreateMapChild
PCRSPlotPin
PCRSDeleteTripByName
PCRSCreateMapWin
PCRSPlotTrip
PCRSGetARLegInfo
PCRSDeleteAllTrips
PCRSResizeMapChild
PCRSGetError
PCRSDeleteLine
PCRSZoomIn
PCRSGetJunctionMatch
PCRSDeletePin
PCRSZoomOut
PCRSGetMaxStateRRs
PCRSDeletePinMap
PCRSDeletePinMap
PCRSGetMaxStates
PCRSDeleteRouteFromMap

PCRSGetNumARLegs


PCRSGetNumRouteLegs


PCRSGetNumRouteLinks


PCRSGetRRs


PCRSGetRouteInfo


PCRSGetRouteLegInfo


PCRSGetStateMiles


PCRSGetStateRRMiles


PCRSInitSrv


PCRSSetIncAMTK


PCRSSetIncNonStationRR