PauseOn函數

用於傳回暫停狀態(Pause狀態)。

格式
PauseOn

傳回值
處於暫停狀態時,傳回「True」;除此之外,傳回「False」。

說明
本函數僅用於NoPause工作、NoEmgAbort工作(在Xqt時,指定NoPause或NoEmgAbort開始的特殊工作)和背景工作。

參照
ErrorOn、EstopOn、SafetyOn、Wait、Xqt

PauseOn函數範例
以下範例是由控制器監視暫停,若有發生暫停,則啟用/停用I/O的程式。但是,因安全門打開而處於暫停狀態時,則不啟用/停用I/O。

Function main

  Xqt PauseMonitor, NoPause
  :
  :
Fend

Function PauseMonitor
  Boolean IsPause
  IsPause = False
  Do
    Wait 0.1
    If SafetyOn = True Then
      If IsPause = False Then
        Print "Safety On"
        IsPause = True
      EndIf
    ElseIf PauseOn = True Then
      If IsPause = False Then
        Print "InPause"
        If SafetyOn = False Then
          Off 10
          On 12
        EndIf
      IsPause = True
      EndIf
    Else
      If IsPause = True Then
        Print "OutPause"
        On 10
        Off 12
        IsPause = False
      EndIf
    EndIf
  Loop
Fend