def testAn( self, chn ): self.setTest( 'test Analogue channel ' + str(chn) + ' ip address ' + underTestAddress ) # for analogue level from 0 to 100% in 10% steps. # We are going to stop at 80 % due to power supply problems limiting an out for i in range(0,81,20): # set all channels to this level. for j in range(0, 4): if j != chn: wb6.AnOutPercent( underTestAddress, j, i ) else: wb6.AnOutPercent( underTestAddress, j, 0 ) time.sleep(0.4) # let settle, possibly long Fade time # for channel under analogue level from 0 to 100% in 10% steps. for k in range(0, 81, 20): self.showWorking() wb6.AnOutPercent( underTestAddress, chn, k ) time.sleep(0.2) # Fade time sts = self.loadWbStatus(underTestAddress) for j in range(0, 4): val = sts.getAnIn(j) if j == chn : # should be k if ( val < ( k - 5 ) ) or ( val > ( k + 5 ) ) : self.error( 'test Analogue channel %i expecting %s got %s' % (chn, k, val) ) else: # should be i if ( val < ( i - 5 ) ) or ( val > ( i + 5 ) ) : self.error( 'test Analogue channel %i verify %i expecting %s got %s' % (chn, j, i, val) )
def testAnFast( self, chn ): self.setTest( 'test Analogue channel ' + str(chn) + ' ip address ' + underTestAddress ) # for analogue level from 0 to 100% in 10% steps. # set all channels to 50 % wb6.AnOutPercent( underTestAddress, 0, 0 ) for j in range(0, 4): if j != chn: wb6.AnOutPercent( underTestAddress, j, 50 ) #time.sleep(0.4) # let settle, possibly long Fade time # for channel under analogue level from 0 to 100% in 10% steps. for k in range(0, 81, 20): self.showWorking() wb6.AnOutPercent( underTestAddress, chn, k ) # time.sleep(0.2) # Fade time time.sleep(0.1) # Fade time sts = self.loadWbStatus(underTestAddress) for j in range(0, 4): val = sts.getAnIn(j) if j == chn : # should be k if ( val < ( k - 5 ) ) or ( val > ( k + 5 ) ) : self.error( 'test Analogue channel %i expecting %s got %s' % (chn, k, val) ) else: # should be i if ( val < ( 45 ) ) or ( val > ( 55 ) ) : self.error( 'test Analogue channel %i verify %i expecting %s got %s' % (chn, j, 50, val) )
def doPercent(): for i in range(98, 101): print "Percent %s" % (i) wb6.AnOutPercent(targetIP, 2, i) time.sleep(10.0)