Ignoring Errors in a VBA Script with ReadValue

I'm doing a data extract from my system (specifically interlock information), so I'm looking at reading a value from the system (using a script with ReadValue) and then writing it to a .CSV file for analysis.  I have it working, but I get errors if the interlock does not exist on the specific module:  "Error Number: -1577058245 Not Communicating (Typically a temporary condition.)"

I know these errors are going to occur, so is there a way to disable the popup that comes with them?  I've tried the standard "On Error Resume Next" which doesn't work.  I also know that in Excel you can use "Application.DisplayAlerts = False", but that isn't a command in DeltaV.

Does anybody know of a way that I can bypass these alerts?

  • If you are using scripting to ReadValue within a graphic, try using:

    frsReadValue "DVSYS.mod/path", lngError, , False

    Where lngError is a variable of Long data type.

    If you want the result of the read you would need to set the value to the expression and would need parenthesis around the values passed like this myVal = frsReadValue("path", lngError, ,false)

    No problem reading the path given will be indicated by lngError being a 0, a non-zero means it couldn't read the given path successfully.

    So do a read of something first using this format, if lngError is zero then you can do your logic, otherwise go to the next item or end.

    The "false" on frsReadValue came in a later DeltaV releases (I can't remember when it came) so you may not have this if using an earlier revision of DeltaV, the IntelliSense when writing the logic should help you know when you are using this function if the Show Error Dialog option is available.

    Just be aware that this will be slow if you are trying to read alot of items that don't exist because of retries that are done. There may be a better way to accomplish but if speed isn't an issue then this will work.