AInput7Relay2Module

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

Variables

This section is empty.

Functions

This section is empty.

Types

type AInput7Relay2Module

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

This class represents the Analogue Inputs and Power Relays Module connected via eMOD bus to controller module. On the one hand, this module has 7 independent analogue inputs, the value of each one can be obtained separately. Its configuration for measuring voltage or current can be set also separately. And on the other hand, has 2 independent power relays than can be activated or deactivated separately. If polling is to be performed more than once per second, it's recommended set a callback instead.

func NewAInput7Relay2Module

func NewAInput7Relay2Module() *AInput7Relay2Module

Allocates internal memory and returns an instance of the module

func (*AInput7Relay2Module) Activate

func (air *AInput7Relay2Module) Activate(relay_mask byte) error

Activates a relay or set of relays.

func (*AInput7Relay2Module) ActivateAll

func (air *AInput7Relay2Module) ActivateAll() error

Activates all module relays.

func (*AInput7Relay2Module) ConfigEventAtTimeInterval

func (air *AInput7Relay2Module) ConfigEventAtTimeInterval(time_interval time.Duration, event_mask uint16) error

Configures module for calling init callback_func at specified period.

func (*AInput7Relay2Module) ConfigEventOnValueChange

func (air *AInput7Relay2Module) ConfigEventOnValueChange(threshold uint32, event_mask uint16) error

Configures module for calling Init callback func when input changes its value by a specified amount.

func (*AInput7Relay2Module) ConfigEventOutOfRange

func (air *AInput7Relay2Module) ConfigEventOutOfRange(low_limit uint32, high_limit uint32, event_mask uint16) error

Configures module for calling init callback_func when input value gets out of the specified range. The high and low limits of the range are in samples, so use the VoltageToSample or CurrentToSample methods.

func (*AInput7Relay2Module) ConfigEventWithinRange

func (air *AInput7Relay2Module) ConfigEventWithinRange(low_limit uint32, high_limit uint32, event_mask uint16) error

Configures module for calling Init callback func when input value enters the specified range. The high and low limits of the range are in samples, so use the VoltageToSample or CurrentToSample methods.

func (*AInput7Relay2Module) ConfigInput

func (air *AInput7Relay2Module) ConfigInput(input_mask uint16) error

Configure an input or set of inputs to select them for acquiring current (4 to 20 mA) or voltage (0 to 10 V).

func (*AInput7Relay2Module) ConfigPulseWidth

func (air *AInput7Relay2Module) ConfigPulseWidth(relay_mask byte, width_ms uint32) error

Configure pulse width of a relay o list of relays. When pulse width is 0 a relay stays in the current state, and there is no pulse.

func (*AInput7Relay2Module) ConfigSampleRate

func (air *AInput7Relay2Module) ConfigSampleRate(ms_period uint32) error

Configure sample rate at which you want to check the analog input data.

func (*AInput7Relay2Module) CurrentToSamples

func (air *AInput7Relay2Module) CurrentToSamples(current float32) uint16

Converts current to discrete samples.

func (*AInput7Relay2Module) Deactivate

func (air *AInput7Relay2Module) Deactivate(relay_mask byte) error

Deactivates a relay or set of relays.

func (*AInput7Relay2Module) DeactivateAll

func (air *AInput7Relay2Module) DeactivateAll() error

Deactivates all module relays.

func (*AInput7Relay2Module) Destroy

func (air *AInput7Relay2Module) Destroy()

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

func (*AInput7Relay2Module) GetAllAnalogInput

func (air *AInput7Relay2Module) GetAllAnalogInput() ([NUMBER_OF_AI_INPUTS]float32, error)

Gets last measured values for all analog inputs.

func (*AInput7Relay2Module) GetAllRelayStatus

func (air *AInput7Relay2Module) GetAllRelayStatus() (byte, error)

Gets all relay status.

func (*AInput7Relay2Module) GetAnalogInput

func (air *AInput7Relay2Module) GetAnalogInput(input_mask uint16) (float32, error)

Gets last measured value of a specified analog input.

func (*AInput7Relay2Module) GetInputConfig

func (air *AInput7Relay2Module) GetInputConfig() (uint16, error)

Gets configured inputs mask. Each input indicates if it’s configured to acquire voltage (0) or current (1).

func (*AInput7Relay2Module) GetRelayStatus

func (air *AInput7Relay2Module) GetRelayStatus(relay_mask byte) (byte, error)

Gets a relay status.

func (*AInput7Relay2Module) Init

func (air *AInput7Relay2Module) Init(cb AInput7Relay2Module_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 (*AInput7Relay2Module) InitModuleNumber

func (air *AInput7Relay2Module) InitModuleNumber(cb AInput7Relay2Module_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 (*AInput7Relay2Module) ResetEventConfiguration

func (air *AInput7Relay2Module) ResetEventConfiguration() error

Resets all previously configured events.

func (*AInput7Relay2Module) SamplesToCurrent

func (air *AInput7Relay2Module) SamplesToCurrent(samples uint16) float32

Converts discrete samples to current.

func (*AInput7Relay2Module) SamplesToVoltage

func (air *AInput7Relay2Module) SamplesToVoltage(samples uint16) float32

Converts discrete samples to voltage.

func (*AInput7Relay2Module) VoltageToSamples

func (air *AInput7Relay2Module) VoltageToSamples(voltage float32) uint16

Converts voltage to discrete samples.

type AInput7Relay2Module_callback_func

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

Jump to

Keyboard shortcuts

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