Control systems are often critical in nature – and they’re not always located in secure areas. How can you add an element of security to your remote equipment, and even alarm and record unwanted intrusions or unauthorised activity? Join us as we outline a variety of strategies to accomplish these goals that are becoming more and more important in automation these days.




0:15

Hello and welcome to today’s webinar.

0:18

Today we will look at Capturing Video Skills for Machine Security. Let’s look at our agenda for today.

0:24

We will begin by addressing the important question, what do we mean by machine security and why should we be concerned about From there we will move on to some key features of Horner OCS all in one controller and we will show you how to connect a camera, capture a still image and send that image as an email notification.

0:42

These are practical and efficient features that come built into most Horner OCS controllers and we will walk you through how to use them to accomplish this particular goal and there will be demonstrations throughout and we will finish with a Q &A session.

0:56

So what do we mean by machine security?

0:58

typically as control engineers.

1:00

When we think about PLC and security concerns, we are often referring to measures that keep personnel safe, such as using safety equipment like safety gates and similar components.

1:11

We also might be referring to protecting our programs with passwords. Save care with the intellectual property built into the machine.

1:18

The logic that we have programmed into it is protected so it cannot be stolen or uploaded without authorization.

1:24

In other cases, machine security may involve securing remote access to the machine over a network or internet connection, perhaps through the use of specialized internet connected devices.

1:36

However, our focus for today is not on those types of security measures.

1:40

In today’s presentation, we are addressing physical machine security.

1:44

So why should we focus on physical machine security?

1:46

There is a wide range of automated machinery in use today, but within factories and remote locations, equipment used outside of a traditional factory setting in particular should be secured for several important reasons.

1:59

One of the most obvious in public safety, it is essentially to prevent unauthorised individuals from coming into contact with automated equipment which could result in serious injury.

2:09

Other critical concern is the risk of malicious interference, we want to ensure that individuals with harmful intent cannot access or damage equipment or carry out acts of sabotage.

2:20

There are just a few clear reasons why securing remote equipment is essential.

2:24

Additionally, there are also compelling reasons to apply physical security measures within factory environments which we will discuss later in this presentation.

2:33

What we are going to cover today is how to connect a USB camera to the Horner OCS.

2:38

We will also discuss how to detect an event that triggers a response.

2:42

While we will mention different types of events that could be detected, we will not focus heavily on the specific steps involved in event detection.

2:50

as this can vary depending on the application.

2:52

In some cases it may be as simple as the sensor being activated.

2:56

The main objective is to show you how to capture a still image from a connected video camera and then send that image as an email notification and our focus would be on the canvas series of Horner all-in-one controllers.

3:08

Let’s begin with step one which is connecting a usb camera, the prime series, the canvas series and several other products in the Horner product line support UVC video.

3:19

UVC or USB video class is a video format commonly used by the USB webcams.

3:25

However, there are many USB cameras beyond standard webcams that also support UVC. For example, we have shown on the screen a USB security camera that uses its interface.

3:35

As mentioned, today’s presentation will focus on performing this workflow.

3:40

Using the Canvas series, USB cameras connect to the Horner OCS through a USB-A port, which serves as a host port.

3:47

The camera can be connected directly to this port or through a USB hub.

3:51

If the hub is used, it is possible to connect up to four USB cameras to the OCS labeled as camera one through camera four.

3:59

One important point to keep in mind is that the camera numbering within the Horner OCS from the perspective of your control program depends on the order in which the cameras power up.

4:08

Therefore, it is important to connect and power them in consistent sequence so that each camera retains its assigned number.

4:15

So what do we need to do besides physically connecting the camera to the USB port on the Horner controller inside the user interface configuration area when you are configuring a screen and in Cscape 10 you configure your screen from the screen tab but inside that project toolbox when you are editing a screen is the live graphics data area in the toolbox and there is a video object you click on that video object and then you can drag inside the screen, where video will be displayed in real time, at runtime, and then you have the ability to configure that dialog box.

4:47

Played on the screen, the configuration options available for the video object.

4:51

There are two primary modes for using the video object.

4:54

It can be used to playback pre-recorded video files, such as help files, or it can be used for streaming live video.

5:02

In this case, we are focusing on streaming live video, so the first step is to ensure that the stream option is selected in the upper left corner of the configuration dialogue.

