Skip to main content

DcCurrentMeasurement

caution

This service is experimental and may change in the future.

A service that reports a current measurement.

import { DcCurrentMeasurement } from "@devicescript/core"

const dcCurrentMeasurement = new DcCurrentMeasurement()

Registers

measurementName

A string containing the net name that is being measured e.g. POWER_DUT or a reference e.g. DIFF_DEV1_DEV2. These constants can be used to identify a measurement from client code.

  • type: Register<string> (packing format s)

  • constant: the register value will not change (until the next reset)

  • read only

import { DcCurrentMeasurement } from "@devicescript/core"

const dcCurrentMeasurement = new DcCurrentMeasurement()
// ...
const value = await dcCurrentMeasurement.measurementName.read()
note

write and read will block until a server is bound to the client.

reading

The current measurement.

  • type: Register<number> (packing format f64)

  • read only

import { DcCurrentMeasurement } from "@devicescript/core"

const dcCurrentMeasurement = new DcCurrentMeasurement()
// ...
const value = await dcCurrentMeasurement.reading.read()
  • track incoming values
import { DcCurrentMeasurement } from "@devicescript/core"

const dcCurrentMeasurement = new DcCurrentMeasurement()
// ...
dcCurrentMeasurement.reading.subscribe(async (value) => {
...
})
note

write and read will block until a server is bound to the client.

readingError

Absolute error on the reading value.

  • type: Register<number> (packing format f64)

  • optional: this register may not be implemented

  • read only

import { DcCurrentMeasurement } from "@devicescript/core"

const dcCurrentMeasurement = new DcCurrentMeasurement()
// ...
const value = await dcCurrentMeasurement.readingError.read()
  • track incoming values
import { DcCurrentMeasurement } from "@devicescript/core"

const dcCurrentMeasurement = new DcCurrentMeasurement()
// ...
dcCurrentMeasurement.readingError.subscribe(async (value) => {
...
})
note

write and read will block until a server is bound to the client.

minReading

Minimum measurable current

  • type: Register<number> (packing format f64)

  • optional: this register may not be implemented

  • constant: the register value will not change (until the next reset)

  • read only

import { DcCurrentMeasurement } from "@devicescript/core"

const dcCurrentMeasurement = new DcCurrentMeasurement()
// ...
const value = await dcCurrentMeasurement.minReading.read()
note

write and read will block until a server is bound to the client.

maxReading

Maximum measurable current

  • type: Register<number> (packing format f64)

  • optional: this register may not be implemented

  • constant: the register value will not change (until the next reset)

  • read only

import { DcCurrentMeasurement } from "@devicescript/core"

const dcCurrentMeasurement = new DcCurrentMeasurement()
// ...
const value = await dcCurrentMeasurement.maxReading.read()
note

write and read will block until a server is bound to the client.