Skip to main content

Stream

DUELink Scripting language is built to be ASCII human-friendly. This works great; however, there are instances where speed or raw binary data is required, like when writing or reading a buffer.

A direct benefit of streams is in giving a language, such as Python an easy way to transfer buffers to and from the module.


Usage

This is an example to send a buffer to the module. This example is for Python but other languages work almost exactly the same.

Samples
Library only functionality.
tip

Stream can't be used directly by typing in ASCII commands, like when using the Console or a terminal.


Mechanism

Understanding and utilizing Stream mechanism is only needed by advanced users. See the source code of one of the provided libraries for reference.

A Stream command initiates the request. Once this command is received and accepted by the device, the & symbol will be returned indicating readiness. The host can then send the entire binary data, exactly to the required byte count, or float count. Keep in mind that a float is 4 bytes.