> And I might add, that you should subscribe to the mailinglist, by sending an > empty email to dev-subscr...@plc4x.apache.org
If so, I think he may do not receive email replies ... ----------------------------------- Xiangdong Huang School of Software, Tsinghua University 黄向东 清华大学 软件学院 Christofer Dutz <christofer.d...@c-ware.de> 于2021年11月17日周三 下午8:48写道: > > And I might add, that you should subscribe to the mailinglist, by sending an > empty email to dev-subscr...@plc4x.apache.org > > I had to moderate your email manually... If you're subscribed this happens > automatically. > > Chris > > Holen Sie sich Outlook für Android<https://aka.ms/AAb9ysg> > ________________________________ > From: Łukasz Dywicki <l...@code-house.org> > Sent: Wednesday, November 17, 2021 1:40:33 PM > To: dev@plc4x.apache.org <dev@plc4x.apache.org> > Subject: Re: CANOpen_cant send data to vcan on linux(Ubuntu) > > Hey, > There might be several reasons why you can't see anything on the interface. > > 1. Interface is down, make sure you perform both commands: > sudo ip link add dev vcan1 type vcan > sudo ip link set up vcan1 > 2. The candump command might not list "loopback" messages, I am not sure of > that, but you need to verify its options. > You can also use interface statistics to see if counters go up: > ip -details -statistics link show vcan1 > > Let me know if any of above helps. The PDO address you use is valid and > should trigger message on the bus. > > Best, > Łukasz > > > śr., 17 lis 2021 o 13:26 蒋怀川 <jhc2681690...@163.com> napisał(a): > > > > > ====中文========================================================================== > > > > 你好,导师,我是一名java程序员,我在使用canopen当中遇到一些相关的疑问。如下面的截图所示,我向vcan发送数据,但是Vcan没有打印出任何提示信息。这种问题我需要如何处理,谢谢。 > > > > > > > > ====English======================================================================== > > Hello, tutor, I'm a java developer,I have some questions about using > > CANopen. As shown in the screenshot below, I sent data to Vcan, but Vcan > > did not print any prompt information. How do I deal with this problem? > > Thank you. > > > > > > > > ====code========================================================================== > > <dependencies> > > <!-- > > https://mvnrepository.com/artifact/org.apache.plc4x/plc4j-driver-canopen > > --> > > <dependency> > > <groupId>org.apache.plc4x</groupId> > > <artifactId>plc4j-driver-canopen</artifactId> > > <version>0.8.0</version> > > </dependency> > > </dependencies> > > > > =================================================================================== > > package com; > > > > > > import org.apache.plc4x.java.api.exceptions.PlcConnectionException; > > import org.apache.plc4x.java.api.messages.PlcWriteRequest; > > import org.apache.plc4x.java.api.messages.PlcWriteResponse; > > import org.apache.plc4x.java.canopen.CANOpenPlcDriver; > > import org.apache.plc4x.java.spi.connection.DefaultNettyPlcConnection; > > > > > > import java.util.concurrent.CompletableFuture; > > import java.util.concurrent.ExecutionException; > > > > > > public class CANOpenVcanDemo { > > public static void main(String[] args) > > throws PlcConnectionException, ExecutionException, > > InterruptedException { > > String canInterface = "vcan1"; > > String connectionString = > > String.format("canopen:socketcan://%s?nodeId=11", > > canInterface); > > DefaultNettyPlcConnection plcConnection = > > (DefaultNettyPlcConnection) new > > CANOpenPlcDriver().getConnection(connectionString); > > plcConnection.connect(); > > if (plcConnection.isConnected()){ > > System.out.println("Connected"); > > }else { > > System.out.println("not Connected"); > > return; > > } > > if (plcConnection.getMetadata().canWrite()) { > > PlcWriteRequest.Builder builder = > > plcConnection.writeRequestBuilder(); > > //String address = "SDO:11:0x1600/0x01:INTEGER64"; > > String address = "RECEIVE_PDO_1:11:INTEGER64"; > > //CANOpenDataType > > builder.addItem("rpdo_0x200", address,123); > > PlcWriteRequest plcWriteRequest = builder.build(); > > CompletableFuture<PlcWriteResponse> completableFuture = > > (CompletableFuture<PlcWriteResponse>) > > plcWriteRequest.execute(); > > System.out.println("===========>flag"); > > PlcWriteResponse plcWriteResponse = completableFuture.get(); > > > > System.out.println(plcWriteResponse.getResponseCode("rpdo_0x200")); > > } > > } > > } > > > > > > > > > > > > > > > >