Python API
 All Classes Namespaces Functions Variables
plux.SignalsDev Class Reference

Base class for PLUX signal-acquiring devices. More...

Inheritance diagram for plux.SignalsDev:
plux.BaseDev plux.MemoryDev

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...
 
- Public Member Functions inherited from plux.BaseDev
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

- Static Public Member Functions inherited from plux.BaseDev
def findDevices
 Finds PLUX devices within the given domain. More...
 

Detailed Description

Base class for PLUX signal-acquiring devices.

Constructor & Destructor Documentation

def plux.SignalsDev.__init__ (   self,
  baseDev 
)

Promotes a BaseDev instance to SignalsDev.

Parameters
baseDevThe BaseDev instance to be promoted. If promotion is successful, baseDev is no longer valid.

Member Function Documentation

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.

Parameters
nSeqThe 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.
dataThe 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.
Returns
Return True to exit message loop or False otherwise. Default callback returns False.
def plux.SignalsDev.setDOut (   self,
  state 
)

Sets the digital output state.

Parameters
stateA 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.

Parameters
freqAcquisition sampling frequency in Hertz.
portMaskAn 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.
nBitsSampling resolution in bits. It can be 8 or 16.
def plux.SignalsDev.start (   self,
  baseFreq,
  sources 
)

Starts a real-time acquisition session.

Parameters
baseFreqAcquisition base sampling frequency in Hertz.
sourcesA sequence of Source objects, or a single Source object. Each Source object represents a signal source to acquire.
def plux.SignalsDev.stop (   self)

Stops a real-time acquisition session.

Remarks
Call MemoryDev.stopSessionAcq() to stop an internal acquisition session.