Nothing Special   »   [go: up one dir, main page]

DSEM870 CODESYS Software Manual 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 38

DEEP SEA ELECTRONICS

DSEM870 & DSEM871 CODESYS Software


Manual

Document Number: 057-320


Author: Anthony Manton

057-320 ISSUE: 6
DSEM870 & DSEM871 CODESYS Software Manual

Deep Sea Electronics Ltd


Highfield House
Hunmanby
North Yorkshire
YO14 0PH
ENGLAND

Sales Tel: +44 (0) 1723 890099

E-mail: sales@deepseaelectronics.com
Website: www.deepseaelectronics.com

DSEM870 & DSEM871 CODESYS Software Manual

© Deep Sea Electronics Ltd.


All rights reserved. No part of this publication may be reproduced in any material form (including
photocopying or storing in any medium by electronic means or other) without the written permission of
the copyright holder except in accordance with the provisions of the Copyright, Designs and Patents
Act 1988.
Applications for the copyright holder’s written permission to reproduce any part of this publication
must be addressed to Deep Sea Electronics Ltd at the address above.

The DSE logo and the name DSEControl® are UK registered trademarks of Deep Sea Electronics Ltd.

Any reference to trademarked product names used within this publication is owned by their respective
companies.

Deep Sea Electronics Ltd reserves the right to change the contents of this document without prior
notice.

Revision History

Issue No. Comments


5 First release of the document as a separate manual taken from 057-246 DSEM870
Operator Manual V4.
Additional information applicable to M870 V5: SVG images, Manual Shutdown
function, Camera Mirror parameter.
6 Added DSEM871

057-320 ISSUE: 6 Page 2 of 38


DSEM870 & DSEM871 CODESYS Software Manual

TABLE OF CONTENTS
Section Page
1 INTRODUCTION .................................................................................................. 5
1.1 CLARIFICATION OF NOTATION ............................................................................................ 6
1.2 GLOSSARY OF TERMS .......................................................................................................... 6
1.3 RELATED INFORMATION ...................................................................................................... 7
1.3.1 TECHNICAL INFORMATION ............................................................................................ 7
2 CONNECTING TO CODESYS ............................................................................. 8
2.1 START NEW PROJECT .......................................................................................................... 8
2.2 CONNECT BY AUTOMATIC SCAN ........................................................................................ 9
2.3 CONNECT BY IP ADDRESS ................................................................................................. 11
2.4 CONFIGURE SETTINGS AND MONITOR THE DEVICE ..................................................... 12
2.4.1 DEVICE SETTINGS PARAMETERS .............................................................................. 12
2.4.1.1 ETHERNET PARAMETERS .................................................................................... 12
2.4.1.2 VOLTAGE REFERENCE ......................................................................................... 12
2.4.1.3 SCREEN ROTATION ............................................................................................... 13
2.4.1.4 PERSISTENCE SETTINGS ..................................................................................... 14
2.4.1.5 MANUAL SHUTDOWN ............................................................................................ 14
2.4.2 DEVICE SETTINGS I/O MAPPING................................................................................. 15
2.4.2.1 LED .......................................................................................................................... 16
2.5 UTILISING MANUAL SHUTDOWN ....................................................................................... 17
2.6 ADD INPUTS, OUTPUTS AND BUTTONS TO THE PROJECT ........................................... 18
2.6.1 BUTTONS AND ROTARY ENCODER ........................................................................... 19
2.6.1.1 BUTTON LOCATION ............................................................................................... 19
2.6.1.2 BUTTON POSITION ON THE VISUALISATION ..................................................... 19
2.6.1.3 BUTTON SETTINGS (F1 TO F11) .......................................................................... 20
2.6.1.4 ROTARY ENCODER (F12)...................................................................................... 21
2.6.2 INPUTS AND OUTPUTS ................................................................................................ 22
2.6.3 DIGITAL INPUT PARAMETER CONFIGURATION ........................................................ 23
2.7 USING THE DISPLAY IN THE PROJECT ............................................................................ 24
2.7.2 INSTALLING FONTS ON THE DEVICE ......................................................................... 25
2.7.3 USING CUSTOM IMAGES ON THE DISPLAY .............................................................. 25
2.7.3.1 ADDING AN IMAGE POOL...................................................................................... 25
2.7.3.2 ADDING IMAGES TO THE IMAGE POOL .............................................................. 25
2.7.3.3 USING THE IMAGE POOL ON THE DISPLAY ....................................................... 26
2.7.4 UTILISING THE TOUCHSCREEN AND WEBVISU ....................................................... 27
2.7.4.1 SWITCHES, SLIDERS, COMBO BOXES, RADIO BUTTONS ................................ 27
2.7.4.2 NUMBER AND TEXT ENTRY.................................................................................. 28
2.7.5 WEBVISU ACCESS ........................................................................................................ 29
2.8 USING THE CAMERA OVERLAY ......................................................................................... 30
2.9 M870CAMERAOVERLAYSETTINGS ................................................................................... 30
2.10 USING THE USB DRIVE WITHIN APPLICATIONS .......................................................... 31
2.11 USING PERSISTENT VARIABLES IN THE PROJECT .................................................... 32
2.12 ALTERNATIVE METHODS TO LOAD THE APPLICATION ............................................. 33
2.12.1 USB ................................................................................................................................. 33
2.12.2 DSESERVICETOOL PC SOFTWARE ............................................................................ 33
2.12.2.1 CREATION OF THE BOOT APPLICATION ............................................................ 33
2.12.2.2 UPDATE USING DSESERVICETOOL AND ETHERNET CONNECTION ............. 33
3 CODESYS ERROR CODES .............................................................................. 34
3.1 DEVICE .................................................................................................................................. 34
3.2 ANALOGUE INPUTS ............................................................................................................. 34
3.3 DIGITAL INPUTS ................................................................................................................... 35
3.4 DIGITAL OUTPUTS ............................................................................................................... 35
4 MAINTENANCE AND WARRANTY .................................................................. 36
5 DISPOSAL ......................................................................................................... 36

