CIMON User Protocol

Introduction

 

You can write the protocol as you want through CIMON User Protocol (Ethernet). Therefore, you are able to communicate with almost every Ethernet capable devices even if CIMON-SCADA does not support the desired driver. When you write the CIMON User Protocol (Ethernet) for the target device, protocol document of the target device is needed.

This program offers communication line redundancy. This feature automatically switches the communication line quickly when it detects communication fault.

CIMON User Protocol (Ethernet) is configurable as master or slave mode. Therefore, you are able to choose one of the modes, which increases the flexibility of network configuration.

Supported device and requirements

 

Contents

Note

Manufacturer

CIMON Co., Ltd

 

Product Name

-

 

Communication Method

Ethernet, Serial

TCP/IP, UDP/IP, RS232C

Protocol

User defined protocol

 

Supported Device

General devices using Ethernet communication.

 

Supported Features

Each communication protocol drivers offered by CIMON have different functions supported. The table below is a list of supported functions of CIMON User Protocol (Ethernet). Please refer to the list below before you use the communication driver.

Function

Support

Note

Bit process of byte data

■ Supported

 

Station COM Block setting

CSV save and load

□ Supported

Not Supported

Dynamic IP

□ Supported

Not Supported

Duplexing Line

■ Supported

 

Communication Method

■ Block

 

□ Page

Not Supported

Scan Time

■ Supported

 

String Tag Read/Write

■ Supported

 

Check Communication Error Message

■ Supported

 

Check Communication Status

■ Supported

 

Station Enable/Disable

■ Supported

 

Read after Write

□ Supported

Not Supported

Recipe

□ Supported

Not Supported

Data Swap)

Analog

■ Supported

 

String

■ Supported

 

Communication Frame Indicator

■ Supported

 

Frame communication order

Frame transmission and reception order depends on device being in master or slave mode. A master device sends a request to its slave and waits for a response. A master device can collect data and act as a bridge of communication. a master can also transmit requested data to the target device. A slave device is always in listen mode and waiting for a request from its master device. When a master sends a request, its slave will respond to it. When a master request to change the data, its slave will execute the request.

Frame

Frame is a unit of data block exchanged in data communication and it can be referred as frame or message. Composition of frame depending on the protocol of target device. CIMON User Protocol(Ethernet) can be defined flexibly to fulfill the requirement of communication. Frames have general forms, which are ‘Header + Body + Tail’, ‘Station Number + (Command + Data) + BCC’ and ‘Message + End Character’. Their features are explained in detail below.

1) HEADER + BODY + TAIL)

Header

Body

Tail

Frame is composed of a Header which is a beginning symbol, and a Tail which is an end symbol of the frame. The actual content is included in the Body.

In general, this format is used in 1:1 communication.

2) STATION NUMBER + COMMAND / DATA + BCC

Station Number

Command + Data

BCC

This format of frame starts with Station Number and followed by Command, Data and BCC at the end. BCC is a data to check the integrity of frame.

Typically, most protocols use this format combined with ‘Header + Body + Tail’ format. When it is combined, the format will become “Header + Station Number + Command + Data + BCC + Tail”.

In general, this format is used in 1:N communication.

3) MESSAGE + END CHARACTER

Message

End Character

This format of frame is used as a method of interactive communication. Devices such as printers and terminals use this format.

The End Character such as <CR (Carriage Return)>, <LF (Line Feed)> finishes the Message, which informs the end of contents.

Segment

The segment is the smallest unit which constitutes the frame. The Header, Body, Tail and other items mentioned earlier are one of the segments.

At CIMON, User Protocol(Ethernet) classifies the segment in 3 types. They are Fixed Length segment, Memory Link segment and Error Check(BCC). Followings are the explanations of each segments.

1) Fixed Length Segment

Fixed Length segment is a segment which does not change its value and length of data. For example, there are Header, Tail, Station Number, End Character.

