S0
This category contains functions specific to pulse S0 devices.
- Overview
- Arguments
- Return
- Example
Reports current value of S0 channel counter.
info
By calling this function, the internal shadow variable for the channel counter is updated, resetting the counter for the onThreshold()
event.
- channel (integer) - Number of the S0 channel,
1
to4
- value (integer) - Value of the S0 counter
--Read the value of S0 channel 3 and stores to given variable (val)
val = api.S0readCounter(3)
- Overview
- Arguments
- Example
Sets the value of S0 channel counter in a non-volatile memory.
note
This function is typically used on startup to restore the current value.
- channel (integer) - Number of the S0 channel,
1
to4
- value (integer) - Value of the S0 counter
--Set counter value for channel 0 to the value of 100
api.S0initializeCounter(1, 100)
- Overview
- Arguments
- Example
Defines a threshold between current value of S0 channel counter and last reported value.
info
When the difference between these two values reaches the threshold, the onThreshold()
event is triggered.
- channel (integer) - Number of the S0 channel,
1
to4
- value (integer) - Threshold value,
0
disables the threshold,0x01
-0xFFFFFFFF
sets the threshold
--Set threshold for channel 2 to the value of 10000
api.S0setThreshold(2, 10000)