moxa white paper---methods for embedding video streams … · methods for embedding video streams...

28
Moxa White Paper Released on April 24, 2009 Copyright © 2009 Moxa Inc. All rights reserved. Moxa manufactures a wide array of device networking products for industrial automation. Information about all Moxa products, which include embedded computers, Ethernet switches, wireless solutions, serial device servers, multiport serial boards, media converters, USB-to-serial converters, embedded device servers, video networking products, and industrial I/O solutions, is available on Moxa's corporate website at www.moxa.com . How to contact Moxa Tel: 1-714-528-6777 Fax: 1-714-528-6778 Web: www.moxa.com Email: [email protected] This document was produced by the Moxa Technical Writing Center (TWC). Please send your comments or suggestions about this or other Moxa documents to [email protected]. Methods for Embedding Video Streams in SCADA Systems Harry Hsiao, Product Manager, Industrial Video Networking Product Division [email protected] Overview In industrial automation systems, SCADA/HMI plays an important role in remote monitoring and control. Accompanied by the popularity of IP video surveillance solutions, there is a trend towards using IP video with SCADA/HMI systems to augment remote monitoring since seeing the field site situation is more comprehensible and convincing than reading alarm messages displayed on a screen. Unlike general I/O data that is familiar to automation engineers, IP video streams require considerably more time and effort to understand the SDK documents, programming code, and trial and error tests. This white paper provides some tips for embedding video streams into your SCADA systems for viewing and camera control. A Good Tool: ActiveX Control SDK Most IP video devices provide ActiveX Control components for video decoding and related process handling in Internet Explorer. ActiveX Control is an OCX component that uses Microsoft COM (Component Object Model) technology to enable software components to communicate. It is not only widely used with platforms that support WIN32, IE Plug-in, and Visual Basic, but also popular in automation system software

Upload: vonga

Post on 22-Apr-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper

Released on April 24, 2009 Copyright © 2009 Moxa Inc. All rights reserved. Moxa manufactures a wide array of device networking products for industrial automation. Information about all Moxa products, which include embedded computers, Ethernet switches, wireless solutions, serial device servers, multiport serial boards, media converters, USB-to-serial converters, embedded device servers, video networkingproducts, and industrial I/O solutions, is available on Moxa's corporate website at www.moxa.com. How to contact Moxa Tel: 1-714-528-6777 Fax: 1-714-528-6778 Web: www.moxa.com Email: [email protected]

This document was produced by the Moxa Technical Writing Center (TWC). Please send your comments or suggestions about this or other Moxa documents to [email protected].

Methods for Embedding Video Streams in SCADASystems

Harry Hsiao, Product Manager, Industrial Video Networking

Product Division

[email protected]

Overview In industrial automation systems, SCADA/HMI plays an

important role in remote monitoring and control. Accompanied

by the popularity of IP video surveillance solutions, there is a

trend towards using IP video with SCADA/HMI systems to

augment remote monitoring since seeing the field site situation

is more comprehensible and convincing than reading alarm

messages displayed on a screen. Unlike general I/O data that is familiar to automation

engineers, IP video streams require considerably more time

and effort to understand the SDK documents, programming

code, and trial and error tests. This white paper provides some

tips for embedding video streams into your SCADA systems for

viewing and camera control.

A Good Tool: ActiveX Control SDK Most IP video devices provide ActiveX Control components for

video decoding and related process handling in Internet

Explorer. ActiveX Control is an OCX component that uses

Microsoft COM (Component Object Model) technology to

enable software components to communicate. It is not only

widely used with platforms that support WIN32, IE Plug-in, and

Visual Basic, but also popular in automation system software

Page 2: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 2 of 28

such as SCADA. Therefore, most IP video device suppliers

provide ActiveX Control SDKs (software development kit) for

convenient integration with other Windows-based platforms. In

the following section, we will use VPort ActiveX SDK PLUS to

illustrate how to embed IP video streams into two popular

