i2c.readregister (METH) ¶ METHOD readregister : DINT This method is used to read a number of data bytes starting from a certain register The function therefore first writes the register number and then reads the defined number of bytes. InOut: Scope Name Type Comment Return ReadRegister DINT Number of bytes that have been actually read Input usiRegister USINT register number, where to start reading pbyBuffer POINTER TO BYTE pointer to buffer where to store the read data nBufferLen UDINT number of bytes to read
i2c.write (METH) ¶ METHOD write : DINT This method is used to directly write nBufferLen bytes to the CharDevice. InOut: Scope Name Type Comment Return write DINT Number of bytes that have actually been written Input pbyBuffer POINTER TO BYTE Pointer to the buffer that contains the data nBufferLen UDINT number of bytes to write
i2c.write8 (METH) ¶ METHOD write8 : BOOL This method is used to write the data byte of one register InOut: Scope Name Type Comment Return write8 BOOL TRUE if successful Input usiRegister USINT register to write usiValue USINT value
i2c.writeBits (METH) ¶ METHOD writeBits : BOOL This method is used to modify single bits of one register. InOut: Scope Name Type Comment Return writeBits BOOL TRUE if successful Input usiRegister USINT register usiFirstBit USINT highest value bit to write (0..7) usiLength USINT number of bits to write (1..usiFirstBit+1) usiValue USINT value of the bits to set (0..2^usiLength-1)
i2c.Operational (PROP) ¶ PROPERTY Operational : BOOL This property has to return TRUE , when the device is configured and running
i2cMaster.read (METH) ¶ METHOD read : DINT This method is used to directly read nBufferLen bytes from a device with a certain address return value: number of bytes that have actually been read InOut: Scope Name Type Comment Return read DINT Input usiAddress USINT address of i²c device pbyBuffer POINTER TO BYTE pointer to area, where the bytes are copied nBufferLen UDINT number of bytes to read
i2cMaster.write (METH) ¶ METHOD write : DINT This method is used to directly write nBufferLen bytes to a device with a certain address InOut: Scope Name Type Comment Return write DINT Number of bytes that have actually been written Input usiAddress USINT address of i²c device pbyBuffer POINTER TO BYTE Pointer to the buffer that contains the data nBufferLen UDINT number of bytes to write
SPI ¶ spi (FunctionBlock) connector AfterReadInputs (Method) BeforeWriteOutputs (Method) internal transfer (Method) transferExt (Method) status Operational (Property) spiMaster (FunctionBlock) Operational (Property) readwrite-commands transferExt (Method)
spi (FB) ¶ FUNCTION_BLOCK spi This function block is the base class for SPI devices controlled via the SPI device /dev/spidev0.0 . It is meant to be extended by other function blocks that overload the body and the following methods/properties and replace it with their specific implementation, always including a call of the base implementation with super^.<MethodName>() : body (general handling, start-up) AfterReadInputs (reading input data) BeforeWriteOutputs (writing output data) Initialize [optional] (used to read parameters from the configuration) Operational [optional] (used to signal the status of the device) The body of this FB is called by the methods AfterReadInputs and BeforeWriteOutputs, where _xAfterReadInputs indicates the caller. Use _iState to control your statemachine. A value of 10 by default indicates that the device is operational. Do not forget to call the base implementation with super^() , where the diagnosis indicators are set according to the Operational property. Properties: Operational Methods: AfterReadInputs BeforeWriteOutputs transfer transferExt Structure: connector AfterReadInputs (Method) BeforeWriteOutputs (Method) internal transfer (Method) transferExt (Method) status Operational (Property)
connector ¶ AfterReadInputs (Method) BeforeWriteOutputs (Method)