WriteDiscrete
Writes a range of bits to a discrete output channel.
The WriteDiscrete function Functions are tools that are available in Spreadsheet for processing and analyzing acquisitions or other results. You can add functions to your Spreadsheet job to create tool chains and produce results for specific applications. has the following syntax:
WriteDiscrete(Event, StartBit, Number of Bits)
See the table for a description of the available parameters.
| Parameter | Description |
| Event |
Specifies the event that forces an update. This parameter needs to refer to any event with a timestamp, for example, one of the following: |
| Start Bit |
Specifies the first bit of the set.
|
| Number of Bits |
Specifies the number of bits in the set.
|
| Value |
Specifies the positive integer value. The maximum value depends on the number of written bits. The value is the converted decimal value of the binary value of the written bits. |
| Override Output Delay |
When checked, the function overrides the Output Delay setting defined in the Discrete I/O Settings dialog, if any. Note:
The function can only override the Output Delay setting if it is already enabled. If Output Delay is disabled in the Discrete I/O Settings dialog, the function returns an error when trying to override the setting. |
| Output Delay (ms) | Defines the output delay in milliseconds. |
| Returns | The value written, #ERR for any invalid input parameter. |