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· requiredRailDeckIdentifierAccount that owns the locomotive.
locomotiveId· requiredRailDeckIdentifierLocomotive 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· requiredRailDeckIdentifierAccount that owns the locomotive.
locomotiveId· requiredRailDeckIdentifierLocomotive whose CV should be loaded.
cvNumber· requirednumberCV 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· requiredRailDeckIdentifierAccount that owns the locomotive.
locomotiveId· requiredRailDeckIdentifierLocomotive whose CV should be stored.
cvNumber· requirednumberCV number to store.
input· requiredSetRailDeckLocomotiveCvValueInputCV 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· requiredRailDeckIdentifierAccount that owns the locomotive.
locomotiveId· requiredRailDeckIdentifierLocomotive whose CV should be deleted.
cvNumber· requirednumberCV 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· requiredRailDeckIdentifierAccount that owns the locomotive.
locomotiveId· requiredRailDeckIdentifierLocomotive whose decoder should be read.
cvNumber· requirednumberCV number to read.
input· requiredReadRailDeckLocomotiveCvInputController 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· requiredRailDeckIdentifierAccount that owns the locomotive.
locomotiveId· requiredRailDeckIdentifierLocomotive whose decoder should be written.
cvNumber· requirednumberCV number to write.
input· requiredWriteRailDeckLocomotiveCvInputController 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· requiredRailDeckIdentifierAccount that owns the locomotive.
locomotiveId· requiredRailDeckIdentifierLocomotive 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· requiredRailDeckIdentifierAccount that owns the locomotive.
locomotiveId· requiredRailDeckIdentifierLocomotive whose tuning should be updated.
input· requiredUpdateRailDeckLocomotiveTuningInputFriendly 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· requiredRailDeckIdentifierAccount that owns the locomotive.
locomotiveId· requiredRailDeckIdentifierLocomotive 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· requiredRailDeckIdentifierAccount that owns the locomotive.
locomotiveId· requiredRailDeckIdentifierLocomotive 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· requiredRailDeckIdentifierAccount that owns the locomotive.
locomotiveId· requiredRailDeckIdentifierLocomotive whose decoder should be programmed.
input· requiredCreateRailDeckLocomotiveProgrammingBatchInputController, 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· requiredRailDeckIdentifierAccount that owns the locomotive.
locomotiveId· requiredRailDeckIdentifierLocomotive whose batch should be loaded.
batchId· requiredRailDeckIdentifierProgramming 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· requiredRailDeckIdentifierAccount that owns the locomotive.
locomotiveId· requiredRailDeckIdentifierLocomotive whose batch should be started.
batchId· requiredRailDeckIdentifierProgramming 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· requiredRailDeckIdentifierAccount that owns the locomotive.
locomotiveId· requiredRailDeckIdentifierLocomotive whose batch should be paused.
batchId· requiredRailDeckIdentifierProgramming 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· requiredRailDeckIdentifierAccount that owns the locomotive.
locomotiveId· requiredRailDeckIdentifierLocomotive whose batch should be resumed.
batchId· requiredRailDeckIdentifierProgramming 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· requiredRailDeckIdentifierAccount that owns the locomotive.
locomotiveId· requiredRailDeckIdentifierLocomotive whose batch should be retried.
batchId· requiredRailDeckIdentifierProgramming 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· requiredRailDeckIdentifierAccount that owns the locomotive.
locomotiveId· requiredRailDeckIdentifierLocomotive whose batch should be cancelled.
batchId· requiredRailDeckIdentifierProgramming 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.
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