2) Memory Link Segment (Fixed/Variable Length)

Memory Link segment is used when it receives a frame from target device and writes the value to a tag. Also, it is used when it sends the value to target device. Memory Link segment is separated into Fixed Length(Memory) and Variable Length(Memory). Fixed Length(Memory) is used when the data length is fixed during the communication. Variable Length(Memory) is used when the data length is variable during the communication. But, Variable Length(Memory) must be placed between Fixed Length segments. It should not be configured continuously in the frame.

Transmitting the configured value to the temperature controller is an example of Memory Link segment. Memory of CIMON User Protocol(Ethernet) writes a configured value at a tag and transmit it to the temperature controller, the value of a tag will be written to the configure value of temperature controller. On the other sides, when the temperature controller measures a present temperature, memory area designated by Memory Link segment will receive the data and update the present temperature at the tag.

Memory Link segment is separated into two types.

Fixed Length (Memory): Used when the data length is fixed. For example,

Ÿ   - When it is determined that 10 Word-sized data will be sent and received.

Ÿ   - When it is determined that data type is ASCII and 5 letters will be sent and received.

Variable Length (Memory): Used when the data length is variable. For example,

Ÿ   - When the data length varies while demanding the data.

- When the data type is ASCII but significant digit varies while communication.

 

  • When a Variable Length (Memory) is used, it must be placed between Fixed Length segments.

 

3) Error check (BCC)

BCC is an error-checking code for the frame.

CIMON User Protocol(Ethernet) offers various types of error check(BCC) segment. BCC is used for checking the errors through SUM, XOR, MUL calculation in each byte length of designated area. In addition, CIMON User Protocol(Ethernet) offers CRC(MODBUS), CRC8, CRC16, CRC 16-1, CRC 16-2, CRC16-CCITT 1, CRC16-CCITT 2.

This segment checks the data from the beginning segment to the end segment, by selected BCC type.

Data Processing

CIMON User Protocol (Ethernet) provides two types of format: Binary and ASCII. These are applied at Memory Link area. You might process the data as you wish.

Data Converting section of segment setting is what CIMON User Protocol(Ethernet) offers as the data formats. At CIMON User Protocol (Ethernet), Data Converting defines how to convert the data value before sending and receiving the frame.

Binary do not go through the converting process and just recognizes the data as its set length.

  • Received Data: H78 H56 H34 H12 ↔ Converted Data: H78 H56 H34 H12

When saving the data to the memory, it is divided into byte size. CPU type decides how to save 2-byte or 4-byte sized data in which order. In general, the order is divided into Little Endian and Big Endian. Little Endian saves the data starting from the least significant byte. On the other hand, Big Endian saves the data starting from the most significant byte. CIMON-SCADA uses Little Endian order.

When different types of Endian try to communicate each other, Data Swap is needed to match each other’s byte saving order.

You must consider that there are two types of Endian and CIMON-SCADA uses Little Endian before choosing Data Swap. In CIMON User Protocol(Ethernet), the user chooses 2-byte swap and 4-byte swap.

  

2-BYTE SWAP

Applied to binary(None) and Hexadecimal. Data’s digit is swapped every 2-byte unit.

Ÿ   Send/Receive Data is 4-byte: H78563412   Convert Completed -> H56781234

Ÿ   Send/Receive Data is 2-byte: H3412   Convert Completed -> H1234

4-BYTE SWAP

Applied to binary(None) and Hexadecimal. Data’s digit is swapped every 4-byte unit.

Ÿ   Send/Receive Data is 4-byte: H78563412   Convert Completed -> H34127856

Ÿ   Send/Receive Data is 2-byte: H3412   Convert Completed -> H0000

 

Composition and operation method

CIMON User Protocol (Ethernet) is composed of virtual memory and communication driver. The virtual memory sends and receives the data with target device through the communication driver. The virtual memory is also used with tags of database which you configured in CimonD. At communication memory area of virtual memory, the data sent and received can be written. Communication driver takes a role of data processing and converting. Also, it is in charge of connecting to Ethernet for the communication with target device.

