def rawCounterPWMDIO(self, D15toD8Directions = 0, D7toD0Directions = 0, D15toD8States = 0, D7toD0States = 0, IO3toIO0DirectionsAndStates = 0, ResetCounter = False, UpdateDigital = 0, PWMA = 0, PWMB = 0):
        """
        Name: U12.rawCounterPWMDIO( D15toD8Directions = 0, D7toD0Directions = 0,
                                    D15toD8States = 0, D7toD0States = 0,
                                    IO3toIO0DirectionsAndStates = 0,
                                    ResetCounter = False, UpdateDigital = 0,
                                    PWMA = 0, PWMB = 0)
        
        Args: D15toD8Directions, A byte where 0 = Output, 1 = Input for D15-8
              D7toD0Directions, A byte where 0 = Output, 1 = Input for D7-0
              D15toD8States, A byte where 0 = Low, 1 = High for D15-8
              D7toD0States, A byte where 0 = Low, 1 = High for D7-0
              IO3toIO0DirectionsAndStates, Bits 7-4: Direction, 3-0: State
              ResetCounter, If True, reset the counter after reading.
              UpdateDigital, True if you want to update the IO/D line. False to 
                             False to just read their values.
              PWMA, Voltage to set AO0 to output.
              PWMB, Voltage to set AO1 to output.
        
        Desc: This command controls all 20 digital I/O, and the 2 PWM outputs.
              The response provides the state of all I/O and the current count.
              See Section 5.4 of the User's Guide.
              
              By default, sets the AOs to 0 and reads the states and counters.
              
        Returns: A dictionary with the following keys:
            D15toD8States, a BitField representing the states of D15-D8.
            D7toD0States, a BitField representing the states of D7-D0.
            IO3toIO0States, a BitField representing the states of IO3-IO0.
            Counter, the value of the counter
        
        Example:
        >>> import u12
        >>> d = u12.U12()
        >>> d.rawCounterPWMDIO()
        {
          'D15toD8States':
            <BitField object: [ D15 = Low (0), D14 = Low (0), D13 = Low (0),
                                D12 = Low (0), D11 = Low (0), D10 = Low (0),
                                D9 = Low (0), D8 = Low (0) ] >,
          
          'D7toD0States':
            <BitField object: [ D7 = Low (0), D6 = Low (0), D5 = Low (0),
                                D4 = Low (0), D3 = Low (0), D2 = Low (0),
                                D1 = Low (0), D0 = Low (0) ] >,
        
          'IO3toIO0States':
            <BitField object: [ IO3 = Low (0), IO2 = Low (0),
                                IO1 = Low (0), IO0 = Low (0) ] >,
          
          'Counter': 0
        }
        """
        command = [ 0 ] * 8
        
        # Bits for D15 through D8 Direction
        command[0] = int(D15toD8Directions)
        
        # Bits for D7 through D0 Direction ( 0 = Output, 1 = Input)
        command[1] = int(D7toD0Directions)
        
        # Bits for D15 through D8 State ( 0 = Low, 1 = High)
        command[2] = int(D15toD8States)
        
        # Bits for D7 through D0 State ( 0 = Low, 1 = High)
        command[3] = int(D7toD0States)
        
        # Bits 7-4: Bits for IO3 through IO0 Direction
        # Bits 3-0: Bits for IO3 through IO0 State
        command[4] = int(IO3toIO0DirectionsAndStates)
        
        bf = BitField()
        bf.bit5 = int(ResetCounter)
        bf.bit4 = int(UpdateDigital)
        
        binPWMA = int((1023 * (5.0/float(PWMA))))
        binPWMB = int((1023 * (float(PWMB)/5.0)))
        
        bf2 = BitField()
        bf2.fromByte( binPWMA & 3 ) # 3 = 0b11
        bf.bit3 = bf2.bit1
        bf.bit2 = bf2.bit0
        
        bf2.fromByte( binPWMB & 3 ) # 3 = 0b11
        bf.bit1 = bf2.bit1
        bf.bit0 = bf2.bit0
        
        command[5] = int(bf)
        
        command[6] = (binPWMA >> 2) & 0xff
        command[7] = (binPWMB >> 2) & 0xff
        
        self.write(command)
        results = self.read()
        
        returnDict = {}
        
        returnDict['D15toD8States'] = BitField(results[1], "D", list(range(15, 7, -1)), "Low", "High")
        returnDict['D7toD0States'] = BitField(results[2], "D", list(range(7, -1, -1)), "Low", "High")
        returnDict['IO3toIO0States'] = BitField((results[3] >> 4), "IO", list(range(3, -1, -1)), "Low", "High")
        
        counter = results[7]
        counter += results[6] << 8
        counter += results[5] << 16
        counter += results[4] << 24
        returnDict['Counter'] = counter
        
        return returnDict
dataset/ETHPy150Open LabPy/lantz/lantz/drivers/labjack/_internal/u12.py/U12.rawCounterPWMDIO/swapped operands of `/`