Page 3 of 38 057-320 ISSUE: 6


DSEM870 & DSEM871 CODESYS Software Manual

5.1 WEEE (WASTE ELECTRICAL AND ELECTRONIC EQUIPMENT) ..................................... 36


6 MISCELLANEOUS ............................................................................................ 36

057-320 ISSUE: 6 Page 4 of 38


Introduction

1 INTRODUCTION
This document details the CODESYS software programming requirements of the DSEM870 and
DSEM871 CODESYS Mobile Controller and Display, part of the DSEControl® range of products.

The manual forms part of the product and should be kept for the entire life of the product. If the
product is passed or supplied to another party, ensure that this document is passed to them for
reference purposes.
This is not a controlled document. DSE do not automatically inform on updates. Any future updates of
this document are included on the DSE website at www.deepseaelectronics.com

Observe the operating instructions. Non-observance of the instructions, operation not in accordance
with use as prescribed below, wrong installation or incorrect handling seriously affects the safety of
the product, operators and machinery.

A robust metal case designed for chassis mounting houses the module. Connections are via locking
plug and sockets.

The controller is supplied with no application program. The equipment manufacturer is responsible for
creating and managing the application program and installing it in the controller. This is achieved
using CODESYS V3.programming. Contact DSE Technical Support for further details.

Page 5 of 38 057-320 ISSUE: 6


Introduction

1.1 CLARIFICATION OF NOTATION


Clarification of notation used within this publication.

Highlights an essential element of a procedure to ensure correctness.


NOTE:

Indicates a procedure or practice, which, if not strictly observed, could


CAUTION! result in damage or destruction of equipment.

Indicates a procedure or practice, which could result in injury to


WARNING! personnel or loss of life if not followed correctly.

1.2 GLOSSARY OF TERMS


Term Description
Application The application is the program that allows the DSEM870 to control the
machine it is connected to.
The Application within the DSEM870 is designed and provided by the
manufacturer of the complete machine.
Bootloader The Bootloader is the program within the DSEM870 responsible for loading
the Operating System.
CAN Control Area Network. A high-speed data transmission system used
extensively within the Automotive and Off-Highway industries.
CODESYS Integrated Development Environment for programming controller
(Previously stylised applications according to the international industrial standard IEC 61131-3.
as CoDeSys) DSEM870 supports CODESYS V3.5
ECU Electronic Control Unit. For example the DSEM870 device.
Firmware The Firmware of the DSEM870 is the Operating System of the DSEM870
that reads and executes the Application program.
FSD Full Scale Deflection. For example 0 mA to 20 mA is the Full Scale
Deflection of a current sink input.
Input / Output. For example “The I/O is taken out to an external terminal
I/O
strip in the user panel”.
Integrated Development Environment. For example the CODESYS V3.5
IDE
application that runs on the host PC is an IDE.
An Input, where x is the connector and yyy is the input number. For
Ixyyy
example IC003 means Input 3 on Connector C.
PLC Programmable Logic Controller. Industrial computer used primarily for the
automation of electromechanical machinery.
PWM A digital signal is used to represent an analogue value by using Pulse
PWMi Width Modulation. The mark-space ratio of a square wave changes to
represent the value.
Used for many control applications including proportional valves.
PWM= Voltage control.
PWMi = Current control.
Off-Highway An industrial vehicle used primarily “off road”. For example construction
and farm machinery. A wider interpretation includes on road access
platforms, emergency vehicles and other industrial machinery, used either
on the road, or off road.
Pin A male or female pin connection in a housing (plug or socket).
Qxyyy An Output, where x is the connector and yyy is the output number. For
example QC002 means Output 2 on Connector C.

057-320 ISSUE: 6 Page 6 of 38


Introduction

1.3 RELATED INFORMATION


This document refers to and is referred by the following DSE publications which are obtained from the
DSE website: www.deepseaelectronics.com or by contacting DSE technical support: support@
deepseaelectronics.com.

1.3.1 TECHNICAL INFORMATION

DSE Part Description


057-246 DSEM870 Installation and Operation Manual
053-321 DSEM870 Qt Software Manual
053-187 DSEM870 Installation Instructions
055-199 DSEM870 Datasheet

