Registering and Editing a Special Program

Select the add/write new program in the CICON.

 

image-20240321-091425.png

 

If you select the add/write new program, the program block dialog box will appear as follows.

  • Program: This is used to define the name of special program. Up to 12 letters can be entered.

  • Program ID: This is used to define ID for each program.

  • Program Spare: This is to indicate the max. size for editing the protocols in a special program while CPU status is run.

  • Program Type: This is used to select the type of the program registered at this time. Here, select the special program.

If you finish registering the parameters, press the [OK] button.

 

image-20240321-091447.png

 

If you press the [OK] button, the dialog box for registering protocols will appear.

 

 

In a created PROTOCOL.SPC file, protocols can be registered.

Base: This is used to select the base where a communication card (CM1- SCXXX) is mounted.

  • Slot: This is used to select the slot where a communication card (CM1-SCXXX) is mounted. Slot number is counted from the slot next to a CPU module.

  • Channel: This is used to select the communication port between a master and a slave.

  • Result: This is used to send data without SEND command as sending interval is set up and, if a receiving frame is defined, to indicate whether a defined receiving frame is normally received. (Memory device: M0000)

    • Received: The bit corresponding to the frame number in M0000 is on for 1 scan.

    • Not Received: The bit corresponding to the frame number in M0020 is on for 1 scan.

 

If you select the add button, the dialog box for adding a frame will appear.

  • Frame Name: This is used to register a frame name. (Max. 20 letters)

  • Comm. Direction: This is used to select whether the frame registered is the one sent or the one received.

 

  • Comm. Interval: Frames are automatically sent at intervals without SEND command in a PLC program. If Comm. interval is ‘0’, frames will be sent only by SEND command. A PLC program is not needed in case of sending/receiving frames by using comm. interval.

  • [Receiving frame for sending] This corresponds to the case comm. frames are sending ones.
    If a corresponding frame is sent and the receiving frame for the sending frame is registered, the registered frame will be received without RECV command in the PLC program.

  • Auto-send after Receiving: This is operated in case that comm. direction is the frame received. If a corresponding frame is received, the frame registered for sending will be automatically sent without the command to send in a PLC program.

  • Use Code: This is used to distinguish a special data from the data in the frames sent/received. In case that there is the same letter as the corresponding distinguishes among the data in the frames sent/received, registered data are attached next to the distinguishes to be sent or received.

 

For example, the case hexadecimal FEh is registered to a distinguishes and FFh to special data.

Up to 4 special data can be registered. If 4 special data are registered, they will be sent/received continuously next to a distinguisher.

 

  • Add: This is used to add segments to write a frame. Up to 10 segments can be registered.

  • Edit: This is used to edit the segments in a made frame.

  • Delete: This is used to delete the segments in a made frame.

  • Move Up: This is used to switch the location of the segments in a made frame. A selected one is moved up one step by one step.

  • Move Down: This is used to switch the location of the segments in a made frame. A selected one is moved down one step by one step.

 

To make a frame, segments should be added.

 

SEGMENT0

SEGMENT1

........

SEGMENT8

SEGMENT9

 

Type

[Fixed Value (Header)]
This means the first data in the frame made. The value is to be assigned in the type of ASCII or Binary. In case that data is in Binary type, assign in hexadecimal number and a byte data in 2-place hexadecimal number. In case of ASCII type, a letter is processed as byte data.

 

 

[Fixed Value (Others)]
This is the segment assigning general data in the frame made.

 

 

Assign constant value in the type of ASCII or Binary.
In case that data is in Binary type, assign in hexadecimal number and a byte data in 2-place hexadecimal number. In case of ASCII type, a letter is processed as byte data.

 

Fixed Value (Header, Tail, Others) Data Sent

PLC

12345678

12345678

Data Conversion

Binary

ASCII

Other Device

12345678

3132333435363738

 

Fixed Value (Header, Tail, Others) Data Received

Other Device

