본문 바로가기
Siemens Automation/TIAPortal STEP7

TSEND_C / TRCV_C SETTING

by 의명 2020. 6. 13.

1. SYSTEM CLOCK MEMORY SETTING



통신을 하고자 하는 새로운 디바이스를 추가하고 하드웨어 설정에 들어가서 SYSTEM CLOCK MEMORY를

세팅하여 주기적으로 데이터를 보낼 수 있는 비트를 CPU에 선언한다.


2. TSEND_C PROGRAM BLOCK 생성



TSEND_C / TRCV_C 블럭은 SYSTEM FUNCTION BLOCK이기 때문에 블럭을 생성할 때에는 반드시

INSTANCE DB를 생성하게 되어 있다. 생성된 DB안에 COMMUNICATION SETTING 값들을 확인할 수 있다.


3. TSEND_C / TRCV_C BLOCK SETTING



TSEND_C, TRCV_C 블록의 속성에 들어가서 보면 구성탭에 연결 파라미터에서 파트너를 지정되지 않음으로

선택을 하고 연결 데이터는 자동 생성으로 선택한 후 파트너 주소에 PLC IP ADDRESS를 입력한다.

액티비 연결 구축 체크는 마스터가 되는 PLC쪽에 체크를 해주면 된다.


4. TSEND_C / TRCV_C BLOCK SETTING




위와 같이 세팅을 하게 되면 서로 데이터를 주고 받을 수 있다.


TSEND_C 블럭과 TRCV_C 블럭의 대한 상세 설명은 아래 참조


REQ

Starts the send job on a rising edge.


CONT

Controls the communication connection:

  • 0: Disconnect the communication connection.

  • 1: Establish and maintain the communication connection.

LEN

Optional parameter (hidden)

Maximum number of bytes to be sent with the job. If you use a send area with optimized access at the DATA parameter, the value "0" must be used at the LEN parameter.


ADHOC

Optional parameter (hidden)

Use ad-hoc mode for the TCP protocol variant


CONNECT

Pointer to the structure of the connection description:

DATA

Pointer to the send area containing the address and the length of the data to be sent.


ADDR

Optional parameter (hidden)

Pointer to the address of the recipient.


COM_RST

Optional parameter (hidden)

Resets the connection:

  • 0: Irrelevant

  • 1: The existing connection is reset.

The COM_RST parameter is reset after evaluation by the "TSEND_C" instruction and should not, therefore, be interconnected statically.


DONE

Status parameter with the following values:

  • 0: Send job not yet started or still in progress.

  • 1: Send job executed without error. This state is only displayed for one cycle.

The output parameter DONE is set if an intermediate step was completed successfully during processing (connection establishment, sending, connection termination) and if the execution of "TSEND_C" was completed successfully.


BUSY

Status parameter with the following values:

  • 0: Send job not yet started or already completed.

  • 1: Send job not yet completed. A new send job cannot be started.


ERROR

Status parameter with the following values:

  • 0: No error

  • 1: Error occurred during connection establishment, data transmission or connection termination.

The output parameter ERROR can be set due to an error in the "TSEND_C" instruction or the communication instructions used internally.


STATUS

Status of instruction (see the "ERROR and STATUS" parameters" description).


RCVD_LEN

Amount of data actually received in bytes

  

지멘스 교육이나 기술지원, 견적 등 문의 사항이 있으시면 언제든지 연락주시고,


제가 도움을 드릴 수 있는 내용은 최대한 답을 드릴수 있도록 하겠습니다.


긴글 읽어주셔서 감사드리고, 틈나는대로 계속 관련 내용 업데이트하도록 하겠습니다


감사합니다.



'Siemens Automation > TIAPortal STEP7' 카테고리의 다른 글

TCON BLOCK 설명  (2) 2020.06.15
MOVE_BLK_VARIANT BLOCK 설명  (4) 2020.06.14
I-DEVICE COMMUNICATION  (6) 2020.06.12
S7-1200 Modbus RTU Sample Program  (1) 2020.06.06
S7-1200 PID CONTROL  (3) 2020.06.05

댓글