Skip to main content

Rail Deck is being prepared for an invitation-only Alpha. Check current availability

Developer documentation

CVs and programming

Read saved CV values, tuning, programming presets and batch progress.

Source 0.1.0 Private source package

How the calls fit together

Read stored values and available presets before preparing a batch. Stored values, command acceptance and decoder readback are different evidence.

JavaScript examples

Supply your configured client. Each call awaits a decoded result; errors pass to your caller. These identifiers and values are fictional. Use selected development records and review every change before running it. Opening this page sends no API requests.

See the complete TypeScript workflow · Explore the Node starter

locomotiveCvs.listValues

Lists stored CV values for one locomotive.

const result = await client.locomotiveCvs.listValues(
  "account-1",
  "loco-1"
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that owns the locomotive.

locomotiveId · required
RailDeckIdentifier

Locomotive whose CVs should be listed.

Returns Promise<RailDeckLocomotiveCvValueListResponse>.

Example evidence: Retained SDK transport fixture.

locomotiveCvs.getValue

Loads one stored CV value.

const result = await client.locomotiveCvs.getValue(
  "account 1",
  "loco 1",
  29
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that owns the locomotive.

locomotiveId · required
RailDeckIdentifier

Locomotive whose CV should be loaded.

cvNumber · required
number

CV number to load.

Returns Promise<RailDeckLocomotiveCvValue>.

Example evidence: Retained SDK transport fixture.

locomotiveCvs.setValue

Sets one stored CV value.

const result = await client.locomotiveCvs.setValue(
  "account-1",
  "loco-1",
  3,
  {
    "value": 12,
    "source": "manual",
    "notes": "Demo value"
  }
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that owns the locomotive.

locomotiveId · required
RailDeckIdentifier

Locomotive whose CV should be stored.

cvNumber · required
number

CV number to store.

input · required
SetRailDeckLocomotiveCvValueInput

CV value, source, and optional notes.

Returns Promise<RailDeckLocomotiveCvValue>.

Example evidence: Retained SDK transport fixture.

locomotiveCvs.deleteValue

Deletes one stored CV value.

const result = await client.locomotiveCvs.deleteValue(
  "account 1",
  "loco 1",
  29
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that owns the locomotive.

locomotiveId · required
RailDeckIdentifier

Locomotive whose CV should be deleted.

cvNumber · required
number

CV number to delete.

Returns Promise<RailDeckSuccessResponse>.

Example evidence: Retained SDK transport fixture.

locomotiveCvs.readValue

Queues a controller-backed CV read operation.

const result = await client.locomotiveCvs.readValue(
  "account-1",
  "loco-1",
  29,
  {
    "controllerId": "controller-1",
    "idempotencyKey": "read-29"
  }
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that owns the locomotive.

locomotiveId · required
RailDeckIdentifier

Locomotive whose decoder should be read.

cvNumber · required
number

CV number to read.

input · required
ReadRailDeckLocomotiveCvInput

Controller id and optional idempotency key.

Returns Promise<RailDeckLocomotiveCvProgrammingResponse>.

Example evidence: Retained SDK transport fixture.

locomotiveCvs.writeValue

Queues a controller-backed CV write operation.

const result = await client.locomotiveCvs.writeValue(
  "account-1",
  "loco-1",
  2,
  {
    "controllerId": "controller-1",
    "value": 5
  }
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that owns the locomotive.

locomotiveId · required
RailDeckIdentifier

Locomotive whose decoder should be written.

cvNumber · required
number

CV number to write.

input · required
WriteRailDeckLocomotiveCvInput

Controller id, CV value, and optional idempotency key.

Returns Promise<RailDeckLocomotiveCvProgrammingResponse>.

Example evidence: Retained SDK transport fixture.

locomotiveCvs.getTuning

Loads friendly tuning values for one locomotive.

const result = await client.locomotiveCvs.getTuning(
  "account 1",
  "loco 1"
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that owns the locomotive.

locomotiveId · required
RailDeckIdentifier

Locomotive whose tuning should be loaded.

Returns Promise<RailDeckLocomotiveTuning>.

Example evidence: Retained SDK transport fixture.

locomotiveCvs.updateTuning

Updates friendly tuning values for one locomotive.

const result = await client.locomotiveCvs.updateTuning(
  "account-1",
  "loco-1",
  {
    "values": {
      "acceleration": 12,
      "topSpeed": null
    }
  }
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that owns the locomotive.

locomotiveId · required
RailDeckIdentifier

Locomotive whose tuning should be updated.

input · required
UpdateRailDeckLocomotiveTuningInput

Friendly tuning field updates.

Returns Promise<RailDeckLocomotiveTuning>.

Example evidence: Retained SDK transport fixture.

locomotiveCvs.listProgrammingPresets

Lists friendly programming presets for one locomotive.

const result = await client.locomotiveCvs.listProgrammingPresets(
  "account-1",
  "loco-1"
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that owns the locomotive.

locomotiveId · required
RailDeckIdentifier

Locomotive whose presets should be listed.

Returns Promise<RailDeckLocomotiveProgrammingPresetListResponse>.

Example evidence: Retained SDK transport fixture.

locomotiveCvs.listProgrammingBatches

Lists programming batches for one locomotive.

const result = await client.locomotiveCvs.listProgrammingBatches(
  "account 1",
  "loco 1"
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that owns the locomotive.

locomotiveId · required
RailDeckIdentifier

Locomotive whose batches should be listed.

Returns Promise<RailDeckLocomotiveProgrammingBatchListResponse>.

Example evidence: Retained SDK transport fixture.

locomotiveCvs.createProgrammingBatch

Creates a planned programming batch for one locomotive.

const result = await client.locomotiveCvs.createProgrammingBatch(
  "account-1",
  "loco-1",
  {
    "controllerId": "controller-1",
    "presetCode": "smooth-driving",
    "values": {
      "acceleration": 10
    },
    "verifyAfterWrite": true
  }
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that owns the locomotive.

locomotiveId · required
RailDeckIdentifier

Locomotive whose decoder should be programmed.

input · required
CreateRailDeckLocomotiveProgrammingBatchInput

Controller, preset, tuning values, verification, and idempotency details.

Returns Promise<RailDeckLocomotiveProgrammingBatch>.

Example evidence: Retained SDK transport fixture.

locomotiveCvs.getProgrammingBatch

Loads one programming batch.

const result = await client.locomotiveCvs.getProgrammingBatch(
  "account 1",
  "loco 1",
  "batch 1"
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that owns the locomotive.

locomotiveId · required
RailDeckIdentifier

Locomotive whose batch should be loaded.

batchId · required
RailDeckIdentifier

Programming batch to load.

Returns Promise<RailDeckLocomotiveProgrammingBatch>.

Example evidence: Retained SDK transport fixture.

locomotiveCvs.startProgrammingBatch

Starts one programming batch.

const result = await client.locomotiveCvs.startProgrammingBatch(
  "account-1",
  "loco-1",
  "batch-1"
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that owns the locomotive.

locomotiveId · required
RailDeckIdentifier

Locomotive whose batch should be started.

batchId · required
RailDeckIdentifier

Programming batch to start.

Returns Promise<RailDeckLocomotiveProgrammingBatch>.

Example evidence: Retained SDK transport fixture.

locomotiveCvs.pauseProgrammingBatch

Pauses one programming batch.

const result = await client.locomotiveCvs.pauseProgrammingBatch(
  "account-1",
  "loco-1",
  "batch-1"
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that owns the locomotive.

locomotiveId · required
RailDeckIdentifier

Locomotive whose batch should be paused.

batchId · required
RailDeckIdentifier

Programming batch to pause.

Returns Promise<RailDeckLocomotiveProgrammingBatch>.

Example evidence: Retained SDK transport fixture.

locomotiveCvs.resumeProgrammingBatch

Resumes one programming batch.

const result = await client.locomotiveCvs.resumeProgrammingBatch(
  "account 1",
  "loco 1",
  "batch 1"
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that owns the locomotive.

locomotiveId · required
RailDeckIdentifier

Locomotive whose batch should be resumed.

batchId · required
RailDeckIdentifier

Programming batch to resume.

Returns Promise<RailDeckLocomotiveProgrammingBatch>.

Example evidence: Retained SDK transport fixture.

locomotiveCvs.retryProgrammingBatch

Retries one failed programming batch.

const result = await client.locomotiveCvs.retryProgrammingBatch(
  "account 1",
  "loco 1",
  "batch 1"
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that owns the locomotive.

locomotiveId · required
RailDeckIdentifier

Locomotive whose batch should be retried.

batchId · required
RailDeckIdentifier

Programming batch to retry.

Returns Promise<RailDeckLocomotiveProgrammingBatch>.

Example evidence: Retained SDK transport fixture.

locomotiveCvs.cancelProgrammingBatch

Cancels one programming batch.

const result = await client.locomotiveCvs.cancelProgrammingBatch(
  "account 1",
  "loco 1",
  "batch 1"
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that owns the locomotive.

locomotiveId · required
RailDeckIdentifier

Locomotive whose batch should be cancelled.

batchId · required
RailDeckIdentifier

Programming batch to cancel.

Returns Promise<RailDeckLocomotiveProgrammingBatch>.

Example evidence: Retained SDK transport fixture.

Download all TypeScript method examples

JavaScript calls and TypeScript downloads are checked through the real SDK using local response fixtures. This verifies the calls and decoding for those fixtures.

Handle errors and uncertain outcomes

Choose another feature

The complete TypeScript workflow

Follow how the calls fit together, including the review and recovery steps. Supply your configured client and explicitly selected development records. Importing the download performs no requests; mutations are never retried automatically.

import type { RailDeckDirectIntegrationClient as Client } from '@raildeck/frontend-sdk/direct-integration';

/**
 * Read saved CV evidence, tuning and presets before preparing a programming batch.
 * @param client - Configured client; the caller owns current authority.
 * @param accountId - Authorised account for this workflow.
 * @param locomotiveId - Explicitly selected locomotive.
 * @returns Saved programming context; this helper does not enqueue decoder writes.
 */
export async function prepareProgrammingReview(
  client: Client,
  accountId: string,
  locomotiveId: string,
) {
  const values = await client.locomotiveCvs.listValues(accountId, locomotiveId);
  const tuning = await client.locomotiveCvs.getTuning(accountId, locomotiveId);
  const presets = await client.locomotiveCvs.listProgrammingPresets(accountId, locomotiveId);
  return { values, tuning, presets };
}
Download TypeScript example

Information reviewed .