"请问“通讯网”:TRIO的I/O点的输入I,是否象PLC的输入有软件滤波抗干扰功能。" 我来替“通讯网”回答一下,Trio的输入点可以有象PLC一样进行软件滤波。只不过这个软件需要你自己用Trio Basic编写一下。我写个例子给你: ''''''''''''''''''''''''''''''''''''''''' 'The example for filter of input ''''''''''''''''''''''''''''''''''''''''' 'The input source is IN(i) 0<=i<=3 'The result will be in VR(i)
'1. initialize the variable vbase=1000 'Define the base area of VR for flag timeout=1000 'Define the time of filter TICKS=0 'Initialize the timer
'Initialize the flag FOR i=0 TO 7 VR(vbase+i)=1 NEXT i
'Initlialize the result FOR i=0 TO 3 VR(i)=0 NEXT i
'2. Main process WHILE TRUE '2.1 Suppose you have three input need to filter FOR i=0 TO 3 IF(IN(i)=1) THEN IF VR(i)=1 THEN VR(vbase+i+4)=1 ELSE IF VR(vbase+i)=1 THEN VR(vbase+i)=TICKS ELSE time=VR(vbase+i)-TICKS IF time>timeout THEN VR(i)=1 VR(vbase+i)=1 ENDIF ENDIF ENDIF ELSE IF VR(i)=0 THEN VR(vbase+i)=1 ELSE IF VR(vbase+i+4)=1 THEN VR(vbase+i+4)=TICKS ELSE time=VR(vbase+i+4)-TICKS IF time>timeout THEN VR(i)=0 VR(vbase+i+4)=1 ENDIF ENDIF ENDIF ENDIF NEXT i
clearflag=0 FOR i=0 TO 7 IF VR(vbase+i)<>1 THEN clearflag=1 NEXT i IF clearflag=0 THEN TICKS=0 WEND