Thursday, May 12, 2016

Automatically Generate Screenshots of Foxboro I/A Graphics

At work we have a Foxboro I/A control system. I was getting a lot of requests to take screenshots of control system graphics - which I don't mind fulfilling, because usually someone wants to make something better.

I wanted a better way to fulfill these requests! Something that can do everything at once.

In the first FOR statement, you can specify as many graphics subfolders as you want.

Replace SPR1SR with the DM (Display Manager) name of the FoxView instance you will be working on. The script calls the graphic to the DM you specify, then calls HyperSnap via its command line interface to take a screenshot.

Just to be clear, the script WILL open these graphics live on your AW (application workstation) and take a screenshot. It won't happen in the background. So if you have any graphics that invoke scripts when opened or closed, exclude those folders from the FOR statement.

This will tie up your AW for however long it takes to open all of your graphics. I like to run the script at the end of the day. If the screensaver comes on, it does not seem to matter.

Create a blank graphic (BLANKSCRN.fdf) for the script to call in between live process graphics.

The output file is named with the date, folder path and filename. For example, 2016-05-12-path-to-graphic-filename.fdf.png.

The echo statements are unnecessary, but it is useful to see their output for debugging.

Save the above as a .ksh file and run in the Kornshell environment.

If you want to generate screenshots of overlay files (popups), change this:

pref -SPR1SR dmcmd $DISP

to this:

pref -SPR1SR dmcmd "dmcmd ov $DISP -l MIDDLE -move"

Since coming up with this script, we generate screenshots of 200+ graphics on a monthly basis and drop them in a network folder on our Business LAN. This way, anyone who is interested can take a look at the current state of the control graphics, find errors and suggest improvements.

Drop me a line if you find this through Google - I'd love to know if this helped you out!