5:11

Next to camera channel, number must be specified.

5:14

If only one camera is connected, the value should be set to a constant of 1.

5:18

For multiple cameras, the value should be set to 1, 2, 3 or 4, depending on the desired camera.

5:24

A variable can be used to dynamically select the camera number. There is also a trigger variable associated with the video object.

5:31

This is a boolean array, and although the dialog is in Cscape 10.1, service pack 1, displays the requirement for 8 boolean bits. The correct configuration requires an array length of 16.

5:42

The first bit in this array is used to control the start and stop of the video stream from the camera. Additionally, a status register can be assigned.

5:51

This register provides feedback on the video’s object status, such as whether the video is playing, whether the controller failed detect a camera or whether the selected camera is outputting an unsupported frame rate.

6:03

For example, a value of 0 may indicate that no camera was found or no camera number is selected, while a value of 64 may indicate an unsupported frame rate from a connected camera.

6:14

At runtime, the video object includes an escape button or back arrow which can be configured to either return to the previous screen or jump to the designated screen.

6:23

The video display can also be configured with either a 16×9 or 4×3 aspect ratio.

6:30

Most modern cameras typically use a 16×9 aspect ratio which is often set as the default.

6:36

Placing the video object on the screen is necessary because it provides a designated area for the live video feed to be displayed.

6:44

The display is required in order to perform a screen capture of a video at the later stage.

6:50

Step 2 is to detect an event.

6:52

While we will not cover a detailed process of event detection, it is important to understand the types of events that might trigger a screen capture.

7:00

For example, a screen capture could be initiated when a safety gate opens or is unplugged.

7:06

This allows a system to record video evidence showing who accessed that area, whether it is an authorized person or a member of the public. Another scenario might involve capturing an image.

7:16

Whenever an operation logs in or attempts to log in on the touchscreen, this helps verify whether the person interacting with this machine is authorized.

7:25

Similarly, if someone attempts to use a touchscreen after hours, a screen capture could be triggered to document the event.

7:32

Motion detection after hours is another potential trigger for capturing an image.

7:36

These events are typically easy to detect using appropriate sensors, situational logic or program conditions.

7:43

Detecting a touchscreen Press can be achieved by monitoring system registers that report the coordinates of current touches.

7:50

If the machine is not supposed to be running at a particular time, such as midnight, any touchscreen interaction at that time could trigger a screen capture.

7:58

This example shows how an event detection can be integrated into the control logic to initiate video capture.

8:05

Step 3 involves setting up a capture capability to enable still image capture from the video After completing Step 1 by connecting the camera and programming the video object on the screen and Step 2 by detecting an event to trigger the capture, the next step is to configure the screen capture feature.

8:22

In CSCAPE 10, navigate to the Project Navigator section.

8:26

Under User Interface, ensure that a screen is currently assigned to a screen tab.

8:30

Once this condition is met, right-click under User Interface and select the Screen Capture option from the Configuration menu.

8:37

This option opens the screen capture dialog.

8:40

Configuring the screen capture feature is straightforward.

8:43

First assign a boolean variable that will serve as a trigger to initiate the screen capture.

8:48

Then specify the file name for the captured image to ensure that each captured image has a unique file name. It is common to use wild characters in the file name.

8:58

For example, the file name and path may include a folder named capture is followed by a slash to indicate the destination directory of the image.

9:07

The filename can be composed of dynamic elements such as the current hour and minute in two-digit format, followed by a dash and a file counter that increments from 00 to 99.

9:19

This counter functions similarly to the automatic numbering found in digital cameras or smartphones preventing files from being overwritten.

9:26

The image format is typically in JPEG.

9:29

Using this naming convention with the hour, minute and two-digit file, counter ensures that each captured image has a unique file name and is stored correctly without overwriting previous files.

9:40

To take advantage of file name counter, you access that within the project navigator of Cscape.

9:45

Ensure that a screen is assigned to active screen tab and is open for editing.

9:50

Right click on user interface and through the configuration menu, select file counters.

9:55

This will open a dialog box displaying four available file counters that can be used for renaming files.

10:01

Each file counter can be configured with a maximum value up to double integer, allowing for every layered range of counts significantly higher than the example of 99 used previously.

10:12