SCADA systems: Citect and Intouch. The first step is to install

VPort ActiveX SDK PLUS onto the PC or server that is running

your SCADA software.

Using VPort ActiveX SDK PLUS with Citect 1. Click the ActiveX icon from the tool box (Figure 1).

Figure 1

Click here

Page 3: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 3 of 28

2. Choose VPortSDK Control (Figure 2.1) from the ActiveX Controls list. The VPortSDK

components will then appear on the main screen (Figure 2.2).

Figure 2.1

Figure 2.2

Page 4: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 4 of 28

3. Double click on the VPortSDK icon and a window like Figure 3.1 will appear. You can get

the Object Name under Access Identification (AN202 in the following figure). You

can then add a new button to the main screen (Figure 3.2) by choosing Input and

adding the required code for the Down command (Figure 3.3).

Example:_

ObjectSetProperty(ObjectByName("AN202"),"ServerIP", "192.168.127.100");

ObjectSetProperty(ObjectByName("AN202"),"VideoProtocol", 1);

ObjectCallMethod(ObjectByName("AN202"),"Connect");

Figure 3.1

Page 5: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 5 of 28

Figure 3.2

Figure 3.3

Page 6: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 6 of 28

4. Then, Compile and Run. You can view the video stream in the Citect window.

Page 7: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 7 of 28

Using VPort ActiveX SDK PLUS with Intouch 1. Set up the new window in Intouch WindowMaker (Figure 1.1).

Figure 1.1

Page 8: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 8 of 28

2. Right-click on Configure Wizard/ActiveX Installation in the tree menu. Then, click

on Open and select ActiveX Control Installation in the Wizard/ActiveX

Installation dialog box to install VPortSDK Control (Figure 2.1).

Figure 2.1

1.

4

3

2

Page 9: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 9 of 28

3. Choose the Wizard Selection icon from the top toolbar. Then click on VPortSDKCtrl

(Figure 3.2).

Figure 3.2

1.

4

32

Page 10: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 10 of 28

4. Add a new button, and select the Action checkbox. After that, click on the Action

button (Figure 4.1) and a window will appear as shown in Figure 4.2. Select Insert

ActiveX Control from the top toolbar and set up the Method/Property in the ActiveX

Control Browser (Figure 4.3). Then, set up the related parameters for each property

(Figure 4.4).

Figure 4.1 Figure 4.2

Figure 4.3

1

2

4

3

Page 11: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 11 of 28

Figure 4.4

5. After completing all the above steps, Save the file and Run it (Figure 5.1).

Figure 5.1

5

Page 12: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 12 of 28

From the above instructions, you can see only a few steps are

needed to embed IP video streams into your SCADA system by

using ActiveX Control components. Of course, there are plenty

of functions supported by ActiveX Control SDK for video

streams and camera control, such as Connect, Disconnect,

Decode, Get Snapshot, Media Type, etc. Most system

integrators can benefit from these functions to build a

comprehensive SCADA/HMI system with IP video surveillance. In the next section, we will introduce a method familiar to

automation engineers to set up and control an IP video device

from the SCADA/HMI system. Modbus/TCP is the most

commonly used communication protocol in SCADA/HMI

systems. An IP video device should support the Modbus/TCP

protocol in order to make use of it. Here, we use Moxa’s VPort

254, a 4-channel industrial video encoder, with Citect SCADA

software as an example.

Using the VPort 254’s Modbus/TCP with Citect1. Connect

1.1. In the project setup window, click on OK after creating a new project for ModBus_Demo. The new Modbus_Demo project will be displayed on the project list of Citect Explorer.

Page 13: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 13 of 28

1.2. Click on the new ModBus_demo project and choose Communications to set the parameters for communications and connections.

1.3. There are several items under Contents of Communications. Choose Express I/O Device Setup, and the Express Communications Wizard will initiate setup.

1.4. On the 1st page of the wizard, there is a simple description for each function and

purpose. Click on Next to continue.