When CIMON User Protocol (Ethernet) communicates with the target device, it operates in two modes: A master mode and a slave mode. A master device requests data from its slave device and waits for response, and the slave device receives the request and responds to it.

The virtual memory is composed of communication memory, frame status memory and mode status memory. The communication memory is used as a buffer which stores the data received from or send to the external device. The frame status memory is used for monitoring or controlling the status of frames. The mode status memory is used for monitoring or controlling the operation modes (Master/Slave) of UltimateAccess Web-installed system.

image-20240604-184304.png

 

CIMON User Protocol (Ethernet) is composed of virtual memory and communication driver. The driver sends and receives the data with target device through the communication driver. The virtual memory is a storage of the received data and the data to send. The virtual memory is also used with tag database which you configured in CimonD. Communication driver takes a role of processing and converting data. Also, it is in charge of the communication with target device.

Virtual Memory: A virtual memory area for CIMON User Protocol (Ethernet) to communicate with the target device. It is separated into communication memory, frame status memory and mode status memory.

Communication Driver: Takes a role of data processing and converting for which frame to be received and be sent.

You can define the segment and compose it to a frame. With this, you are able to communicate with the target device through the virtual memory and the communication driver. During the communication, you can write or read the data from the database referring to the virtual memory.

The Master/Slave Mode

When you configure the frame, you are able to choose the basic communication method of CIMON User Protocol (Ethernet) by checking the box of ‘Enabled On Start Up’.

This section explains about the Master/Slave mode and its operation method.

Mster

image-20240604-184425.png

CIMON User Protocol(Ethernet) operates as the master mode when ‘Enabled On Start Up’ box is unchecked. Unchecking the ‘Enabled On Start-up’ is the only way to activate the master mode.

When UltimateAccess is set to the master mode, the SCADA initiates of the communication and operates as TCP Client(Active). In this case, the target device is considered as a slave device. The master requests data from the target device first. After the request, the master waits for the response. Data received before the request will be ignored by master.

In order to initiate the communication, a master device must have a TX frame and the frame should be checked at ‘Enabled On Start Up’ as above. Sending this frame means the master requests from the slave, in other word, the target device. If the frame’s ‘Enabled On Start Up’ is unchecked, the communication would fail.

If you set a scan time, the TX frame is sent to the target device following a scan time. If there are multiple TX frames, each frame will follow their own scan time. In other words, each frame will be sent to the target device at the corresponding scan time.

 

  • TX frame must be checked at ‘Enabled On Start-up’.

  • When two masters try to communicate each other, the communication fails.

Slave

 

CIMON User Protocol(Ethernet) operates as the slave mode when ‘Enabled On Start-up’ box is checked. Checking the ‘Enabled On Start-up’ is the only way to activate the slave mode.

When UltimateAccess Web is set to the slave mode, UltimateAccess Web takes a passive role of the communication and operates as TCP Server(Passive). In this case, the target device is considered as the master device. The slave will respond once receiving a request from the target device.

In order to respond accordingly, the slave must have a RX frame and the frame should be checked at ‘Enabled On Start Up’. This mode only transmits the frame that the Master requested. Also, to decide which frame to transmit, the slave must receive the request first. If the request from the master and RX frame of the slave do not correspond, the slave will not accept the request and discard it.

Even if there is a TX frame in the slave, it is not transmitted unless the TX frame is linked to the RX frame or is forced to be activated by frame status memory. Therefore, ‘Enabled On Start Up’ of TX frame can be ignored. To operate the TX frame of the slave, data reception from the target device should be preceded first. After that, corresponding TX frame will be sent. At this point, when the linked TX frame operates, it ignores the scan time.

 

  • RX frame must be checked at ‘Enabled On Start-up’.