These file counters provide flexible options for construction unique file names for the screen captures.

10:18

It is important to remember that these are screen captures which require the presence of a video object on the screen.

10:25

The video object enables the video feed to be displayed and included in the screen capture.

10:30

In step 4 the captured image will be sent via email as a notification to designated personnel.

10:36

This allows relevant individuals to be informed of events such as operator log-ins, unauthorized access attempts or after-hours incidents.

10:45

It is important to note that not only every screen capture or still image needs to be emailed.

10:50

For example, capturing an image each time an operator logs in does not necessarily require immediate email notification.

10:57

However, If certain situations will warrant sending the image via email for prompt awareness, we will explain how to ensure that the captured image is attached to an email notification.

11:07

The process begins by accessing the email configuration settings.

11:11

You need to navigate to the Outgoing Messages section within the email configuration.

11:16

There you will add a new message and configure it to a server as a notification indicating that an event has occurred.

11:22

This image will indicate the still image captured from the video camera as an attachment.

11:28

On the next screen, all the details for setting up the email with the file attachment are provided.

11:33

The key element for attaching the file is located at the bottom of the dialog box.

11:38

There is a checkbox labeled Attach File in the lower left-hand corner.

11:42

Once checked, the file will be attached.

11:44

Can be specified using the drop-down menu with several options.

11:48

The simplest method is to select the latest file option.

11:51

This attaches the most recent saved file in the specific directory or file path, eliminating the need to specify the exact file name.

12:00

This is a recommended approach for ease of use.

12:02

A specific file name can be typed in, however wildcarrots cannot be used with this method, which is generally not advisable.

12:10

If multiple files are captured, it is possible to send a successful email by attaching the latest file and the one prior to the latest, potentially with different time delays between captures.

12:20

These options provide flexibility in setting up email notification.

12:24

Logic is required to manage the sequence of steps that lead in sending an email with an attached image.

12:29

Although the logic is not complex, it is necessary to detect an event that initiates a process such as sensor activation.

12:36

Once the event is detected, the camera is triggered to ensure that it is activated.

12:41

The logic then automatically searches the screen displaying a video object showing the live video feed from the camera.

12:47

Following this, the camera capture trigger is activated.

12:51

A delay is incorporated typically around 2 seconds to allow the image to fully display on the screen before capturing.

12:57

If multiple images are to be captured, additional delays and triggers can be programmed accordingly.

13:03

After capturing these required images, the logic switches back to the home screen and it activates the camera trigger.

13:09

Finally, the email trigger is activated to send a notification.

13:13

It is important to note that when The screen capture triggered is activated, the OCS firmware automatically deactivates it once the capture is complete.

13:21

The same applies to the email trigger, which is turned off by the firmware upon completion of the email transmission.

13:27

This sequence outlines the necessary programming steps to implement the process.

13:32

For our demonstration, let’s start by taking a look at our example program in Cscape for today’s application.

13:38

Let’s just go through step by step, so the first step was connecting a USB camera and a video object. We have got a screen here that we have created.

13:48

Let’s pull it up and the key part of the screen is the video object here, which a majority of the screen is the video object itself because we want as large as possible of the image on the screen here.

13:59

Now we are dealing with a 7 inch unit.

14:02

If you have a 10 inch unit, you can have a large display. If you have a smaller unit, you’re going to have a smaller image here.

14:08

So this our video object you can find it under live graphic data under video so we click here drag and size it when we configure it the key things here are we just have one camera so we just hard coded in our camera number we set it to stream we have assigned a trigger variable it is important that this is a boolean array of 16 over larger we are referencing a 16 bit array here we have got our word count status registered that we can monitor that tells us everything is working or not, we are using a 16 by 9 aspect ratio and we are stimulating escape on the screen.

14:44

So here is the back arrow on the video object at runtime, when we press the back arrow what will happen?

14:50

Well in our case it is going to stimulate an escape so any jump button that is jumping to the screen, we could then escape back as long as the jump button on the other screen was configured properly to support an escape to return or we could just use this like a button and configure a screen number here to jump to every time.

15:10

The other things we have done in this screen is we have put the time on the date here so that we have another record in our screen capture of what time and date this was captured and then we put an escape key up here so we could escape back to our home page in this case.

15:25

So this is creating a video screen that will be where our screen capture of our video still comes from. That was step one.

