0:01
Good morning everyone. Thank you for joining us on this webinar on automatic screen capture.
0:08
The presentation itself is just under 15 minutes so if you have any questions at any point feel free to put them in we can get to them at the end. So we’ll just get going with that now.
0:18
Hello and welcome to today’s webinar.
0:21
Today we will look at automatic screen capture for machine documentation in your Horner controller.
0:29
We will start by explaining what the screen capture and file name counter features are before moving on to how we use these features to capture your runtime screens as image files.
0:42
Then we will discuss how to capture all your screens at once using a user-defined function block or UDFB.
0:50
After that, we will have demonstrations for everything discussed and we will finish with a Q &A session. Let’s begin.
0:58
What is the screen capture feature?
1:01
This is a feature that’s available in all Horner controllers with either a built-in screen or support for remote screens.
1:10
The screen capture feature works like the print screen button on a computer.
1:15
It saves the exact pixel pattern of the Horner screen at a specific time to a graphics file in What can screen capture be used for? While not a commonly used feature, it can be useful for a wide variety of applications.
1:31
For example, taking a snapshot of an important screen at the exact moment an alarm occurs.
1:37
When using the notepad feature, it can record the on-screen signature of an operator or inspector, it can document the machine operator interface screens, including actual machine data for documentation purposes, and so on.
1:49
How do we configure screen capture in Cscape?
1:53
This will be a brief overview of a process we will show in greater detail during the demonstrations portion of this webinar.
2:01
First, we will need to assign a boolean variable to be our trigger for the screen capture.
2:07
Then, we select our image format for our screen captures.
2:11
This is up to personal preference and internal storage space.
2:16
.bmp or bitmap will give you the highest quality image,.jpeg or jpeg will save the most space at the cost of quality, and.png will be a decently high quality image with decent file size as well.
2:33
Finally, we simply set a path and file name for our captured image files.
2:38
The file name can be fixed, but if you’re taking successive captures, you might prefer to use a file name counter.
2:47
What is a file name counter?
2:49
This feature is commonly used in conjunction with the screen capture feature.
2:54
It allows successive screen captures to each have unique file names, similar to the way a digital camera or phone assigns file names to image files.
3:04
It accomplishes this by inserting a variable field in the screen capture image filename, which, if desired, can also be auto-incremented.
3:14
How do we configure filename counters in Cscape?
3:18
In Cscape, you have four filename counters available to you.
3:22
First, we assign a variable that contains the current count.
3:26
This variable has to be a 32-bit or double integer.
3:30
counter. You can then set a maximum count before stopping or wrapping around.
3:37
Then we can decide whether we want the counter to auto increment and if we want the counter to wrap back to zero once the max has been reached.
3:47
In this image we can see that each file name counter has a dollar sign number next to it.
3:54
This is the designation or code for each counter.
3:58
And this is what we will reference when creating our screen capture image file names. We simply place this reference or code into the file name field.
4:10
Now we are going to begin looking at the workflow for setting up screen capture.
4:14
We’ll start by looking at screen capture for machine documentation.
4:18
The screen captures will include actual runtime machine data, not just the screen design.
4:24
We’ll show you how to capture screens manually, or all at once, using a free user-defined function block.
4:31
We are starting with the workflow for capturing screens manually, but we will show you how to automate this process afterwards.
4:38
First, we’re going to set up the screen capture feature as described earlier. Then, we will set up a file name counter.
4:46
This is optional, but recommended if you’re going to be capturing more than a few images.
4:51
Then, we change the screen we want to capture, and we toggle the screen capture control variable.
4:57
This is the boolean we assigned during the screen capture setup.
5:01
Finally, we retrieve the image files from our micro SD card.
5:05
Now we are going to demonstrate this workflow in Cscape.
5:09
Here we are in Cscape.
5:11
To begin, we need to ensure that we have a screen to capture.
5:14
It does not matter what is displayed on the screen, as long as we have something displayed, we can access the screen capture and file counters config.
5:22
First, under the user interface tab at the top, navigate to the screen capture in the config section of this ribbon.
5:30
Under control variable, we have to assign a boolean bit of your choosing.
5:36
Then, for file name, we can enter any suitable name for our screen capture files.
5:42
In our example, we are utilizing file counter codes.
5:46
Let’s demonstrate how to set this up.
5:48
Close this window and navigate to File Counters in the Config section just under Screen Capture.
5:55
As you can see at the top of this menu, File Counter 1 has a code of $1.
6:01
And in this counter, we have assigned the variable screen underscore counter to it.
6:07
We have set a maximum value of 9999, or 4 digits, and we have enabled auto increment.
6:16
So it will automatically count up for us, but not wrap counter.
6:21
So it will not loop back to the start once we hit the maximum.
6:24
With this covered, let’s now return to the screen capture.
6:28
Once again, close this menu and navigate to screen capture at the top.
6:32
Let’s now take a closer look at the file name.
6:35
We have named our files $1U4, and as we have just shown, the $1 relates to our FileCounter1 variable.
6:47
What is U4?
6:49
U4 represents a 4-digit unsigned value.
6:53
This is the syntax we need to employ in order to take advantage of our FileCounter.
6:58
Finally, we have selected a.bmp or bitmap for our file extension, for the highest quality images.
7:07
With our screen capture setup, we will now demonstrate how it works.
7:10
From within Cscape, navigate to the Variable Inspector menu at the top.
7:15
In this menu, we can see our screen capture variable appears.
7:19
If we jump to the bench, here we can see our controller is set up and ready to be captured.
7:26
Returning to Seascape, we can simply change the screenCapture variable to a 1, and the screen should be captured.
7:36
As you can see, the screenCapture variable almost immediately returned to the off state.
7:42
This is due to the fact that once the screenCapture has been taken, our OCS will immediately turn it off, as we only want one screenCapture to be taken at a time.
7:52
We can tell however that this worked because our screen counter variable has increased to 2.
7:58
But let’s check to see if a file has been created.
8:01
Here on the bench we are going to navigate to the system menu on our device and then into the media menu.
8:08
Here we can see 0001.bmp.
8:13
Our image has been successfully captured. If we click on this file, we can display this image on our device.
8:19
You can tell this is an image and not a screen because of the dotted line around the edge of the monitor.
8:28
We have successfully set up manual screen capture in our Horner controller.
8:33
Now let’s discuss the workflow for capturing all screens automatically.
8:38
This is particularly useful for documentation purposes, but any time you need to take lots of screen captures, this can be employed.
8:46
Similar to our manual screen capturing, we will start by configuring the screen capture and file counter features within Cscape.
8:55
Then, we will add an instance of the screen grab user-defined function block near the end of our program.
9:02
Then, after setting the UDFB input values to their proper values, we will enable the UDFB.
9:10
Finally, after the done bit is set, we can retrieve the images from our microSD.
9:17
Let’s take a closer look at the ScreenGrabUserDefined function block.
9:22
You can download this block from the Horner website.
9:25
It has three inputs and three outputs.
9:28
First, on the input side, we have the EN or Enable Boolean.
9:33
This bit will need to be turned on and left on for the duration of the block.
9:38
Then, using two double integer values, we assign a firstScreen to be captured, and a lastScreen to be captured.
9:48
Then, on the output side, we have the screenCap boolean, which should be assigned to the control variable for our screen capture feature.
9:57
Then we have the screenCounter, which will be incremented as the block is active.
10:01
And finally, we have the done boolean, which will turn on once the block has finished.
10:08
How does the screen grab user defined function block work?
10:11
Do not worry about the specifics of how this works, but we will briefly look at the execution sequence.
10:19
First, it sets the user screen system register to the first screen to be captured.
10:24
Then, it toggles our screen capture control bit.
10:27
Then, it gives the controller time to execute the screen capture.
10:32
Usually, this only takes a few seconds.
10:35
Then it increments our user screen variable, and then this process will repeat until we hit the value of the last screen input, and the done bit will be triggered.
10:47
Now, let’s look at how we implement automatic screen capture in our Horner controller.
10:56
Here we are in Cscape.
10:57
First, for our demonstration, we have set up our user-defined function block, and we have placed it at the end of its main loop modules group.
11:07
Your user-defined function block should be as close to the end as possible.
11:11
This screen-grab user-defined function block was downloaded from Horner’s website.
11:16
We can install downloaded logic modules like this one by right-clicking on logic modules on the left and clicking import module.
11:26
This will import our UDFB modules like this, and they will also appear in your toolbox.
11:33
Then we simply drag it onto our logic area and it will be set up.
11:39
With this setup, we will next look at our variables for different inputs and outputs of our UDFB. Switch to your screen view and navigate to screen capture configuration.
11:51
In this menu, we have basically the same setup as we showed for manual capturing.
11:57
We are still using screen capture as our control variable, but if we look at the file name, we have slightly changed it.
12:06
We have specified a path, so our images will now be stored in the screens folder.
12:13
This will prevent our root directory from getting messy with all our images.
12:18
and each image will be named sc or n or screen, followed by our file counter variable.
12:27
Taking a closer look at our file counter variable, it is slightly different as well.
12:32
As before, it has a max of 9999, but we also have disabled auto increment.
12:40
This is because our UDFB will auto increment for us.
12:44
Now, if we return to our logic area and click on our UDFB, we can set our variables.
12:52
For this demonstration, we have already assigned all our variables.
12:57
As you can see, we have linked the screen capture and file counter variables you saw earlier to their respective outputs.
13:04
Our UDFB block has been successfully set up.
13:08
Next, we are going to demonstrate automatic screen capturing in action.
13:12
Navigate to the Variable Inspector window at the top.
13:16
In here we have added all our UDFB variables.
13:20
We will start by assigning what screens we want to be captured.
13:24
We will set the first screen to 1 and our last screen to 15.
13:30
So all our screens from 1 to 15 will now be captured.
13:35
Now, if we set enable to 1, we can watch as our screen counter increases as captures are taken.
13:44
Each screen will take a few seconds to capture.
13:46
For our demonstration, this means we will only be waiting a few seconds.
13:51
But for larger applications, with more screens, this process could take several minutes.
13:58
Once every screen has been captured, we will see our done variable change to on, so we change engage back to off to stop the process and now we are going to extract our SD card and view our captures on our computer.
14:17
Here we have the memory card and as we can see a folder called screens has been created.
14:23
If we look inside this folder we can see all the captures named sequentially as we intended. If we open one of these images the capture is perfect.
14:33
We have successfully set up automatic screen capture on our Horner device.
14:41
That concludes our webinar for today. Thank you so much for listening and the Q &A session will begin shortly.
14:54
Okay, so next week we have the indirect move instruction.
14:59
Registration is on the website if you haven’t already got that from the newsletters.
15:03
I don’t see any questions coming in on today.
15:07
So I think in that case we can leave it here.
15:09
Thank you all very much and we’ll see you next time.