12345678

3132333435363738

Data Conversion

Binary

ASCII

PLC

12345678

3132333435363738

[Ignore]
This segment is used to ignore assigned-length data after receiving, irrelevantly to the value of received data. This can be set up in case of only the frame received. If the use code is applied, it is distinguished that the letters like the distinguisher of special data are continuously received and the data next to the distinguisher are disregarded. It is available to apply the use code.
If you set the segment length to 255 bytes, be sure to add a fixed-value type segment after it.

 

 

[Memory Link]
This segment is used to send the data stored in the memory of CPU as much as an assigned length or store received data in the memory device of CPU as much as assigned length. The maximum data size is 250Byte. If the use code is applied, it is distinguished that the letters like the distinguisher of the special data are continuously received and the data next to the distinguisher are disregarded. It is available to apply the use code.
If you set the segment length to 255 bytes, be sure to add a fixed-value type segment after it.

 

Convert to ASCII

  • No(Binary)
    This is used to send/receive the data in the memory device of CPU as they are.

  • Hexadecimal Integer
    This is used to convert the data in the memory device of CPU to hexadecimal ASCII data, sending the result. And to convert received hexadecimal ASCII data to binary data, storing the result in the memory of CPU.

  • Decimal Interger
    This is used to convert the data in the memory device of CPU to decimal ASCII data, sending the result. And to convert the received decimal ASCII data to binary data, storing the result in the memory of CPU.

  • Real Number(Float)
    This is used to scale the data in the memory of CPU(Ratio.1-10000), sending the result. And to scale the received data(Ratio.1-10000), storing the result in the memory of CPU.

 

 

If you select the swap word data, upper 1 byte data and lower 1 byte data of the data sent/received are swapped. For example, if the data stored in the memory of CPU is h1234(ASC:1234), the actual data sent will be h3412(ASC:3421). If a received data is h1234(ASC:1234), the actually received data h3412(ASC:3412) will be stored in the memory of CPU.

 

Memory Link Data Sent

PLC

1234h

1234h

1234h

1234h

Data Conversion

No(Binary)

Hexadecimal Integer

Decimal Integer

Real Number (Scaling:10)

Other Device

1234h

31323334

34363630

01D2h

 

 Memory Link Data Received

Other Device

1234h

31323334

34363630

1234h

Data Conversion

No(Binary)

Hexadecimal Integer

Decimal Integer

Real Number (Scaling:10)

PLC

1234h

1234h

1234h

B608h

 

Error Check Type
This is used to check whether the data of a frame are correctly sent/received. It is available to distinguish special data.

[SUM]
This is used to binary-sum an edited frame from the first of a selected range to the last of it and to send/receive data as much as a set length (Byte). Enter a range in the error check range (Range of segments). Refer to the memory link for ASCII data conversion.

 

 

[SUM+MASK]
This is used to binary-sum an edited frame from the first of a selected range to the last of it, masking the binary-summed data with masking value (FFh) and to send/receive data as much as a set length (Byte). Refer to the memory link for ASCII data conversion.

 

 

[XOR]
This is used to binary-or an edited frame from the first of a selected range to the last of it and to send/receive the data as much as a set length (Byte). Refer to the memory link for ASCII data conversion.

 

 

[XOR+MASK]
This is used to binary-or an edited frame from the first of a selected range to the last of it, masking the binary-summed data with masking value (FFh) and to send/receive the data as much as a set length (Byte). Refer to the memory link for ASCII data conversion.

 

 

[MUL]
This is used to binary-mul an edited frame from the first of a selected range to the last of it and to send/receive the data as much as a set length (Byte).

 

 

[MUL+MASK]
This is used to binary-mul an edited frame from the first of a selected range to the last of it, masking the binary-summed data with masking value (FFh) and to send/receive the data as much as a set length (Byte).

 

 

[CRC16]
This is used to CRC16 an edited frame from the first of a selected range to the last of it.