Virtual Memory

 

The virtual memory is composed of communication memory, frame status memory and mode status memory. The communication memory is used as a buffer which stores the data received from or send to the external device. The frame status memory is used for monitoring or controlling the status of frames. The mode status memory is used for monitoring or controlling the operation modes (Master/Slave) of UltimateAccess Web-installed system.

Communication Memory

The communication memory is used as a buffer which stores the data received from or send to the external device.

This memory is composed of consecutive space per byte and addressable from 0 byte to 65533byte. It is available with analog, digital and string tag of CimonD’s database. In order to write an address at a blank section of an I/O address, there are two types of setup methods.

In case of analog, digital and string tag, address can be set in a form of Mn (n=byte address).  Depending on the user’s setup, the range of address is from M0 to M65533.

  • First byte -> M0, Last byte -> M65533

In case of digital tag, the address can be set in a form of Mn.x (n=byte address, x=bit address, x=0~63)

  • First byte, first bit -> M0.0

  • Fourth byte, last bit -> M3.7 or M0.31

  • Eighth byte, last bit -> M7.7 or M0.63

  • Ninth byte, first bit -> M8.0 or M1.56

  • Last byte, last bit -> M65533.7 or M65531.63

 

Frame Status memory

 

Frame status memory classifies the memory by the name of the frame. The name of frame can be identified as shown in the image above. In other words, to set a tag and identify it, the name of frame is needed. At CIMON User Protocol(Ethernet), frames can be added up to no. 255. Each frame can be monitored or controlled by 6 status codes. There are monitor-only codes and monitor-control combined codes.

Monitor-only codes are 0, 2, 3, 4. Monitor-control combined codes are 1, 5. Refer to the following table for each functions and explanations of codes.

When you set a tag at database, write a I/O address value in the form of ‘F:Framename.Code’.   All configured tags operate as the function according to the codes of the designated frame.

Code

Description

Tag Value

0

Abnormal frame setting

0: Normal

1: Abnormal

1

Frame status - Enabled or Disabled

0: Disabled

1: Enabled

2

Type of frame

0: TX Frame

1: RX Frame

3

Communication standby status

0: Not standby

1: Standby

4

Communication conclusion status

0: Not concluded

1: Concluded

5

Force frame operation

0: Not forced

1: Forced

Settings

To use CIMON User Protocol (Ethernet), you must check whether the target device and UltimateAccess Web-installed system supports the Ethernet communication. Also, you should figure out IP addresses of both target device and UltimateAccess Web-installed system. Also, the port numbers of both sides should be confirmed. When you try to write a CIMON User Protocol (Ethernet) and follow the protocol format of the target device, you need the protocol document. But if you write your own protocol, the document is unnecessary. The communication might fail if network communication items do not correspond to each other or network status is abnormal.

In UltimateAccess Web, order of User Protocol (Ethernet) setting is as following.

  1. I/O Device

  2. TCP/IP Port Configuration

  3. Station Configuration

  4. Frame Definition

  5. Frame Check

You select a communication driver at I/O Device Selection. Through TCP/IP Port Configuration, you configure network environment of UltimateAccess Web-installed system. Station Configuration is for the network environment of the target device. Frame Definition configures the CIMON User Protocol (Ethernet)’s frames. At the end, you could check the communication status through the Frame Check.

I/O Device

 

Communication method for the target device is available at I/O Device Selection. Click in order of [Tools] – [I/O Device] and enter into the I/O Device Configuration screen.

At I/O Device Configuration screen, following figure appears when you select [New Device].

 

1) Device Name When there are various devices at the project and the field and they use different communication driver, input the name of devices to distinguish them. You cannot use period or empty device name.

2) I/O Device Type
Select a type of device that connects to the UltimateAccess Web.

To use CIMON User Protocol(Ethernet), please select ‘CIMON User Protocol (Ethernet).

