DSEM870 CODESYS Software Manual 1
DSEM870 CODESYS Software Manual 1
DSEM870 CODESYS Software Manual 1
057-320 ISSUE: 6
DSEM870 & DSEM871 CODESYS Software Manual
E-mail: sales@deepseaelectronics.com
Website: www.deepseaelectronics.com
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
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
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.
2 CONNECTING TO CODESYS
DSEM870 communicates with, and is programmed by, the CODESYS V3.5 Integrated Development
Environment (IDE).
Then click OK
If you didn’t select a template from the previous dialogue, now select the model type
And your
preferred
language for
PLC_PRG
Then click OK
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…
Click OK to connect to
the selected device.
Successful connection is
shown by the green icon.
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.
Double-Click Device…
Successful
connection is
shown by the
green icon.
Select Device
Parameter Description
Save Config Selects how ethernet settings are applied at device power up.
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.
Parameter Description
Screen Rotation
NOTE: After changing the setting of Screen Rotation,
DSEM870 must be power cycled for the change to take
effect.
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.
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.
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.
2.4.2.1 LED
NOTE: M870 LED is Tri-Colour, with options of Red, Green and Amber.
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.
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:
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:
Where bIgnitionState is a BOOL variable used to store the state of the system Ignition pin.
NOTE: Connector C is not fitted to DSEM871. Inputs and Outputs are not available on
DSEM871.
Right-Click
Device…
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)
To aid positioning of icons on the visualisation, the vertical position of the centre of each button is as
follows.
NOTE: F10 is not fitted to DSEM870 or DSEM871. In its place is fitted the Encoder Button
(F11) and Rotary Encoder (F12).
Double-Click the
Button to configure
the Hold Time and
variable mappings.
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).
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.
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 and
configure other
Inputs / Outputs if
required, then
click Close when
finished.
NOTE: Connector C is not fitted to DSEM871. Inputs and Outputs are not available on
DSEM871.
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.
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.
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.
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.
Right-Click Application,
select Add Object….
Continued overleaf…
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.
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
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.
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
During the execution of the application, simply touch the switch on the screen or click on the WebVisu
to operate it.
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
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
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.
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.
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.
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.
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…
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;
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.
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.
NOTE: The boot application includes the folder PlcLogic. This contains all images, text
files and associated visualisation files.
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.
Examples:
A Device error value of 120 (01111000 in binary) indicates that all four Output Supplies are Under
Voltage.
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
NOTE: Connector C is not fitted to DSEM871. Inputs and Outputs are not available on
DSEM871.
NOTE: Connector C is not fitted to DSEM871. Inputs and Outputs are not available on
DSEM871.
NOTE: Connector C is not fitted to DSEM871. Inputs and Outputs are not available on
DSEM871.
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.