Build a trip
Contents
PC*Miler Connect can be used to build complex trips with multiple stops and various options. For example, you could generate two trips from New York to San Diego using different route options and then compare them.
To generate a trip with options:
- First ask PC*Miler Connect for a new trip with PCMSNewTrip.
- Set trip options.
- Call PCMSAddStop to add stops to a trip.
- Call PCMSCalculate to compute the distance for the current trip using the trip’s current routing type.
- When finished with the trip, you must call PCMSDeleteTrip to clean up the trip’s memory. (To optimize the performance of your application, you can also call PCMSClearStops to reuse a single trip created in the beginning of the program throughout its execution.)
NOTE: Running more than about 300 trips (more or less, depending on how much memory each trip uses) simultaneously is not recommended.
Set Trip Options and Defaults
PC*Miler Connect offers a wide range of functions to customize a trip’s routing calculations and report formats—from setting a governor speed or a truck’s load status to reporting distances in kilometers or miles.
Default options that are set in PC*Miler via the default Route Profile will be active when an option is not specified either directly in Connect or in the PCMSERVE.INI
file. The order of precedence is:
- Options that are set directly in Connect take precedence over the default options set in PC*Miler and the .INI file.
- Options set in the .INI file take precedence over those set in PC*Miler.
- An option set as the default in PC*Miler takes effect only in the absence of settings 1 and 2, and only when a key for that option exists in the
PCMSERVE.INI
. For example, the Distances application setting in PC*Miler would only take effect when the lineDistancePrecision=
exists in the[OPTIONS]
section of the .INI, without an assigned value.
The following functions affect the trip’s routing calculation and reports
- PCMSSetCalcType sets the trip’s routing method.
- PCMSGetCalcType returns the trip’s current routing method.
- PCMSSetCalcTypeEx sets the trip’s routing method when combinations of different route types are desired.
- PCMSGetCalcTypeEx returns the trip’s current routing method when
PCMSSetCalcTypeEx
has been used. - PCMSSetLoaded allows you to specify if your truck is loaded or unloaded at any given stop on a trip.
- PCMSSetGovernorSpeed sets the vehicle’s governor speed.
- PCMSGetGovernorSpeed gets the governor speed for this trip.
- PCMSSetFerryDiscouraged determines whether ferry miles will be avoided on a route.
- PCMSSetShowFerryMiles sets whether ferry distances will be included in distance and cost calculations.
- PCMSSetElevationDiscouraged enables a customized limit on the elevation of the roads a route may use.
- PCMSSetElevationLimit sets the threshold for the elevation (in feet) to avoid when using
PCMSSetElevationDiscouraged
. - PCMSGetNumMilesDecimals gets the number of decimals currently returned when distances are calculated.
- PCMSSetNumMilesDecimals sets the number of decimals that will be returned when distances are calculated.
- PCMSSetKilometers and PCMSSetMiles set the returned distance values to either kilometers or miles.
- PCMSSetAlphaOrder determines the order in which states are listed in the State Report.
- PCMSSetVehicleType determines whether Heavy Vehicle truck restrictions on roads are respected when the route is calculated.
- PCMSSetRouteLevel allows the setting of routing to be toggled between street-level routing and highway only routing.
- PCMSSetCost sets the trip’s cost per mile/kilometer.
- PCMSGetCost returns the trip’s cost per mile/kilometer.
- PCMSSetCustomMode enables the custom routing designations set in the PC*Miler user interface.
- PCMSSetRoadSpeed sets the road speed for the given jurisdiction and road type.
- PCMSGetRoadSpeed gets the road speed for the given jurisdiction and road type.
- PCMSDefaults resets a trip’s options to the defaults the engine was started with.
Route Profiles
Route profiles allow you to apply custom combinations of routing options and vehicle dimensions that are used frequently, rather than setting individual options for each trip. You can create and name route profiles in the PC*Miler user interface, or use the preset profiles that come standard with PC*Miler 34 and higher.
Note: Using a preset profile ensures consistent vehicle settings so that the routes and distances generated in Connect match the routes and distances generated in the PC*Miler user interface.
The following functions allow you to access profiles via PC*Miler Connect:
- PCMSSetRoutingProfileName turns on the specified route profile created in PC*Miler.
- PCMSGetNumRoutingProfiles gets the number of created route profiles.
- PCMSGetRoutingProfileName gets the name of the route profile, given its index.
Custom Vehicle Dimensions
PC*MILER Connect users can generate safe and accurate routing that conforms to the requirements of a vehicle’s height, length, width, and weight using the PCMSSetVehicleConfig
function.
If a vehicle weight or height is entered, PC*MILER route calculations will take into account restrictions on roads and bridges. Vehicle dimensions are also checked against the threshold at which a truck becomes “oversized,” and appropriate routing is generated.
PC*MILER also supports calculation of routes and toll costs for smaller vehicles (vans, pickup trucks, SUVs, and automobiles that are classed less than 9,000 lbs./4,082 kgs).
Notes on the use of PCMSSetVehicleConfig
PCMSSetCalcType
or PCMSSetCalcTypeEx
should be called first to set the trip’s routing method. For example, if PCMSSetVehicleConfig
is set for automobile routing but PCMSSetCalcType
is called later to use Practical truck routing, truck routing will be run.
Every time the vehicle width is set to 102 in. or more, or the length to 49 ft. or more, or a Route Profile is selected that includes those dimensions or greater (such as the 53’ Semitrailer or 28’ Double Trailer profiles), the State + National Network routing option is set automatically.
If you then set smaller vehicle dimensions, the State + National Network routing option will not be turned off automatically. You must manually undo these settings each time.