The tag that you need:
pathcheckdb_path:WString <Internal tag> pathcheckdb_pathchecked:Bool<Internal tag>
pathcheckdb_pathisnotfind:Bool
Sub pathcheck() Dim f SmartTags(“pathcheckdb_pathisnotfind”)=False SmartTags(“pathcheckdb_path”)=”” SmartTags(“pathcheckdb_pathchecked”)=False ‘set filesystem object Set f=CreateObject(“FileCtl.filesystem”) ‘try to get the usb path SmartTags(“pathcheckdb_path”)=f.Dir(“\Storage Card USB”) SmartTags(“pathcheckdb_pathchecked”)=True ‘if return value is not empty, it means the path is lived ‘then start to record If SmartTags(“pathcheckdb_path”) <> “” Then SmartTags(“pathcheckdb_pathisnotfind”)=False Else SmartTags(“pathcheckdb_pathisnotfind”)=True End If End Sub |
We are using f.Dir to check if the path exists or not.If the return value is empty, it means that the path does not exist. The script will turn on the tag “pathcheckdb_pathisnotfind”.
After that, depending on what you want, you can show the pop-up or alarms.