4 예제
4.1 투명한 변환
1. 직렬 포트→CAN
GCAN-207 will send the serial data to CAN-Bus immediately if GCAN-207 receive the serial data.


예: 직렬 데이터 11 22 33 44 55 66 77 88은 CAN-Bus로 변환됩니다. 프레임 ID는 사용자가 설정한 "发送标识符"에 대한 구성입니다. 프레임 데이터는 11 22 33 44 55 66 77 88입니다.
2. CAN→직렬 포트
GCAN-207 will send the CAN data to serial port immediately if GCAN-207 receive the CAN data.


E.g.:Check“允许CAN帧信息转发到串行帧中”and“允许CAN帧标识转发到串行帧中”which means the CAN frame information(帧信息) and the frame ID (帧标识)will display in the serial frame.
CAN frame is standard data frame. Frame ID is 00 01. Frame data is 11 22 33 44 55 66 77 88. GCAN-207 converts to Serial port. Serial data is 08 00 01 11 22 33 44 55 66 77 88.
4.2 아이덴티티를 통한 투명한 전환
ID 변환을 통해 투명하게 변환하는 것은 투명 변환의 특별한 용도입니다.
1. 직렬 포트→CAN
사용자는 구성에서 시작 위치 주소와 CAN 프레임 ID의 길이를 설정할 수 있습니다.
E.g.:If the CAN frame ID starting position address is 1, the length is 2 in the Serial frame.
Serial frame data is 01 23 33 44 55 66 77 88. GCAN-207 converts to CAN. CAN frame ID is 123, and frame data is 33 44 55 66 77 88.
2. CAN→직렬 포트
E.g.:If the CAN frame ID starting position address is 1, the length is 3 in the Serial frame(Extension frames). Conversion is shown as Figure below.


4.3 Format conversion
Each CAN frame of GCAN-207 contains 13 bytes, which include CAN frame information+ frame ID + frame data.
CAN frame    CAN frame    CAN frame    CAN frame    ……    CAN frame

FF:Standard frame and extended frame identification, 1 for extension frames, 0 for the standard frame.
RTR:Remote frame and data frame identification, 1 for remote frame, 0 for the data frame.
Reserve:Retains the value is 0.
D3~D0 :Data length, data which CAN frame length.


Note: Each frame is fixed on 13 bytes, insufficient must fill 0, otherwise will cause communication error.