Thanks to visit codestin.com
Credit goes to github.com

Skip to content

acsys.scaling

Rich Neswold edited this page May 17, 2021 · 3 revisions

This package provides support for the SCALE service. The SCALE service allows an ACNET client to convert raw buffers to and from scaled data using a device's scaling configuration.

API Reference

Functions

convert_data(con, drf, data, node=None) - async function

Converts data based on the specified request. con is an acsys.Connection object. node, if None, will search for an available node running the SCALE service. If node is a string, it should be the name of an ACNET node running the SCALE service. drf is the DRF request and determines how the data is to be converted. data holds the data to be converted.

If the DRF string specifies ".RAW", the function expects data to have scaled data which will be converted and returned as a binary buffer. Otherwise data is expected to be a binary buffer which will get converted and returned as scaled data.

If the DRF string specifies a slice of an array device, data should be either an array of floating point (when converting to .RAW) or a binary buffer of the appropriate size (when scaling to an array of floating point values.)

find_service(con, node=None) - async function

Searches for an available SCALE service. con is an acsys.Connection object. node, if None, will search for an available node running the SCALE service. If node is a string, it should be the name of an ACNET node. This function will verify that a SCALE service is running.

This function returns a string representing an ACNET node running the SCALE service. If no service was found, None is returned.

This function is provided for completeness but doesn't need to be called since convert_data calls it internally.

Clone this wiki locally