Page 7 of 38 057-320 ISSUE: 6


Connecting to CODESYS

2 CONNECTING TO CODESYS

NOTE: DSEM870 supports CODESYS version 3.5.12.0. Ensure Compiler version,


Visualisation version and the versions of any 3S libraries used in the project are no later than
version 3.5.12.0. Contact support@deepsealectronics.com if assistance is required.

NOTE: Connector C is not fitted to DSEM871.

DSEM870 communicates with, and is programmed by, the CODESYS V3.5 Integrated Development
Environment (IDE).

2.1 START NEW PROJECT


To begin, start a new project as shown.

Within CODESYS V3.5, select


File | New Project

Select the variant and


version of the device to
create the project for.

Then click OK

057-320 ISSUE: 6 Page 8 of 38


Connecting to CODESYS

If you didn’t select a template from the previous dialogue, now select the model type

Choose the variant of device you have

And your
preferred
language for
PLC_PRG

Then click OK

2.2 CONNECT BY AUTOMATIC SCAN

NOTE: A device in System Settings or Bootloader mode cannot be found in the Scan and
cannot connect to CODESYS.

NOTE: The Scan requires the device to be on the same subnet as the PC. If this is not
possible, locate the IP address of the device and connect a detailed in the section entitled
Ethernet TCP elsewhere in this document.

NOTE: If the IP address of the device is known, connection may also be achieved
manually as detailed in the section entitled Ethernet TCP elsewhere in this document.

This method of connection is suitable only for devices in the same subnet as the PC.
With the device connected to the same Ethernet network as the PC, Select Device | Communication
Settings in the CODESYS V3.5 IDE.

Double-Click Device…

…then click Communication Settings

Click Scan Network.

Page 9 of 38 057-320 ISSUE: 6


Connecting to CODESYS

All devices found during the scan appear


in the Select Device window. The
displayed name is factory set to M870
and is changed in the Device Settings
screen.

Click a device to show its


details in the right pane.

Click Wink to change the selected


M840 LED to amber colour. This
verifies the device you have
selected. Click Wink again to return
the LED to normal behaviour.

Click OK to connect to
the selected device.

Successful connection is
shown by the green icon.

057-320 ISSUE: 6 Page 10 of 38


Connecting to CODESYS

2.3 CONNECT BY IP ADDRESS

NOTE: A device in System Settings or Bootloader mode cannot connect to CODESYS.

NOTE: If the IP address of the device is not known, see the section entitled Connect by
Automatic Scan elsewhere in this document.

This method of connection is particularly suited for devices on other subnets or networks, providing
the PC has a routable connection to the device.

Select Device | Communication Settings in the CODESYS V3.5 IDE.

Double-Click Device…

…then click Communication Settings

Where the IP address of the device is known, this is entered


directly into the address bar. Press Enter to make the connection.

Successful
connection is
shown by the
green icon.

Page 11 of 38 057-320 ISSUE: 6


Connecting to CODESYS

2.4 CONFIGURE SETTINGS AND MONITOR THE DEVICE

Select Device

...and then double-click


Device Settings…

2.4.1 DEVICE SETTINGS PARAMETERS

2.4.1.1 ETHERNET PARAMETERS

Parameter Description
Save Config Selects how ethernet settings are applied at device power up.

No: Ethernet settings are left unchanged and remain as they


were prior to the last shutdown.
Yes: Configured Ethernet settings are applied at device power
up. This may change settings in use at the time of the previous
power shutdown.
IP Mode DHCP: The device communicates with the DHCP server to
obtain network settings.
Static: Configured network settings are used. Ensure to select
Save Config: Yes to enable the settings to be applied at tne
next device power up.
IP Address Network settings to be applied when IP Mode: Static is selected.
Subnet Mask
Gateway Address
DNS Address
Hostname Hostname used by the device on the network.

2.4.1.2 VOLTAGE REFERENCE

Parameter Description
Voltage Reference Enables the VREF output. This is an auxiliary output supply
(max 100 mA) used for example to supply external input
sensors.

Disabled: The outputs is OFF.


5V: The output gives 5 V dc.
10V: The output gives 10 V dc.

057-320 ISSUE: 6 Page 12 of 38


Connecting to CODESYS

2.4.1.3 SCREEN ROTATION

Parameter Description
Screen Rotation
NOTE: After changing the setting of Screen Rotation,
DSEM870 must be power cycled for the change to take
effect.

NOTE: For Screen Rotation ROT_90 and ROT_270


(portrait mode) the Visualisation must be created
accordingly to fit to the full screen size as detailed below.
CODESYS does not automatically adjust the Visualisation
Size upon changes to the Screen Rotation setting.

Sets the device screen rotation.


ROT_0: Visualisation is not adjusted, to
suit the ‘normal’ device orientation with
the Encoder at the BOTTOM RIGHT of
the display.
(Landscape 800 px X 480 px)

ROT_90: Visualisation is rotated 90°


