8devices Korlan USB2CAN 사용자 설명서 - 페이지 9
{카테고리_이름} 8devices Korlan USB2CAN에 대한 사용자 설명서을 온라인으로 검색하거나 PDF를 다운로드하세요. 8devices Korlan USB2CAN 15 페이지. High quality isolated usb to can interface
8devices Korlan USB2CAN에 대해서도 마찬가지입니다: 사용자 설명서 (17 페이지)
sudo apt-get install can-utils
Send byte of information (1122334455667788) to can device with id = "1f334455":
cansend can0 1f334455#1122334455667788
Receive everything on the can1 interface:
candump can1
3.3 Python programming examples for Linux
Python programming examples rely on the python-can module and socket can drivers. Before running
code examples, you shall bring the CAN interface to the UP state using the command:
sudo ip link set can0 up type can bitrate 125000 sample-point 0.875
Example receive_all.py - receives and prints all messages on the screen until Ctr-C is pressed.
import can
bus = can.Bus(channel='can0', interface='socketcan', bitrate=1000000)
for i in range(10):
msg = can.Message(arbitration_id=0xc0ffee, data=[i,2,3,4,5,6,7,8],
is_extended_id=True)
bus.send(msg)
Example send.py - sends 10 CAN messages to the bus.
import can
bus = can.Bus(channel='can0', interface='socketcan', bitrate=1000000)
for i in range(10):
msg = can.Message(arbitration_id=0xc0ffee, data=[i,2,3,4,5,6,7,8],
is_extended_id=True)
bus.send(msg)
KORLAN USB2CAN
USER GUIDE
9