Hi Sir,

I hope to auto draw eye diagram and auto set the mask ON/OFF with python script:

        self.scope.write('PLOT:PLOT1:TYPe EYEDIAGRAM')      #  1
        self.scope.write('EYEMASK:MASK1:ENAbled ON')        #2
        self.scope.write('EYEMASK:MASK1:MASKfile "/C:/Users/Public/Tektronix/user.mask"')  #3

My question is :
 1. #1 script will be OK to add eye diagram in plot1
  2. when I used #2 to open a mask test on(pls see the attached pic1 highlight) I met:
        (1)  if  I manual add eye diagram and set Mask Test ON through touch the scope screen,  #2 script can auto to set Mask test  ON or OFF (It seems that I manual set Mask Test on firstly will trigger some register. The scope will remember this state and #2 will work well unless I del eye height)
        (2)if I use the script to auto add eye diagram and Mask(plot 1 ), #2 script can do auto set Mask test ON. the result pls see the PiC 2
I checked the program manual and find the below SCPI and I tried all of them ,it still did not work . 
   1.self.scope.write('PLOT:PLOT1:TEST:STATE OFF/ON')
   2.self.scope.write('MASK:MASK1:TEST:STATE ON/OFF')

can you pls help to tell me how to fix this issues?