Class RTBoard

  • All Implemented Interfaces:
    Impc555, IntbMpc555HB, Ippc32

    public class RTBoard
    extends Object
    implements IntbMpc555HB
    Driver for the mpc555 board for control applications. This board comprises two regular analog outputs and two analog outputs with 1A current supply. Further there are 4 analog input channels as well as 8 digital in/output channels.
    Author:
    Graf Urs
    • Constructor Detail

      • RTBoard

        public RTBoard()
    • Method Detail

      • analogIn

        public static float analogIn​(int channel)
        Returns the value of an analog input channel.
        The analog signal will be read from channel. The channels carry the names A-In0..3 bezeichnet. The range of the return value is between -10..+10 corresponding to Volts. The resolution of the ADC is 10 bit.
        Parameters:
        channel - Channel with analog signal.
        Returns:
        Value in Volts (-10..+10).
      • analogOut

        public static void analogOut​(int channel,
                                     float val)
        Writes a value to an regular analog output channel The channels are denoted with A-Out0 and A-Out1. The range of val is between -10..+10 corresponding to Volts The resolution of the DAC is 12 bit.
        Parameters:
        channel - Channel with analog signal.
        val - Value in Volts (-10..+10).
      • analogPowerOut

        public static void analogPowerOut​(int channel,
                                          float val)
        Writes a value to an analog output channel with 1A current drive capability. The channels are denoted with Power-Out0 and Power-Out1. The range of val is between -10..+10 corresponding to Volts The resolution of the DAC is 12 bit.
        Parameters:
        channel - Channel with analog signal.
        val - Value in Volts (-10..+10).
      • dioInit

        public static void dioInit​(int channel,
                                   boolean out)
        Initializes a digital channel as input or output. Channels are numbered 0..7.
        Parameters:
        channel - Channel to be initialized.
        out - If true the channel will be an output, otherwise it will be an input.
      • dioIn

        public static boolean dioIn​(int channel)
        The digital input at channel is read. Channels are numbered 0..7. The value true corresponds to the logical signal 1.
        Parameters:
        channel - Channel to be read.
        Returns:
        Digital signal at channel.
      • dioOut

        public static void dioOut​(int channel,
                                  boolean level)
        Write a digital output to channel. Channels are numbered 0..7.
        Parameters:
        channel - Channel to write.
        level - Digital signal, true corresponds to the logical signal 1.
      • ledOut

        public static void ledOut​(int channel,
                                  boolean level)
        Write a digital output to a led. leds are numbered 0..3.
        Parameters:
        channel - Led channel.
        level - true corresponds to the led lightening up.
      • encInit

        public static void encInit​(int channel)
        Initializes two digital input channels as encoder input.
        channel can be in the range of 0..6.
        Important:
        As two digital inputs are necessary for a single encoder input, channel+1 will be reserved and used as well.
        Parameters:
        channel - channel and channel+1 will be used for encoder input signals.
      • getEncCount

        public static short getEncCount​(int channel)
        Reads the encoder position.
        Parameters:
        channel - Channel of encoder input.
        Returns:
        Position.
      • setEncCount

        public static void setEncCount​(int channel,
                                       short pos)
        Set the encoder position.
        Parameters:
        channel - Channel of encoder input.
        pos - Position to initialize encoder.