/** * Compressor constructor. * Given a relay channel and pressure switch channel (both in the default digital module), initialize * the Compressor object. * * You MUST start the compressor by calling the Start() method. * * @param pressureSwitchChannel The GPIO channel that the pressure switch is attached to. * @param compressorRelayChannel The relay channel that the compressor relay is attached to. */ Compressor::Compressor(UINT32 pressureSwitchChannel, UINT32 compressorRelayChannel) : m_task ("Compressor", (FUNCPTR)CompressorChecker) { InitCompressor(GetDefaultDigitalModule(), pressureSwitchChannel, GetDefaultDigitalModule(), compressorRelayChannel); }
/** * Relay constructor given a channel only where the default digital module is used. * @param channel The channel number within the default module for this relay. * @param direction The direction that the Relay object will control. */ Relay::Relay(UINT32 channel, Relay::Direction direction) : m_channel (channel) , m_direction (direction) { InitRelay(GetDefaultDigitalModule()); }
/** * Allocate a PWM in the default module given a channel. * * Using a default module allocate a PWM given the channel number. The default module is the first * slot numerically in the cRIO chassis. * * @param channel The PWM channel on the digital module. */ PWM::PWM(UINT32 channel) : m_module(NULL) { InitPWM(GetDefaultDigitalModule(), channel); }
/** * Create an instance of a digital output. * Create a digital output given a channel. The default module is used. */ DigitalOutput::DigitalOutput(UINT32 channel) { InitDigitalOutput(GetDefaultDigitalModule(), channel); }
/** * Set the upsource for the counter as a digital input channel. * The slot will be the default digital module slot. */ void xCounter::SetUpSource(UINT32 channel) { if (StatusIsFatal()) return; SetUpSource(GetDefaultDigitalModule(), channel); m_allocatedUpSource = true; }
/** * Create an instance of a Digital Input class. * Creates a digital input given a channel and uses the default module. * * @param channel The digital channel (1..14). */ DigitalInput::DigitalInput(uint32_t channel) { InitDigitalInput(GetDefaultDigitalModule(), channel); }
/** * Set the upsource for the counter as a digital input channel. * The slot will be the default digital module slot. */ void Counter::SetUpSource(UINT32 channel) { SetUpSource(GetDefaultDigitalModule(), channel); }
/** * Allocate a PWM in the default module given a channel. * * Using a default module allocate a PWM given the channel number. The default module is the first * slot numerically in the cRIO chassis. * * @param channel The PWM channel on the digital module. */ PWM::PWM(uint32_t channel) : m_module(NULL) { InitPWM(GetDefaultDigitalModule(), channel); }