Doc. # 1-0000061 | |||
---|---|---|---|
Date Updated | 01-22-2004 | Date Created | 07-27-2000 |
Document Type | Knowledge Base | Related OS | |
Related Product | ADAM-4525/ ADAM-5000/CAN |
How to send 5000/CAN command through ADAM-4525 without utility? | |||
---|---|---|---|
Solution:
Actually, the syntax on page 5 is only for ADAM-4525, you can use it such as commands on page 6 to set or read configurations of ADAM-4525. If you would like to send a CAN command to your CAN device via ADAM-4525, you can follow the below steps to finish it:
We assume you want to send "Open Connection Request" to 5000/CAN, and Source MAC ID is 00H, Destination MAC ID is 01H, then
Step1: Regarding to page 67 of 5000/CAN manual, the command of "Open Connection Request" is 780+AA,BB,4b,00,CX, because AA=0, BB=1, C=3 (Group 3), X=0 (Please refer to page 67 to get detailed information), the command becomes 780,01,4b,00,30.
Step2: Based on page 316 of 5000/CAN manual, you can transfer 780 (Hex) to 11 bit (binary). First, that is to say, 780 Hex => 111 1000 0000 Binary. After that, add RTR bit and DLC (Data Length) in the last, just like the following:
111 1000 0000 => 111 1000 0000 0 0100 (RTR must be 0, data length is 4 bytes because this command "780,01,4b,00,30" includes 4 bytes data). According to page 67, transfer the above command to 2 bytes:
111 1000 0000 0 0100 => 1111 0000 0000 0100 => F0 04 Hex
Step3: Now you get the command for serial port, that is F0,04,01,4b,00,30 (command 780,01,4b,00,30 for CAN => transfer => command F0,04,01,4b,00,30 for serial port). Because this command consists of hexidecimal, if you want to send it from serial port, you should change its data type, that means you must use string type for serial command. Maybe the below flowchart is helpful for you:
"F" "0" "0" "4" "0" "1" "4" "b" "0" "0" "3" "0" => RS-232 => F0,04,01,4b,00,30 => CAN chip => 780,01,4b,00,30
|