3) [Ok] Add a new device with the contents written. After pressing the [Ok] button, the screen of network configuration for each device appears

4) [Cancel]
Cancel the operation in progress and close the screen.

COM Port Configuration

Configure the network communication items of UltimateAccess Web-installed system..

 

1) Socket Port No. Input a socket port number for the communication.

If UltimateAccess Web-installed system uses multiple protocol through Ethernet, different socket port numbers should be input. In case of UDP, input the port number of the target device. In case of TCP, input the port number which will be used with the target device in common. If there isn’t a designated socket port number, input a random number.

※ Default value is 0. Available input port number is from 0 to 65535. Over 65535, communication error occurs. Socket port number 0 to 1023 is unavailable.

2) IP Address #1, #2

At IP Address #1, input the default IP address of UltimateAccess Web-installed system. IP Address #2 is only for the Duplexing Line (or Line Redundancy). If you use the Duplexing Line, input a second IP Address of the system.

 

Station

For each station, you can configure the network communication item of the target device. If you try to communicate multiple devices with one communication driver, the station name has to be different. Press [Add] to configure the station. After the configuration, the user is able to verify that a new station is added.

 

1) [Edit] [Edit] is used for the modification of existing station or frame definition. Select the station and press [Edit] to pop-up the station configuration screen. Select frame definition and press [Edit] to pop-up the frame configuration screen.

2) [Remove] [Remove] removes the existing station or frame definition. Select a station or frame definition first and press [Remove] to delete it.

3) [Add] Add a new station. When this button is pressed, Station Configuration screen appears.

4) [Save] Save the contents in progress.

 

Frame Definition

After configuring the station, you are now able to select the frame definition. Double-click it or press [Edit] to pop-up the frame definition screen.

Configuration of frame enables you to communicate with most of the drivers which support Ethernet.

 

Double-click the frame definition or select it and press [Edit] to pop-up the frame configuration screen. Following is the description of each items and their functions.

 

1) Enabled On Start Up

‘Enabled On Start Up’ means the Slave mode. If box is checked, UltimateAccess Web-installed system becomes the Slave mode. Therefore, even if there is a TX frame, the system does not transmit it. When ‘Enabled On Start Up’ is checked, the station operates as ‘RX standby mode’. If ‘Enabled On Start Up’ is not checked, master mode gets selected. This is unchecked by default.

2) Frame Definition Screen

This shows the status of frame configuration. Maximum 256 frames can be registered. Segments are maximum 10 per frame.

3) No.

No. means the number of frame. It shows from no.0 to no.255. Frame is processed from lower number. When the process reaches the end, it begins from the frame no.0 again. Linked frame is an exception. Order of frames cannot be changed.

4) Name

This shows the name of the frame designated at the frame configuration.

 

5) Direction

This distinguishes the RX frame and TX frame. RX frame is a frame which receives the data and TX frame is a frame which transmits the data.

6) Link

‘Link’ shows the name of linked frame when there is a ‘Sending for Receiving frame’ or ‘Receiving for Sending frame’ at certain frame.

7) S0~S9

This shows the segment of a frame in order of number. Segments are expressed at the screen, maximum 10. Designated number for each segment is from S0 to S9.

 

8) [Add]

Open Frame Configuration window to add RX/TX frame.

9) [Save]

Save the frame and close the screen.

10) [Exit]

Close the Frame Definition. If [Save] is not pressed and you press the [Exit], the contents in progress disappear without any warning or dialog box.

 

A frame is a unit of data block exchanged at the real communication.

Contents of the frame may differ to the target device. The composition of the contents may depend on the protocol of the target device or may have a new composition.

 

1) Frame Name Input the name to distinguish the frame. There is no restriction for the frame name but blank is invalid.

2) Enabled On Start Up This defines the status of the frame at the first run.