clockwise to suit the device orientation
with the Encoder at the TOP RIGHT of
the display.
(Portrait 480 px X 800 px).

ROT_180: Visualisation is rotated 180°


suit the device orientation with the
Encoder at the TOP LEFT of the display.
(Landscape 800 px X 480 px).

ROT_270: Visualisation is rotated 270°


clockwise to suit the device orientation
with the Encoder at the BOTTOM LEFT
of the display.
(Portrait 480 px X 800 px).

Page 13 of 38 057-320 ISSUE: 6


Connecting to CODESYS

2.4.1.4 PERSISTENCE SETTINGS

NOTE: These settings are available in DSEM870 V5.0 onwards. For versions 1 to 4, Ignition
pin must be removed to allow persistent values to be saved and begin the device shutdown
sequence.

NOTE: For details of Persistent Variables, see section entitled Connecting to CODESYS |
Using Persistent Variables in the Project elsewhere in this document.

Parameter Description
Active FALSE: Persistent Variables are not saved.
(V5,0 onwards) TRUE: Persistent Variables are cyclically saved
at the period of Time.
Time Applicable only when Active is set to TRUE.
(V5.0 onwards) Select the period (milliseconds) of the cyclic
saving of Persistent Vars.
Minimum Value: 1000 ms. Values below this
must not be used. This allows time for the device
to write to the Non-Volatile memory block.
Recommended Value: 1000 ms to 2000 ms.

2.4.1.5 MANUAL SHUTDOWN

NOTE: Manual Shutdown feature is available from M870 V5.0 onwards.

NOTE: For details how to operate Manual Shutdown, see section entitled Utilising Manual
Shutdown elsewhere in this document.

Parameter Description
Active FALSE: Persistent Variables are not saved.
TRUE: Persistent Variables are cyclically saved
at the period of Time.
Time Applicable only when Active is set to TRUE.
Select the period (milliseconds) of the cyclic
saving of Persistent Vars.
Minimum Value: 1000 ms. Values below this
must not be used. This allows time for the device
to write to the Non-Volatile memory block.
Recommended Value: 1000 ms to 2000 ms.

057-320 ISSUE: 6 Page 14 of 38


Connecting to CODESYS

2.4.2 DEVICE SETTINGS I/O MAPPING

NOTE: Connector C is not fitted to DSEM871. Inputs and Outputs are not available on
DSEM871.

This page is used to monitor the device, and if required, to map the monitored values to program
variables.

Parameter Description
Device Error Code A bitfield to allow the error code to be mapped to a variable.
This enables the application to decode and display internal
errors.

See Section Entitled M870 CODESYS ERROR CODES


elsewhere in this document for more details.
Device Temperature The actual temperature (°C) as measured within the device.
Typical temperatures are more than 25°C above ambient
temperature and vary depending upon device usage.
Battery Voltage The voltage measured at the ECU Power terminals, PINs A1
(-ve) and A7 (+ve).
Supply Voltage 1 The voltage measured at the Supply Voltage 1 terminals, PINs
C1 (-ve) and C7 (+ve). This voltage is used to supply the
device outputs on PINS C2, C3, C4 and C5 when configured
as Active High.
Ignition Switch Contains the state of the Ignition Switch on PIN A13. Upon
ignition removal the variable changes from TRUE to FALSE. A
short time later the device completes the shutdown process
and the application is shutdown.
Voltage Reference Provides the voltage of the VREF output on PINS C6 (-ve) and
C18 (+ve). This output is used as an auxiliary DC supply for
example to power input sensor devices.
Light Sensor Gives indication of the amount of ambient light detected by the
devices light sensor. This may be used for example to vary
Backlight according to local conditions.
(0 = Dark, 100 = Maximum Brightness)
Backlight Sets the percentage of the display LCD Backlight.
(0 = minimum, 100 = maximum).
Setting Backlight to the value 255 enables Automatic Backlight
Control whereby brightness automatically increases as
ambient light levels increase.
Keyboard Backlight Sets the percentage of the Keyboard surround Backlight.

Page 15 of 38 057-320 ISSUE: 6


Connecting to CODESYS

2.4.2.1 LED

NOTE: User configuration of LED is overridden upon system alarm.

NOTE: M870 LED is Tri-Colour, with options of Red, Green and Amber.

NOTE: DSE Standard library contains DSE.SystemSetLED to control the LED


programmatically.

Allows configuration of the System LED. Internal system errors take over control of the LED and
indicate the fault in Device Error Code.

Parameter Description
Colour Use enum DSE.LEDColour_t to select one of RED, AMBER,
GREEN.

Frequency: Use enum DSE.LEDFrequency to select one of Off, ONE_HZ,


TWO_HZ, THREE_HZ, FOUR_HZ, FIVE_HZ, SIX_HZ,
SEVEN_HZ, EIGHT_HZ, NINE_HZ, TEN_HZ, ON
Enable True: Selected Colour and Frequency are applied whenever
there is no system alarm.
False: LED remains as System LED.

057-320 ISSUE: 6 Page 16 of 38


Connecting to CODESYS

2.5 UTILISING MANUAL SHUTDOWN

