![]() |
Python API
|
Base class for PLUX signal-acquiring devices. More...
Public Member Functions | |
def | __init__ |
Promotes a BaseDev instance to SignalsDev. More... | |
def | start |
Starts a real-time acquisition session. More... | |
def | start |
Starts a real-time acquisition session. More... | |
def | stop |
Stops a real-time acquisition session. More... | |
def | setDOut |
Sets the digital output state. More... | |
def | onRawFrame |
Raw frames callback. More... | |
![]() | |
def | __init__ |
Connects to a PLUX device. More... | |
def | getProperties |
Returns the device properties. More... | |
def | getBattery |
Returns a float number with the remaining battery charge as a percentage of full capacity. More... | |
def | setTimeout |
Sets the receiving timeout value for loop(). More... | |
def | loop |
Runs the device message loop. More... | |
def | interrupt |
Sends an interrupt signal to loop(). More... | |
def | onEvent |
Event callback. More... | |
def | onTimeout |
Timeout callback. More... | |
def | onInterrupt |
Interrupt signal callback. More... | |
def | close |
Disconnects from the device. More... | |
Additional Inherited Members | |
![]() | |
def | findDevices |
Finds PLUX devices within the given domain. More... | |
Base class for PLUX signal-acquiring devices.
def plux.SignalsDev.__init__ | ( | self, | |
baseDev | |||
) |
Promotes a BaseDev instance to SignalsDev.
baseDev | The BaseDev instance to be promoted. If promotion is successful, baseDev is no longer valid. |
def plux.SignalsDev.onRawFrame | ( | self, | |
nSeq, | |||
data | |||
) |
Raw frames callback.
This callback is called by message loop when a real-time data acquisition frame is received from the device. In order to receive data frames, an application must derive SignalsDev class (or any of its derived classes) to a new class and override this method in the new class.
nSeq | The sequence number of the frame. This number is zero for the first frame of the acquisition session, and then incremented by one for every subsequent frame. If this number differs more than one between consecutive frames, it means that data frames for the missing sequence numbers were lost, possibly due to connection problems. |
data | The frame sampling data as a tuple of integers. Each value is acquired from a channel of each requested source, in the same source order as given in start(self, baseFreq, sources), or from lower ports to higher ports in start(self, freq, portMask, nBits). For each multi-channel source, the values are presented from lower channels to higher channels. The values range for 16-bit samples is 0...65535 and for 8-bit samples is 0...255 . The values for a source with a frequency divisor greater than one are updated only in the frames with a sequence number multiple of the frequency divisor value. |
def plux.SignalsDev.setDOut | ( | self, | |
state | |||
) |
Sets the digital output state.
state | A boolean to define output state. If True, output is set to High, otherwise it is set to Low. |
def plux.SignalsDev.start | ( | self, | |
freq, | |||
portMask, | |||
nBits | |||
) |
Starts a real-time acquisition session.
This method is a shortcut to start(self, baseFreq, sources). It can be called if all requested sources are to be sampled at the same frequency and resolution, and at their channel 0 only.
freq | Acquisition sampling frequency in Hertz. |
portMask | An integer representing a bitmask of the device ports to acquire. The least significant bit corresponds to port 1, the next bit to port 2, etc. |
nBits | Sampling resolution in bits. It can be 8 or 16. |
def plux.SignalsDev.start | ( | self, | |
baseFreq, | |||
sources | |||
) |
def plux.SignalsDev.stop | ( | self | ) |
Stops a real-time acquisition session.