When CIMON User Protocol(Ethernet) is the master and TX frame is enabled, the frame operates when the communication starts. On the other hand, when TX frame is disabled, the communication fails. RX frame does not operate regardless of the ‘Enabled On Start Up’. RX frame should be operated by force or linked to the TX frame.

When CIMON User Protocol(Ethernet) is the slave and RX frame is enabled, the frame operates when the communication starts. On the other hand, when RX frame is disabled, the communication fails. Also, in this case, TX frame does not operate regardless of the ‘Enabled On Start-up’. To operate the TX frame at the Slave mode, it should be linked to the RX frame or operated by force.

With Frame Status Memory, it is possible to enable or disable the ‘Enabled On Start-up’. 3) Direction Defines the frame’s type. The direction is on the basis of the UltimateAccess Web-installed system. Sending frame is TX and receiving frame is RX.

4) Scan Time This is only for the TX frame. Scan Time configures the automatic transmission cycle when the TX frame is enabled on start-up. The range of the scan time is 0-999.9 seconds. RX frame cannot set a scan time.

5) Receiving for Sending frame In case of TX frame, this function is to link a RX frame which will operate automatically after sending the TX frame. In this case, ‘Enabled On Start-up’ is ignored.

6) Sending for Receiving frame In case of RX frame, this function is to link a TX frame which will operate automatically after receiving the RX frame. In this case, ‘Enabled On Start-up’ is ignored.

7) [Add] Add a segment to the frame. Maximum of 10 segments can be added.

8) [▲/▼] Move the selected segment upward/downward.

 

Enabled On Start Up

 

‘Enabled On Start-up’ is able to be configured in the frame configuration. It is enabled when it is checked and disabled when it is unchecked. This means whether the frame is enabled or not at the start point of the communication.

CIMON User Protocol(Ethernet) is the master:

  • TX frame is enabled – TX frame operates when the communication starts.

  • TX frame is disabled – TX frame does not operate when the communication starts.

  • RX frame does not operate regardless of the ‘Enabled On Start-up’. RX frame should be operated by force or linked to the TX frame.

CIMON User Protocol(Ethernet) is the slave:

  • RX frame is enabled – RX frame operates when the communication starts.

  • RX frame is disabled – RX frame does not operate when the communication starts.

  • TX frame does not operate regardless of the ‘Enabled On Start-up’. TX frame should be operated by force or linked to the RX frame.

 

It is possible to enable and disable the frame through the tag using the code of Frame Status Memory.

Frame Status Code 1 is a code which is able to control the frame. When the tag value is 0, it means that frame is disabled. When the tag value is 1, the frame is enabled.

Configure the I/O Device and I/O Address to monitor and control the frame.

 

After CimonX starts, you are able to check the tag value through the database.

You may configure the tag value at CimonX to enable or disable the frame. The result can be checked by using the DriverCommand.

Segment

 

To enter the segment configuration, press [Add] in the figure above. You can add a segment and edit it at every frame.

A communication frame consists of segments. For example, there are Header, Body, Tail, Station Number, Message and etc.

At CIMON User Protocol (Ethernet), write a segment according to the protocol document of the target device or you may write your own protocol for the security.

CIMON User Protocol (Ethernet) offers Static Value Segment, Memory Link Segment, and Error Check (BCC) Segment.

Static Value Segment

 

Static Value segment is used when the length and the value of the data are fixed. There are examples such as Header and Tail. Input elements are the segment length, data type, data value. For the data type, there are binary and ASCII.

Segment

When the segment type is ‘Fixed Length’, the length means the length of static value (byte length). The byte is automatically calculated but it differs in the way you input the value. Therefore, please check the bytes of the data and the value of the data.

Value

There are two types: Binary and ASCII. Since the segment type is ‘Fixed Length’, please input the fixed value.

Operation

When Static Value segment is used for the TX frame, the system sends the value in the form of the configured byte length and type.

When Static value segment is used for the RX frame, the system checks the data length, type and the value of the segment.