NOTE: Manual Shutdown feature is available from M870 V5.0 onwards.

NOTE: Enable Manual Shutdown in Device Settings. For details, see section entitled
Device Settings Parameters | Manual Shutdown elsewhere in this document.

NOTE: Calling DSE.SystemShutdown when Ignition pin remains active, results in the
device shutting down and restarting (ie similar to a power cycle).

Manual Shutdown parameter is controlled by either mapping a BOOL variable within Device Settings
I/O Mapping:

or by utilising the function:

DSE.SystemSetManualShutdown(TRUE); or DSE.SystemSetManualShutdown(FALSE);

When Manual Shutdown is set to TRUE, removal of the Ignition pin does not begin the shutdown
process. Instead, the application can monitor the Ignition pin, performing a graceful machine
shutdown, before programmatically instructing the device to shutdown using the function:

DSE.SystemShutdown();

Ignition pin may be monitored either by mapping Ignition Switch within the Device Settings I/O
Mapping page, or by using:

DSE.SystemGetIgnition(Ignition => bIgnitionState);

Where bIgnitionState is a BOOL variable used to store the state of the system Ignition pin.

To restart the device application, reapply Ignition pin.

Page 17 of 38 057-320 ISSUE: 6


Connecting to CODESYS

2.6 ADD INPUTS, OUTPUTS AND BUTTONS TO THE PROJECT

NOTE: Connector C is not fitted to DSEM871. Inputs and Outputs are not available on
DSEM871.

Right-Click
Device…

And select Add


Device.

Select Deep Sea


Electronics

Select the device


to add…

And click Add


Device.

Add other devices


if required, then
click Close when
finished.

057-320 ISSUE: 6 Page 18 of 38


Connecting to CODESYS

2.6.1 BUTTONS AND ROTARY ENCODER

NOTE: F10 is not fitted to DSEM870 or DSEM871.

2.6.1.1 BUTTON LOCATION

F1 (Left 1) F6 (Right 1)

F2 (Left 2) F7 (Right 2)

F3 (Left 3) F8 (Right 3)

F4 (Left 4) F9 (Right 4)

F5 (Left 5)
F11 (Encoder
Button)

2.6.1.2 BUTTON POSITION ON THE VISUALISATION

To aid positioning of icons on the visualisation, the vertical position of the centre of each button is as
follows.

Button Pixel Position From Top of Display


F1 & F6 (centre) 30
F2 & F7 (centre) 130
F3 & F8 (centre) 230
F4 & F9 (centre) 330
F5 (centre) 430
Encoder & F11 (top) 430

Page 19 of 38 057-320 ISSUE: 6


Connecting to CODESYS

2.6.1.3 BUTTON SETTINGS (F1 TO F11)

NOTE: F10 is not fitted to DSEM870 or DSEM871. In its place is fitted the Encoder Button
(F11) and Rotary Encoder (F12).

NOTE: DSE_UTILS library includes the function DSE_UTILS.M870_Buttons to allow


programmatic reading of the buttons and encoder.

Double-Click the
Button to configure
the Hold Time and
variable mappings.

Click Parameters to edit the Hold


Threshold

Parameter Description
Hold Threshold Amount of time (in milliseconds) that the button must be pressed before it
is considered ‘held down’.

Click Mapping to
view and edit the
variable mapping.

Parameter Description
State Indicates if the button is pressed (1) or not pressed (0).
Held Indicates if the button has been held for longer than the duration of the
Hold Threshold (1) or not (0).
Hold Time The amount of time (in milliseconds) that the button has been pressed for
(zero if not currently pressed).

057-320 ISSUE: 6 Page 20 of 38


Connecting to CODESYS

2.6.1.4 ROTARY ENCODER (F12)

NOTE: DSE_UTILS library includes the function DSE_UTILS.M870_Buttons to allow


programmatic reading of the buttons and encoder.

The rotary encoder may be turned to make selections and adjust values.

Click Mapping to
view and edit the
variable mapping.

Parameter Description
Abs_Pos The absolute position of the encoder. Increases with Clockwise rotation,
Decreases with Anti-Clockwise rotation.
Rel_Pos The relative position of the encoder. Increases with Clockwise rotation,
Decreases with Anti-Clockwise rotation.
Movement 0: Indicates that the rotary encoder is not being rotated.
(M870 V3 onwards) 1: Indicates that the rotary encoder is being rotated Anti-Clockwise.
2: Indicates that the rotary encoder is being rotated Clockwise.
Movement 0: Indicates that the rotary encoder is not being rotated.
(M870 V1, V2) 1: Indicates that the rotary encoder is being rotated Clockwise.
2: Indicates that the rotary encoder is being rotated Anti-Clockwise.

Page 21 of 38 057-320 ISSUE: 6


Connecting to CODESYS

2.6.2 INPUTS AND OUTPUTS

NOTE: Connector C is not fitted to DSEM871. Inputs and Outputs are not available on
DSEM871.

Right-Click the
Input / Output to
configure…

And select
Update Device.

Select the required


configuration for the
Input / Output.

And click Update


Device.

