Printing DeltaV Operate Graphics Using Scheduler

I would like to print out a graphic each day at a specified time.  I am using the scheduler to print the current graphic and this works fine.  Once I add logic to change the graphic to my desired graphic, the print command fails.  Here's what I'm using now:

frszexpertreplacepic 4, "graphic_name.grf"

sendkeys "{ENTER}", false

printmaingraphic, me

I do know that if I use only the last two lines, the print is successful.  Not sure why the replace picture command is causing issues.

5 Replies

  • Try using the below script:

    On Error GoTo ErrorHandler

    frsReplacePictureOnScreen "graphic_name.grf", CURRENT_SCREEN to replace the picture instead.

    sendkeys "{ENTER}", false

    printmaingraphic, me

    Exit Sub

    ErrorHandler:
    frsHandleError

    It may be that the current picture hasn't finished being replaced yet and the errorhandler will probably give you an error message if it does.

    Matt
  • In reply to Matt Stoner:

    The above code kept giving errors as well. What we found to work was to have two separate time based events--one for the graphic switch and one for the graphic printing. This avoids whatever errors occur. It seems to be that no matter what you do, all of the actions in the time based event occur at once. We were trying to delay between graphic switch and print but never had any luck. Do you know why the sendkeys enter has to be before the print graphic command?
  • In reply to jasonbum:

    Have you also tried putting the 'DoEvents' command just before the printcommand?
  • In reply to jasonbum:

    I can't remember off the top of my head, but does frsReplacePictureOnScreen return a boolean value? If so, you could possibly use that (or an if-then check to ensure that your main pic has been replaced) to ensure that the print command doesn't execute until the pic has been called up.
  • Adding the DoEvents as Robert suggested might work.

    I think keeping in two separate events is probably best but I would document well with comments so someone later understands what is happening with the logic and the two separate events.