Digital Data is data that starts with a percent sign (%). It can be a single value or up to 99 values. A digital data string, like all types of data, must end in a carriage return or line feed (ASCII 13 or 10).
Using the Debug/CLI Window (F4) is a great way to test incoming data with your interface or testing features.
%1
%1010
Reading Digital Values
As digital data arrives it is parsed into MakerPlot Values din0 to din99. The values can be accessed by reading them as MPJ values by enclosing them in brackets, [ ], such as printing their values to the Debug/CLI Window.
Note the the din0 is the least-significant bit (LSB) or right-most.
? [din0] ? [din0], [ain1] ? The first bit is [din0]
They may also be accessed from a serial control, such as: ? [serial.din0]
A digital value which has not been assigned data, such as [din50], will return a question mark, ?.
The entire digital string may be accessed using [digitalString].
? [digitalString]
Plotting Digital Values
The Digital Plot Control will automatically accept digital data and plot up to 10 as digital traces. With the Digital Plot Control, Standard Math or Post-Fix Math operations can be performed on incoming data prior to plotting, please see the Digital Plot Control.
Automatically Updating Controls
Controls can have their Update Values configured to automatically update properties based on the analog values. Please see Update Values for more information.
Digital Data Events
Certain controls can have their Event Code triggered on incoming digital data for specialized event processing, such as an Interface, digital plot control and some others. Event code written for these control will be triggered on reception of analog data.
<digital>!if [din] == 1 !then !bell // sound computer's bell if din0 is 1
See Control Events for more information on writing even code.
|