Select and
configure other
Inputs / Outputs if
required, then
click Close when
finished.

057-320 ISSUE: 6 Page 22 of 38


Connecting to CODESYS

2.6.3 DIGITAL INPUT PARAMETER CONFIGURATION

NOTE: Connector C is not fitted to DSEM871. Inputs and Outputs are not available on
DSEM871.

Double-Click the digital input to be configured…

Then select Parameters.

Parameter Description
Active Mode Active High: The input connects to the positive supply rail when
activated.
Active Low: The input connects to the negative supply rail when
activated.
Resistor Float: The input is floating when no connection is made. Commonly used
with PNP (Sourcing) type switched sensors.
Pull Up: An internal pull up resistor biases the input to the positive supply
rail when no connection is made. Commonly used with NPN (Sinking)
type switched sensors and volt-free contacts.
Pull Down: An internal pull down resistor biases the input to the negative
supply rail when no connection is made. Commonly used with volt-free
contacts.
Higher Threshold For Active High inputs, the input is detected as being active when above
this threshold with respect to the negative supply rail.
Lower Threshold For Active Low inputs, the input is detected as being active when below
this threshold with respect to the negative supply rail.

Page 23 of 38 057-320 ISSUE: 6


Connecting to CODESYS

2.7 USING THE DISPLAY IN THE PROJECT

CODESYS 3.5 includes the facility to design and manipulate the LCD of the device. While the
operation of the CODESYS environment is detailed within the CODESYS online document, this
section provides a quick-start guide to using the Visualisation component of CODESYS 3.5.

Right-Click Application,
select Add Object….

Then select
Visualisation.

Double-Click
TargetVisualization to
view/change the
settings for the
Visualisation on the
Target Device

Double-Click
Visualisation to begin
editing. Refer to
CODESYS online
documentation for
details.

057-320 ISSUE: 6 Page 24 of 38


Connecting to CODESYS

2.7.2 INSTALLING FONTS ON THE DEVICE

DSEM870 includes a default ready installed on the device. To use other fonts, first the font must be
installed on the device using the System Pages. For details of this, see DSE Publication 057-246
DSEM870 Installation and Operation Manual.

2.7.3 USING CUSTOM IMAGES ON THE DISPLAY

NOTE: svg image type supported from M870 V5.0 onwards.

NOTE: Support images are bmp, jpg, png, svg.

Many applications require custom images to be placed on the M870 display. This is controlled using
an Image Pool within CODESYS. The Image Pool acts as a container for the images, which are then
selected for display.

2.7.3.1 ADDING AN IMAGE POOL

Right-Click Application,
select Add Object….

Then select Image


Pool

2.7.3.2 ADDING IMAGES TO THE IMAGE POOL


Double-Click the Image
Pool.

Continued overleaf…

Page 25 of 38 057-320 ISSUE: 6


Connecting to CODESYS

Right-Click the empty line


and select Insert Image.

Then Double-Click the


empty space under File
name and click …

Browse to the image on


your computer…

And select how the image


is stored in the project.

Click OK when done.

NOTE: Ensure the ID in the image pool contains only alphanumerical characters, -
(minus), and _ (underscore). Many other characters, including . (full stop) and spaces are not
supported and may result in the image not appearing on the display.

Example images in the


Image Pool.

2.7.3.3 USING THE IMAGE POOL ON THE DISPLAY

Entries within the Image Pool are automatically detected by the CODESYS Visualisation Toolbox and
are available for placing on the Visualisation.

Select Image
Pool in the
Visualisation
Toolbox

Example entries in the


Image Pool ready for
placing on the
Visualisation.

057-320 ISSUE: 6 Page 26 of 38


Connecting to CODESYS

2.7.4 UTILISING THE TOUCHSCREEN AND WEBVISU

NOTE: Touchscreen functionality is available only on DSEM870-02 and DSEM870-03.


WebVisu functionality is available only on DSEM870-03.

The capacitive touchscreen of DSEM870-02 mimics the operation of a mouse within the CODESYS
environment. The following examples show how to utilise this functionality within the Visualisation.

2.7.4.1 SWITCHES, SLIDERS, COMBO BOXES, RADIO BUTTONS

Many CODESYS visualisation elements require no additional coding or settings to enable them for
use with the Touchscreen. These include Switches, Sliders, Comboboxes and Radio Buttons. Simply
add them to the Visualisation and map a variable to them. Touch them on the screen or click on the
Webvisu to operate them.

Example:
Add a switch to the Visualisation. Usually these are found in the Toolbox under
Lamps/Switches/Bitmaps.
A Switch added to the
Visualisation

Select the variable to


map to the switch

During the execution of the application, simply touch the switch on the screen or click on the WebVisu
to operate it.

Page 27 of 38 057-320 ISSUE: 6


Connecting to CODESYS

2.7.4.2 NUMBER AND TEXT ENTRY

NOTE: DSE_VISU library includes additional Dialogs for number and text entry, including
UK keyboard layout.

Number entry via the M870 Touchscreen requires the use of a Virtual Numpad.
Text entry via the M870 Touchscreen requires the used of a Virtual Keypad.

