Instructions for User Program

SEND(P)

 

Function

This is the instruction used to send frame data of user type from a master station to slave stations. To use this instruction, a user protocol is to be selected as action mode protocol and to be downloaded in the RS232C/422/485 card setup. SEND instruction is to be executed by pulse.

 

 

FORAMT

 image-20240321-092120.png

 

 

  • PID: This is used to assign the name or the ID of special program.

  • F_NAME

    • This is used to enter a frame name or to assign a frame number. The number is to be assigned according to the following form.

    • Format in case of assigning a frame number

      • Upper byte(Bit 8-F): Assigning communication form(0: RS232C, 1: RS422/485)

      • Lower byte(Bit 0-7): Frame number in special program

 

 

Assigning communication form (Upper byte)

Frame number (Lower byte)

 

[Ex.] In case communication form is RS232C and the frame of which number is 3 is sent,

SEND     (PID)     h0003     (Result)

 

 

Result

  •  The word device informed of the result of sending is assigned.

  • Result Format

    • First Bit(Bit 0): In case of having been sent, 1 Scan On.

    • Second Bit(Bit 1): In case of having not been sent, always On.

    • Third Bit – Eighth Bit(Bit 2-7): Always Off.

    •  Ninth Bit – Sixteenth Bit(Bit 8-F): Error Code.(0=No Error)

Error Code

Not Use

In case of an error in sending, On

In case of having been sent, 1Scan On

Bit 8 ~ F

Bit 2 ~ 7

Bit 1

Bit 0

 

 

Example of Application

The following is an example of PLC program that a frame is sent to a slave station, in case that the special program file name of a master station is SENDING and the frame name registered to a protocol editor is TEST1.

image-20240321-092305.png

 

RECV(P)

 

Function

This is the instruction used in slave stations to receive frame data from a master station. In case that a data accords with the frame of user form and is normal frame, the flag indicating received(Bit 0) is turned on. To use this instruction, a user protocol is to be selected as action mode protocol and to be downloaded in the RS232C/422/485 card setup. RECV instruction is to be executed by pulse.

 

FORAMT

image-20240321-092322.png

 

 

 PID: This is used to assign the name or the ID of special program.

F_NAME

  • This is used to enter a frame name or to assign a frame number. The number is to be assigned according to the following form.

  •  Format in case of assigning a frame number

  • Upper byte(Bit 8-F): Assigning communication form(0: RS232C, 1: RS422/485)

  • Lower byte(Bit 0-7): Frame number in special program

 

Assigning communication form (Upper byte)

Frame number (Lower byte)

 

[Ex.] In case communication form is RS422/485 and the frame of which number is 5 is sent,

RECV     (PID)     h0105     (Result)

 

 

Result

The word device informed of the result of sending is assigned.

 Result Format

  • First Bit(Bit 0): In case of having been sent, 1 Scan On.

  • Second Bit(Bit 1): In case of having not been sent, always On.

  • Second Bit(Bit 1): In case of having not been sent, always On.

  • Third Bit – Eighth Bit(Bit 2-7): Always Off.

  • Ninth Bit – Sixteenth Bit(Bit 8-F): Error Code.(0=No Error)

 

Error Code

Not Use

In case of an error in receiving, On

In case of having been received, 1Scan On

Bit 8 ~ F

Bit 2 ~ 7

Bit 1

Bit 0

 

 

 

Example of Application

Using RS232C/422/485 card, slave stations receive data from a master station. After receiving the data, the slave stations compare them with assigned frame data. The following is an example of PLC program that the frame is sent to a slave station, in case that a special program file name is RECEVING and the frame name registered in a protocol editor is TEST2.