1.5. On the 2nd page, you will need to set up the I/O Server Name for this project. The default name is IOServer. Click on Next when you have finished.

1.6. On the 3rd page, you will need to set the I/O Device Name for the connected device. The default name is IODev. Click on Next when you have finished.

Page 14: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 14 of 28

1.7. On the 4th page, choose External I/O Device for the I/O Device type and click on Next to continue.

1.8. On the 5th page, choose Modicon TSX Quantum Ethernet (TCP/IP) to

select the Driver Type. Click on Next to continue.

1.9. On the 6th page, set up the IP address and TCP port for the connection. Be certain to select TCP for the protocol. When you have finished, click on Next to continue.

1.10. On the 7th page, you can set up whether to read the external database or not. Then, click on Next to continue.

1.11. On the 8th page, you can see a complete list of configurations to be made. Click on Complete once you have confirmed all the settings.

Page 15: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 15 of 28

2. Configure Data Tag

2.1. Click on Tags after you finish configuring the tags for Communications.

2.2. If you want to monitor DI1 (Digital Input 1) of the VPort 254, then configure the

Variable Tags setup page as follows:

Variable Tag Name: VPort254_DI1

Data Type: INT

I/O Device Name: IODev

Address: 30129

Page 16: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 16 of 28

2.3. The Address can be obtained from the Modbus Address Map. The Address of DI1

is 0x0080, which can be transferred to 128 in decimals.

2.4. Different function codes have different address definitions in Citect. For example,

the address definition of Output Coils in the figure below is 00001-099999,

Input Status is 10001-199999, and Input Register is 30001-399999.

2.5. Since the VPort 254’s Modbus/TCP Server currently only supports Input

Register, the Address is 128 plus 30001.

Page 17: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 17 of 28

2.6. Since the UnitID of the VPort 254 is fixed at 1, additional setup is required. Click

on I/O Devices of Communications in Citect Explorer to display the content for

the Modbus_Demo project in Citect Project Editor.

2.7. Input 1 in the Address column refers to the UnitID 1 for communications. If the

address is incorrect, communication between Modbus_Demo and the VPort 254

will fail.

Page 18: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 18 of 28

2.8. Since the initial Citect address for Modbus is 40001, you must change the initial

address to 30001.

2.8.1 Select Help Driver Help in Citect Explorer to open the Citect Driver

Help menu.

2.8.2 Select the Content tab in the Help menu and open MODNET

Parameters.

2.8.3 There will be a series of setup items under Parameters. The [MODNET]

InitVar column confirms if the Device connection at startup was

successful or not. The default value is 40001, but the VPort 254 only

supports the function code for Input Register. So, the address of 40001

does not exist on the VPort 254.

Page 19: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 19 of 28

2.8.4 To change the 40001 address to 30001, click on Click here to view/edit

the values for this parameter and then change the value of InitVar to

30001. Click on Confirm to complete setup.

2.9. After you finish configuring, you can start compiling the tags. Click on File

Compile and then wait for the compilation process to complete. A Compilation

successful dialog box will appear.

3. Design Graphics

3.1. After completing the configurations for Communications and Tags, you can design

the presentation user interface.

3.2. In Citect Explorer, go to Graphics Pages, double-click on Citect Graphics

Builder and the setup window will appear.

Page 20: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 20 of 28

3.3. In the Citect Graphics Builder setup window, select your preferred template, such

as Normal or XP_Style, from the Template List.

3.4. From the menu bar, select Objects Number to display the return values as

numbers.

3.5. Place the Object a blank section of the screen, and the setup window for this

Object will appear.

3.6. You must set up the Type, Numeric Expression, and Format.

3.7. There is no need to change the Type because it is automatically displayed.

Page 21: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 21 of 28

3.8. In the Format list, select #### to represent values that do not have digits after

the decimal point.

3.9. Click the icon to the right of Numeric Expression and select Insert Tag… to

display the designated Tag List. Select the tag you want to use.

