DInput10Module

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2021 License: BSD-3-Clause Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	INPUT01    uint16 = uint16(C.DInput10Module_INPUT01)
	INPUT02    uint16 = uint16(C.DInput10Module_INPUT02)
	INPUT03    uint16 = uint16(C.DInput10Module_INPUT03)
	INPUT04    uint16 = uint16(C.DInput10Module_INPUT04)
	INPUT05    uint16 = uint16(C.DInput10Module_INPUT05)
	INPUT06    uint16 = uint16(C.DInput10Module_INPUT06)
	INPUT07    uint16 = uint16(C.DInput10Module_INPUT07)
	INPUT08    uint16 = uint16(C.DInput10Module_INPUT08)
	INPUT09    uint16 = uint16(C.DInput10Module_INPUT09)
	INPUT10    uint16 = uint16(C.DInput10Module_INPUT10)
	ALL_INPUTS uint16 = uint16(C.DInput10Module_ALL_INPUT)

	NUMBER_OF_DI_INPUTS  uint8  = uint8(C.DInput10Module_NUMBER_OF_DI_INPUTS)
	MODE_PRETRIGGER_TIME uint32 = uint32(C.DInput10Module_MODE_PRETRIGGER_TIME)
	MODE_PULSE_COUNTER   uint32 = uint32(C.DInput10Module_MODE_PULSE_COUNTER)
	MODE_WIDTH_COUNTER   uint32 = uint32(C.DInput10Module_MODE_WIDTH_COUNTER)

	IdFunctionINPUTS    uint8 = uint8(C.DInput10Module_idFunctionINPUTS)
	IdFunctionCOUNTER01 uint8 = uint8(C.DInput10Module_idFunctionCOUNTER01)
	IdFunctionCOUNTER02 uint8 = uint8(C.DInput10Module_idFunctionCOUNTER02)
	IdFunctionCOUNTER03 uint8 = uint8(C.DInput10Module_idFunctionCOUNTER03)
	IdFunctionCOUNTER04 uint8 = uint8(C.DInput10Module_idFunctionCOUNTER04)
	IdFunctionCOUNTER05 uint8 = uint8(C.DInput10Module_idFunctionCOUNTER05)
	IdFunctionCOUNTER06 uint8 = uint8(C.DInput10Module_idFunctionCOUNTER06)
	IdFunctionCOUNTER07 uint8 = uint8(C.DInput10Module_idFunctionCOUNTER07)
	IdFunctionCOUNTER08 uint8 = uint8(C.DInput10Module_idFunctionCOUNTER08)
	IdFunctionCOUNTER09 uint8 = uint8(C.DInput10Module_idFunctionCOUNTER09)
	IdFunctionCOUNTER10 uint8 = uint8(C.DInput10Module_idFunctionCOUNTER10)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DInput10Module

type DInput10Module struct {
	// contains filtered or unexported fields
}

This struct represents the 10 Digital Inputs Module connected via eMOD bus to controller module. This module has 10 independent digital inputs and the status of each one can be obtained separately. If a polling is to be performed more than once per second, it's recommended to set a callback instead.

func NewDInput10Module

func NewDInput10Module() *DInput10Module

Allocates internal memory and returns an instance of the module

func (*DInput10Module) ConfigEventAtTimeInterval

func (din *DInput10Module) ConfigEventAtTimeInterval(time_interval time.Duration) error

Configures module for calling Init callback func at specified period.

func (*DInput10Module) ConfigEventOnNewData

func (din *DInput10Module) ConfigEventOnNewData() error

Configures module for calling Init callback func when a input value changes.

func (*DInput10Module) ConfigEventOnValueChange

func (din *DInput10Module) ConfigEventOnValueChange(threshold uint32, event_mask uint16) error

Configures module for calling Init callback func when input changes its value by a specified amount, accordingly to the configured mode (see SwitchToMode).

func (*DInput10Module) Destroy

func (din *DInput10Module) Destroy()

Free the internal memory of the module. The instance can't be used anymore after that.

func (*DInput10Module) GetAllPulseCount

func (din *DInput10Module) GetAllPulseCount() ([NUMBER_OF_DI_INPUTS]uint32, error)

Gets number of pulses occurred in all inputs.

func (*DInput10Module) GetAllPulseWidth

func (din *DInput10Module) GetAllPulseWidth() ([NUMBER_OF_DI_INPUTS]uint32, error)

Gets last pulse width occurred in all inputs.

func (*DInput10Module) GetAllStatus

func (din *DInput10Module) GetAllStatus() ([NUMBER_OF_DI_INPUTS]bool, error)

Gets all digital input status.

func (*DInput10Module) GetPulseCount

func (din *DInput10Module) GetPulseCount(input_number uint16) (uint32, error)

Gets number of pulses occurred in an input after a reset.

func (*DInput10Module) GetPulseWidth

func (din *DInput10Module) GetPulseWidth(input_mask uint16) (uint32, error)

Gets last pulse width occurred in an input.

func (*DInput10Module) GetStatus

func (din *DInput10Module) GetStatus(input_mask uint16) (uint8, error)

Gets a digital input status.

func (*DInput10Module) Init

func (din *DInput10Module) Init(cb DInput10Module_callback_func, cb_ctx interface{}) error

Initialize module. It is important to emphasize that this method is mandatory to be called and must be called always after instantiating the module. It can be called several times, each of which the module is initialized again. The callback function only will be called with the context if the module is later configured in callback mode.

func (*DInput10Module) InitModuleNumber

func (din *DInput10Module) InitModuleNumber(cb DInput10Module_callback_func, cb_ctx interface{}, module_number uint8) error

Same as Init(), but allows to initialize a specific module number instead of the first one.

func (*DInput10Module) ResetAllPulseCount

func (din *DInput10Module) ResetAllPulseCount() error

Resets the number of pulses in all inputs.

func (*DInput10Module) ResetEventConfig

func (din *DInput10Module) ResetEventConfig() error

Resets all previously configured events.

func (*DInput10Module) ResetPulseCount

func (din *DInput10Module) ResetPulseCount(input_mask uint16) error

Resets the number of pulses in an input.

func (*DInput10Module) SwitchToMode

func (din *DInput10Module) SwitchToMode(event_mask uint16, mode uint32) error

Usually, this function only needs to be called at the beginning in the configuration stage. It allows to change any input mode from status to pulse counter.

type DInput10Module_callback_func

type DInput10Module_callback_func func([]byte, uint8, interface{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL