You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@plc4x.apache.org by 蒋怀川 <jh...@163.com> on 2021/11/16 15:38:46 UTC

CANOpen_cant send data to vcan on linux(Ubuntu)

====中文==========================================================================
你好,导师,我是一名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"));
        }
    }
}








Re: CANOpen_cant send data to vcan on linux(Ubuntu)

Posted by Łukasz Dywicki <lu...@code-house.org>.
I did forward this mail to 蒋怀川. I had no get any reply for that.
Do we know if he/she subscribed to our mailing list?

This is first external attempt to use CANopen beside myself, so I don't 
want this to fail! :)

Best,
Łukasz

On 22.11.2021 10:20, Xiangdong Huang wrote:
>> And I might add, that you should subscribe to the mailinglist, by sending an empty email to dev-subscribe@plc4x.apache.org
> 
> If so, I think he may do not receive email replies ...
> 
> 
> -----------------------------------
> Xiangdong Huang
> School of Software, Tsinghua University
> 
>   黄向东
> 清华大学 软件学院
> 
> Christofer Dutz <ch...@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-subscribe@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 <lu...@code-house.org>
>> Sent: Wednesday, November 17, 2021 1:40:33 PM
>> To: dev@plc4x.apache.org <de...@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 蒋怀川 <jh...@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"));
>>>          }
>>>      }
>>> }
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>

RE: CANOpen_cant send data to vcan on linux(Ubuntu)

Posted by Christofer Dutz <ch...@c-ware.de>.
Good point ...

I forwarded my email to his email address.

Chris

-----Original Message-----
From: Xiangdong Huang <sa...@gmail.com> 
Sent: Montag, 22. November 2021 10:21
To: dev@plc4x.apache.org; jhc2681690202@163.com
Subject: Re: CANOpen_cant send data to vcan on linux(Ubuntu)

> And I might add, that you should subscribe to the mailinglist, by 
> sending an empty email to dev-subscribe@plc4x.apache.org

If so, I think he may do not receive email replies ...


-----------------------------------
Xiangdong Huang
School of Software, Tsinghua University

 黄向东
清华大学 软件学院

Christofer Dutz <ch...@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-subscribe@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 <lu...@code-house.org>
> Sent: Wednesday, November 17, 2021 1:40:33 PM
> To: dev@plc4x.apache.org <de...@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 蒋怀川 <jh...@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-can
> > open
> > -->
> >         <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"));
> >         }
> >     }
> > }
> >
> >
> >
> >
> >
> >
> >
> >

Re: CANOpen_cant send data to vcan on linux(Ubuntu)

Posted by Xiangdong Huang <sa...@gmail.com>.
> And I might add, that you should subscribe to the mailinglist, by sending an empty email to dev-subscribe@plc4x.apache.org

If so, I think he may do not receive email replies ...


-----------------------------------
Xiangdong Huang
School of Software, Tsinghua University

 黄向东
清华大学 软件学院

Christofer Dutz <ch...@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-subscribe@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 <lu...@code-house.org>
> Sent: Wednesday, November 17, 2021 1:40:33 PM
> To: dev@plc4x.apache.org <de...@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 蒋怀川 <jh...@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"));
> >         }
> >     }
> > }
> >
> >
> >
> >
> >
> >
> >
> >

Re: CANOpen_cant send data to vcan on linux(Ubuntu)

Posted by Christofer Dutz <ch...@c-ware.de>.
And I might add, that you should subscribe to the mailinglist, by sending an empty email to dev-subscribe@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 <lu...@code-house.org>
Sent: Wednesday, November 17, 2021 1:40:33 PM
To: dev@plc4x.apache.org <de...@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 蒋怀川 <jh...@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"));
>         }
>     }
> }
>
>
>
>
>
>
>
>

Re: CANOpen_cant send data to vcan on linux(Ubuntu)

Posted by Łukasz Dywicki <lu...@code-house.org>.
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 蒋怀川 <jh...@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"));
>         }
>     }
> }
>
>
>
>
>
>
>
>