Page 22: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 22 of 28

3.10. After setting the values, choose Objects Symbol Set if you want to use a light

to indicate the status.

3.11. Drag the Symbol Set to a blank section of the screen and the Symbol Set setup

window will appear. It is just like the Number setup window except for the

additional Type box on the right.

3.12. Since the status for DI1 is 0 OFF and 1 ON, you must select Multi-state for

the Appearance Type.

Page 23: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 23 of 28

3.13. In the Conditions setup box, configure A as VPort254_DI1=0 and B as

VPort254_DI1=1. The rule is that the light will be green when A is valid, and the

light will be red when B is valid.

3.14. After the screen is designed, Save the screen and click Compile on the File menu.

Compilation is complete when the Compilation successful message appears.

Page 24: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 24 of 28

4. Run

4.1. After completing the design and compilation of the Graphic, you can start to run

the project screen.

4.2. Choose Run from the File menu in the Citect Graphics Builder to go to the Start

screen.

4.3. In the Start screen, choose Pages Update Page List Page Name after the

compilation appears. Select this page for the next step.

4.4. After the page is selected, if DI1 of the VPort 254 is off, then the light will be green,

and the number will be 0; if DI1 is on, then the light will be red and the number

will be 1.

Now, we can combine Modbus/TCP protocol design with the

previous ActiveX Control SDK design.

Using the VPort 254’s Modbus/TCP with the Connect Function of VPort ActiveX SDK PLUS

1. Create a new ModBusDemo Cicode page in Cicode Files.

Page 25: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 25 of 28

2. Edit ModBusDemo.ci

After creating the new page, add the Demo_Connect function.

EX:

FUNCTION Demo_Connect() IF CH1_VideoStatus=1 THEN

_ObjectCallMethod(ObjectByName("VPort"),"Disconnect");

ELSE

_ObjectSetProperty(ObjectByName("VPort"),"ServerIP", "192.168.127.101");

_ObjectSetProperty(ObjectByName("VPort"),"VideoProtocol", 1);

_ObjectSetProperty(ObjectByName("VPort"),"IgnoreCaption", 1);

_ObjectCallMethod(ObjectByName("VPort"),"Connect");

END

END

3. Choose Objects Cicode Object in Citect Graphics Builder.

Page 26: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 26 of 28

4. Select Demo_Connect from the Insert Function list.

5. Compile and Run the project.

DI1 Off

Page 27: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 27 of 28

When DI1 is triggered, the above window will appear and VPortSDK can

automatically connect to the video encoder.

Page 28: MOXA White Paper---Methods for Embedding Video Streams … · Methods for Embedding Video Streams in SCADA ... from the SCADA/HMI system. Modbus/TCP is the most ... 2.8.1 Select Help

Moxa White Paper Methods to Embed Video Streams in SCADA

Copyright © 2009 Moxa Inc. Page 28 of 28

Summary

ActiveX Control components offer an easier and quicker way to

embed IP video streams into a SCADA/HMI system. Although

the ActiveX Control SDK can also support the controls and

configurations, it would be more beneficial to use Modbus or

TCP protocols for these functions because they are more

familiar to automation engineers. Even though there may not

be a best method according to the integration viewpoint, the

optimal method would allow engineers to do their job quickly,

precisely, and easily with the most familiar tools. Moxa is dedicated to developing industrial video networking

solutions for automation systems and applications. You are

welcome to contact us with any questions or suggestions

related to embedding video streams into SCADA/HMI systems,

or other types of automation systems. Email inquiries can be

sent to [email protected].

Disclaimer

This document is provided for information purposes only, and the contents hereof are subject to change without

notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions,

whether expressed orally or implied by law, including implied warranties and conditions of merchantability, or

fitness for a particular purpose. We specifically disclaim any liability with respect to this document and no

contractual obligations are formed either directly or indirectly by this document. This document may not be

reproduced or transmitted in any form for any purpose, without our prior written permission.