CODESYS include a simple number pad and a German layout keypad as a Dialog and are utilised as
follows.
A TextField added to
the Visualisation

Locate Input
configuration in
the properties
and click
Configure next
to
OnMouseClick

DoubleClick Write a Variable to


add this entry to the action list

Select the
Dialog to use.
VisuDialogs.Nu
mpad is
supplied with
CODESYS.
Other dialogs
may be
available
depending
Select which
upon libraries
variable to
you may
store the have
entry
installed.
into

057-320 ISSUE: 6 Page 28 of 38


Connecting to CODESYS

Example:

Upon touching the screen on the Visualisation element, CODESYS displays the selected Dialog.
Enter the value required.
ESC: Exit without saving the value.

OK or : Exit and update the variable with the text or value entered.

Should the value be outside the configured range, this is indicated, and the dialog remains on screen
to allow the correction to be made.

Virtual Keypad Virtual Numpad

2.7.5 WEBVISU ACCESS

NOTE: WebVisu functionality is available only on DSEM870-03.

DSEM870-03 includes CODESYS WebVisu functionality. DSEM870 includes an integral webpage


server, whereby a full copy of the project visualisation is available for viewing and control by an external
device supported by a web browser.

Example:
Connect a PC to ethernet. Ensure the PC can “route” through to the DSEM870. You may need to consult
your IT department to set up the network to allow this.
On the web browser, point it to port 8080 of the DSEM870. For example, if the DSEM870 IP address is
192.168.1.100 then point the web browser to http://192.168.1.100:8080.

Page 29 of 38 057-320 ISSUE: 6


Connecting to CODESYS

2.8 USING THE CAMERA OVERLAY

NOTE: M870 V3.0 and above blends the camera overlay with CODESYS visualisation and
the camera display allowing all to be visible at the same time.

Type M870CameraOverlaySettings, contains options to Enable/Disable the overlay and control the
transparency.

2.9 M870CAMERAOVERLAYSETTINGS
Structure used for M870 camera overlay display.

Variable Type Description


Enable BOOL Turns overlay ON / OFF
: Camera is not displayed.
: Camera is displayed according to the settings of
Transparency and FileName below.
Transparency UDINT
NOTE: This parameter is NOT applicable if
FileName is specified.

Specifies the transparency of the overlay over the camera


display.
0: Overlay is not visible, Camera Only.
1 to 254: Overlay is ‘more visible’ the higher the value.
128: Overlay and Camera are equally visible.
255: Camera is not visible.
Mirror BOOL
NOTE: Mirror parameter available in M870 V5.0
onwards.

FALSE: Camera appears as normal.


TRUE: Camera image is mirrored (horizontally switched)
so appears as if ‘in a mirror’. This is useful to swap images
when the camera is pointing in another direction (behind,
for example).
FileName STRING
NOTE: Leave this parameter empty if an overlay
image is not required. In this case, use Transparency
to control the blending of Camera and Visualisation.

NOTE: Ensure FileName is correct when used. If


FileName does not exist, no Alpha Channel data is
available and the camera appears at 0 % visibility
(behind the CODESYS visualisation) and hence not
visible.

Overlay Image Filename (png, jpg, bmp).


The image should be sized to match the size of the camera
display within the application.

Transparency setting is not used, and the overlay image


transparency is taken from the Alpha Channel value contained
within the image. Some PC ‘Paint’ applications may call this
Transparency or use similar wording.

057-320 ISSUE: 6 Page 30 of 38


Connecting to CODESYS

2.10 USING THE USB DRIVE WITHIN APPLICATIONS

NOTE: M870MultiDemo application available from Deep Sea Electronics Technical


Support (support@deepseaelectronics.com) includes a simple demonstration writing to a csv
file.

Using the Sysfile library, applications can read/write data from/to files on the USB device. A typical
use for this is storing data in csv (comma separated value) files for datalogging.
Within CODESYS, the device is accessed via the following path.

Firmware Version Path to USB device


V5 onwards ‘USBDRIVE/Partition_Name’
V1, V2, V3, V4 /media/usb0, /media/usb1 etc where each partition of the USB is given
a different number

Example for DSEM870 V5:

Page 31 of 38 057-320 ISSUE: 6


Connecting to CODESYS

2.11 USING PERSISTENT VARIABLES IN THE PROJECT

NOTE: For details how to enable and configure the storage interval of Persistent
Variables, see section entitled Connecting to CODESYS | Device Settings | Persistence
Settings elsewhere in this document.

Variables placed in a Persistent Variables object are stored at regular intervals and maintained when
the device is powered off. The variables are automacally loaded when the device powers up.

Right Click
Application

Select Add
Object…

Select Persistent
Variables…

To add variables, double


click the new object in the
project tree.

Example variables

Within the POU the variables are address as normal. In this example we’ve named the object
PersistentVars however any IEC compatible name can be used. Multiple Persistent Variable objects
can be used as required.

Example:
PersistentVars.MyNewVariable:=2512;
PersistentVars.MyNewArray[2]:=32167;