15:32

Step 2 was to detect an event so that is where we would have logic here in our program that would detect that an event has occurred but in this case we are doing it manually to stimulate the event happening so we do not have any logic for that.

15:47

Next is step three which is capturing a still image let’s do that next.

15:51

Remember to capture a still image we have to configure the screen capture feature now if we right click here on the user interface and we go to configure you will see that our screen capture is not configurable that is because our currently open tab is the logic tab not a screen tab so if we go to screen tab and have that open when we go back to the user interface right click and hit configure then we have all the options here and we could put up the screen capture in our case we have a single bit that is boolean type variable that we are going to trigger to cause the screen capture to occur.

16:24

We have chosen a file name that includes hours, minutes and screen counter.

16:29

Now JPEG is what you want to use for this, that is a configuration for the screen capture.

16:34

The next step then is to set up an email that will take that image and send it off to the desired recipient.

16:40

So for that we are going to go up here to the messaging area and select an email and then going outgoing messages and then typically we would add a new message.

16:50

we have already got a new message for the intrusion.

16:53

So let’s take a look at it.

16:54

So this is who we want to email it to, the email group.

16:58

So there is one or more email messages that this will go to.

17:01

Here is the contents.

17:02

We would add real time data if we wanted to do that, but we are not going to in this example.

17:08

And then this is where we attach the file along with our path.

17:12

Now if we wanted to save to a USB and had a USB drive plugged in to a USB hub along with a camera, then we might have a B path here but it is recommended to use micro SD and in this case we have a path specified which is a capture directory and we are going to attach the latest file in that directory and here is some of the choices that show up without scrolling down through the list and the latest file is almost always going to be your easiest configuration so that is what we need to do in terms of the four different steps.

17:44

The last important step is you need some logic to make all this happen and this is what we have so this is our procedure spelt out in our documentation always important to document your logic and then we have set up some simple logic here we have got a series of bits which are an array of bits that we call capture step from 0 to 15 because we have allocated up to 16 steps and what we are doing here is we are starting by when our event is detected we are turning on a one shot so that the process gets started and executed only once, and that is when our event occurs.

18:19

So when we start the capture process, we turn on our camera trigger, we switch to the screen that has our video object on it, we wait a couple of seconds, after that happens we turn on our screen capture bit, after another second we do another screen capture, because our example we are doing two frames captured a second apart, remember we turn this bit on and the OCS firmware turns it off for us.

18:43

That is why it is a set.

18:45

And then we do our second screen capture.

18:47

We turn this on and the OCS firmware turns it off for us.

18:51

And then when that is done, after a second or so, later we switch back to our home screen.

18:56

We turn off our camera trigger and then we turn on the bit that triggers the particular intrusion email.

19:03

And again, like other trigger bits, we turn it on and the OCS firmware will turn it off.

19:08

So that is the logic for making all this happen Let’s take a look at what happens on the bench.

19:14

Here we are on the bench with our example program that we showed you in seascape.

19:18

We have got our camera connected here to a USB port.

19:22

We can go ahead and go to the security camera area.

19:24

You can see this is where we have our video screen.

19:28

You will notice that there is no video playing right now because the camera is not triggered.

19:32

So we are going to go ahead and trigger it now.

19:35

You will notice it takes a couple of seconds so that is our video screen.

19:39

that is what is going to be triggered or that is what the image that is going to be triggered when we go through that process we showed you in the logic.

19:47

Now also in this example are the stranded dialog boxes so this is a standard option for the email and the LAN setup and you can see there are multiple screens available for setting up your email address and testing them.

20:00

So let’s say we have disturbance or some sort of event that we want to capture you would logic in your program that detects that event.

20:08

In our case we have got a button for doing a screen capture. So let’s go and initiate the process now. You can see that we switched screens.

20:16

The video turned on within about a second or so and that process was complete.

20:20

It only took a few seconds to complete and then part of that process should also be sending off an email.

20:26

So let’s see if the email got through. And there it is. Let’s go ahead and highlight that.

20:31

An intrusion was detected. Attached is a still photo at the time of the intrusion.

20:36

Let’s take a look at the image. That concludes our webinar for today.

20:40

Thank you so much for listening and the Q &A session will begin shortly.

21:09and we’ll see you next time.