057-320 ISSUE: 6 Page 32 of 38


Connecting to CODESYS

2.12 ALTERNATIVE METHODS TO LOAD THE APPLICATION

2.12.1 USB

NOTE: For details of the Clone/Recover process see DSE publication 057-246 DSEM870
Installation and Operation Manual.

A Clone File of the device can then be created and used to Recover onto other devices of the same
variant and firmware version.

2.12.2 DSESERVICETOOL PC SOFTWARE

NOTE: For details using DSEServicetool PC Software see DSE publication 057-265 DSE
Servicetool PC Software Manual.

DSEServicetool PC Software is used to transfer applications to the device. This allows OEMs to
update equipment application software without requiring a connection to CODESYS. However,
CODESYS is required to create the Boot Application files in the first instance.

2.12.2.1 CREATION OF THE BOOT APPLICATION

NOTE: The boot application includes the folder PlcLogic. This contains all images, text
files and associated visualisation files.

Within CODESYS select Online | Create boot


application

Browse to select the location to store the files. It


is convenient to put the files into a new (empty)
folder. The example, to the right shows the boot
application files in the new folder.
All these files (including the sub folder) make up
the boot application and must be kept together.

2.12.2.2 UPDATE USING DSESERVICETOOL AND ETHERNET CONNECTION

NOTE: For details using DSEServicetool PC Software see DSE publication 057-265 DSE
Servicetool PC Software Manual.

Within DSEServicetool PC Software scan for and select the device, then select the file
Application.app and transfer it to the device.

Page 33 of 38 057-320 ISSUE: 6


CODESYS Error Codes

3 CODESYS ERROR CODES


The device returns error codes to CODESYS when appropriate. Individual bits are set within the
returned value to indicate one or more error conditions. This can be mapped to a variable if required
and is available to view within CODESYS under the Device Settings I/O Mapping as shown below.

Error Code is a bit field, detailed below.

Examples:

A Device error value of 120 (01111000 in binary) indicates that all four Output Supplies are Under
Voltage.

A Device error value of 2 (00000010 in binary) indicates Over Temperature.

3.1 DEVICE
MSB Bit LSB
8 7 6 5 4 3 2 1
Output Under Under Under Under Under Over Error
Reference Voltage Voltage Voltage Voltage Voltage Temperature
Outside Output Output Output Output Supply
Limits Supply 4 Supply 3 Supply 2 Supply 1

3.2 ANALOGUE INPUTS

NOTE: Connector C is not fitted to DSEM871. Inputs and Outputs are not available on
DSEM871.

Input MSB Bit LSB


Configuration 8 7 6 5 4 3 2 1
Digital Invalid Reserved Reserved Invalid Reserved Reserved Reserved Error
Parameter Threshold
Voltage Invalid Reserved Reserved Reserved Reserved Over Inverted Error
Parameter Range Input
(<10 mV)
Current Invalid Reserved Reserved Reserved Reserved Over Wire Error
Parameter Range Break
(<4 mA)
Resistance Invalid Reserved Reserved Reserved Reserved Over Reserved Error
Parameter Range
Ratiometric Invalid Reserved Invalid Reserved Reserved Over Reserved Error
Parameter Reference Range

057-320 ISSUE: 6 Page 34 of 38


CODESYS Error Codes

3.3 DIGITAL INPUTS

NOTE: Connector C is not fitted to DSEM871. Inputs and Outputs are not available on
DSEM871.

Input MSB Bit LSB


Configuration 8 7 6 5 4 3 2 1
Digital Invalid Reserved Reserved Reserved Reserved Reserved Reserved Error
Parameter
Frequency Invalid Reserved Reserved Reserved Reserved Freq Over Reserved Error
Parameter Range

3.4 DIGITAL OUTPUTS

NOTE: Connector C is not fitted to DSEM871. Inputs and Outputs are not available on
DSEM871.

Output MSB Bit LSB


Configuration 8 7 6 5 4 3 2 1
Digital Invalid Reserved Reserved Reserved Reserved Over Wire Error
Parameter Current Break
(Config)

Page 35 of 38 057-320 ISSUE: 6


Maintenance, Warranty and Disposal

4 MAINTENANCE AND WARRANTY


The device is Fit and Forget. As such, there are no user serviceable parts within the controller.
In the case of malfunction, you should contact your original equipment manufacturer (OEM).

DSE Provides limited warranty to the equipment purchaser at the point of sale. For full details of any
applicable warranty, refer to the original equipment supplier (OEM).

5 DISPOSAL
5.1 WEEE (WASTE ELECTRICAL AND ELECTRONIC EQUIPMENT)
If you use electrical and electronic equipment you must store, collect, treat, recycle and
dispose of WEEE separately from your other waste

6 MISCELLANEOUS
This product includes copyrighted third-party software licensed under the terms of the GNU General
Public License. A copy of the corresponding source code for all included third-party software is
available on request, please contact DSE Technical Support for additional information.

057-320 ISSUE: 6 Page 36 of 38


This Page is Intentionally Blank
This Page is Intentionally Blank

You might also like