Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying an OpenForwardRequest for a Barcode scanner #83

Open
Michailov89 opened this issue Feb 13, 2025 · 6 comments
Open

Trying an OpenForwardRequest for a Barcode scanner #83

Michailov89 opened this issue Feb 13, 2025 · 6 comments

Comments

@Michailov89
Copy link

Michailov89 commented Feb 13, 2025

Hello,
I need to implement a program that is listening to a the barcode value change of the Cognex DM8700DX Scanner. I’m able to read the current value of the barcode in the scanner but polling is not an option for my customer.
So I figured out I need to use an OpenForwardRequest for this. But my code gets an exception when trying to decode the response. Can you please tell what I’m doing wrong.
That’s what my code looks like:

EtherNetIpClientConfig config = EtherNetIpClientConfig.builder("169.254.126.143")
		        .setSerialNumber(0x00)
		        .setVendorId(0x00)
		        .setTimeout(Duration.ofSeconds(5))
		        .build();
                PaddedEPath connectionPath = new PaddedEPath(new PortSegment(1, new byte[]{(byte) 0}));

		CipClient client = new CipClient(config, connectionPath);

		try {
			client.connect().get();
			
            int classId = 0x79;  
            int instanceId = 1;  

    		PaddedEPath servicePath = new PaddedEPath(
    				new LogicalSegment.ClassId(classId),
    				new LogicalSegment.InstanceId(instanceId),
    				new LogicalSegment.AttributeId(0x10)
    	            );
            
            NetworkConnectionParameters parameters = new NetworkConnectionParameters(
                    1, //1 connection ?
                    NetworkConnectionParameters.SizeType.Variable,
                    NetworkConnectionParameters.Priority.Low,
                    NetworkConnectionParameters.ConnectionType.PointToPoint,
                    false);
            
            ForwardOpenRequest request = new ForwardOpenRequest(
                    Duration.ofSeconds(15), // Connection timeout
                    0x10000001,  // O->T (Originator to Target) Connection ID
                    0x10000002,  // T->O (Target to Originator) Connection ID
                    new Random().nextInt(),
                    config.getVendorId(),
                    config.getSerialNumber(),
                    0x01, // Connection Timeout Multiplier
                    servicePath,
                    Duration.ofMillis(500), // O->T Requested Packet Interval (RPI)
                    parameters, // O->T Parameters
                    Duration.ofMillis(500), // T->O Requested Packet Interval (RPI)
                    parameters, // T->O Parameters
                    0xA3 // Transport Class and Trigger (Cyclic updates)
            );
            
            ForwardOpenService service = new ForwardOpenService(request);

            CompletableFuture<CipConnection> future = new CompletableFuture<>();
            //Get connection from pool
            client.sendUnconnectedData(service::encodeRequest).whenComplete((b, ex) -> {
                if (b != null) {
                    try {
                        ForwardOpenResponse response = service.decodeResponse(b);
                        
                        CipConnectionPool.CipConnection connection = new CipConnectionPool.CipConnection(
                        		Duration.ofSeconds(15).toNanos(),
                                response.getO2tConnectionId(),
                                response.getT2oConnectionId(),
                                response.getConnectionSerialNumber(),
                                response.getOriginatorVendorId(),
                                response.getOriginatorSerialNumber());

                        ReferenceCountUtil.release(response.getApplicationReply());

                        System.out.println("Connected to forward open");

                        future.complete(connection);
                    } catch (CipResponseException | CipService.PartialResponseException e) {
                        future.completeExceptionally(e);
                        e.printStackTrace();
                    } finally {
                        ReferenceCountUtil.release(b);
                    }
                } else {
                    future.completeExceptionally(ex);
                    ex.printStackTrace();
                }
            });
            

        } catch (Exception ex) {
            ex.printStackTrace();
        }

This is the link to the object model of the scanner.
This is the link describes the implicit messaging of the scanner

Thank you in advance
Kind regards
Michael

@Michailov89
Copy link
Author

That's the exception i get

com.digitalpetri.enip.cip.CipResponseException: status=0x01 [connection failure] , additional=[0x011C]
	at com.digitalpetri.enip.cip.services.ForwardOpenService.decodeResponse(ForwardOpenService.java:50)
	at de.soffico.channel.ethernetip.landscape.config.testClass.lambda$1(testClass.java:91)
	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
	at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
	at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2179)
	at com.digitalpetri.enip.cip.CipClient.lambda$sendUnconnectedData$8(CipClient.java:222)
	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
	at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
	at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2179)
	at com.digitalpetri.enip.EtherNetIpClient$PendingRequest.lambda$new$0(EtherNetIpClient.java:412)
	at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
	at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
	at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2179)
	at com.digitalpetri.enip.EtherNetIpClient.onChannelRead(EtherNetIpClient.java:220)
	at com.digitalpetri.enip.EtherNetIpClient.access$900(EtherNetIpClient.java:50)
	at com.digitalpetri.enip.EtherNetIpClient$EtherNetIpClientHandler.lambda$channelRead0$0(EtherNetIpClient.java:346)
	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1423)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)

@Michailov89
Copy link
Author

Maybe this is also helpful

$ EZ-EDS Version 3.27.1.20191218 Generated Electronic Data Sheet

[File]
        DescText = "DataMan 8700 Series Reader";
        CreateDate = 12-03-2019;
        CreateTime = 15:06:57;
        ModDate = 12-03-2019;
        ModTime = 15:07:00;
        Revision = 1.1;
        HomeURL = "http://www.cognex.com/";

[Device]
        VendCode = 678;
        VendName = "Cognex";
        ProdType = 773;
        ProdTypeStr = "DataMan 8700 Series Reader";
        ProdCode = 1327;
        MajRev = 1;
        MinRev = 6;
        ProdName = "DataMan DM8700";
        Catalog = "DMR-87XX-00";
        Icon = "DM8700.ico";
        IconContents =
                "AAABAAEAICcAAAEAGABkDwAAFgAAACgAAAAgAAAATgAAAAEAGAAAAAAAAAAA"
                "AGAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAARCQoXBgYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAATExNCQkVPTk9xX11Rsro/v8pkPTsMAgMAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAABqXFpsVlRbSkp+Yl5R2OYA//84wct4W1gdHB4AAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAABucnQewNMwhJJwRkh9WltE2+od//9ubnF3"
                "dXUrLS0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABKPTwC//8A//8mkqFbTFGAX112"
                "cnR9aWd4d3V5eXcqKysAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABdjJE6pLRWUlli"
                "Wlx3dnl3dnV9fHt2dXV6enhpaGkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACk"
                "lpZXWGBxbmyJiYh6enp0a2p0a2qMg4EkJCQAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAACmpqpjZWl8e3qFhYV9fX1vW1lB0dyHd3cAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAABEREOQj5JubW6GhoWIiIiBgYGGcG5y//8tNDUAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAACcnJ50dnV5eXmKioqEhIJ+fn6YjYsrQkYAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAZGRijoqJtbW2Dg4OJiYmAgIB9fX2MiokAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB3dneCg4RzcnSLi4uEhIR9fX+FhYVI"
                "SEgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACfoKNiZWh6enmDhYVzc3Jz"
                "c3WWlpYGBgYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSMSush4OAYmCPgH6G"
                "gYB+fn6AgICJiYkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA5fJQf5P8m7v9K"
                "vs1thId+XFt/cW99fHxOTk4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPEBAAAAAAAABVUE5HPEg8"
                "Xmsm/P8z8v8g+v8l1ud2XV2Sjo0NDQ0AAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAqLC57gYd9fHt2dXUREBCM"
                "iIdOP0k3d4A/+/9C5fIz4/Mf//9oaW2PhoUAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAABAAAMCwolJiZFSUlqcHJ7g4V3gIh/gYNtbG1i"
                "aGtta2qIg4BgU1gk4fNB8f854vEv4O8b+f9ddntRPjwAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAACChYVydHaPl5qoqaqqqaiIhoWhoaJn"
                "ZmVxcG5yb29TVVhNW2RxaGhf//9Q9P8j4/Md3+4X9v9b3OkKAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABfX2GTk5F/gH9VU1QTEhEJCgsA"
                "AACbm5tnZWVra2tubm5zcnFtb3E2KCtceHtl+/9y9/9C5vcV/f9Vp7MAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABJS0twcHBhYmIhIiIVGhsV"
                "HiEQGh0pKiqOjo5sbGxzdHRzcXFwbm52dXRdWlg/NTtXVVZe7PuI+/9e//8U"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACDhIVSUVEHCAgl"
                "JSRYWFxpZmWxrqzd2tpsampubGxxcG9yc3N2dnZycXFiYmFjYF5GOz5QQkBX"
                "3uxv//9OjZYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB1dXVB"
                "QD6WnqDt8fP6+vnk5OTk4uK5tbZfUk9ufoByZmVuampxcHBnaGhjY2Rra2pj"
                "YWFPQkJNNTVV3uyY//8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU"
                "FhaHh4f////4+Pfe3dzR0tLFxcbR0dKGe3pKipFSushujZFyf4Fwb29iYmBl"
                "ZWZpaWhpaWljYmJTSUc+KiiB4/AkHB0AAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAuLjDJycn6+vrX1tbGyMnKzM3JyMnOzs9nWlhGvMlsYGJtXVtxbGxl"
                "ZGRgYGBmZmZnZ2dnZ2dsbGxgYGA/OTlXV10ZEhMAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAA6Ozvf397r7OzW1dXOzc/Gx8jIyMvCwsNUTEtifoFnkpdv"
                "i5Bxb29cXFxkZGJlZWVmZmVnZ2ZpaWlqamhMTUuAgYEPDg4AAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAABLTU3//v/t7+7d3d3U1NTKy8vR0NK+wL9MSkl3"
                "cXB3cG9/fHtsampWVlZeXl5gYF5iYmFjY2NlZWViYWJaWVqPj48AAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAABRVVX19fX+/v7n6ejc3N7b29rz8/S+"
                "vsBdXVxVVVQAAABNTU1ycnJwbm5wcHBpaWlkZGRgYF9aWlpRUVFpaWl2dnYA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACkpaX/////////////"
                "///j4+WOjo6CgoJdXV9BQUCNj4+AgIB8fHx7e3t1dXVzdHR0dHJsbGxdXF2L"
                "i4s8PDwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnJyecnp2p"
                "qaiYlZV+enl7c3KCd3WLgX+Kg4J0cW+Ki4x2d3eEg4ONjYyNjY6GhoaAfoBn"
                "Z2V4eHiMjYsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAWGBg8PDtxfn97n6ac0dmDx9WMtLuMjYz////AxceQkZGUlZe0t7tz"
                "c3KamphmaGpMTk4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaEA88NzhtamuLi4qAgYGko6OV"
                "lJR/f35KSUkiJCQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////////////////z////g"
                "H///4A///+AH///gA///8AP///gD///4B///8Af///AP///gH///4B///+Af"
                "///AP///gD//+wA//8AAf/gAAH/4AAB/8CAA/+AAAP/gAAD/4AAA/8AAAH/A"
                "AAB/wAAAf8AAAP/ACAD/4AAA/+AAAf/4AAP//8AP////////////////////"
                "//8=";

[Device Classification]
        Class1 = EtherNetIP;

[Params]
        Param2 =
                0,
                ,,
                0x0000,
                0xC7,
                2,
                "Input Size",
                "Bytes",
                "",
                2,500,496,
                ,,,,
                ,,,,
                ;
        Param3 =
                0,
                ,,
                0x0000,
                0xC7,
                2,
                "Output Size",
                "Bytes",
                "",
                2,496,496,
                ,,,,
                ,,,,
                ;

        Param4 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Trigger Enable",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param5 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Trigger",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param6 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Buffer Results Enable",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param7 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Results Ack",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param9 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Soft Event 0",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param10 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Soft Event 1",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param11 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Soft Event 2",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param12 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Soft Event 3",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param13 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Soft Event 4",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param14 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Soft Event 5",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param15 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Soft Event 6",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param16 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Soft Event 7",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param17 =
                0,
                ,,
                0x0000,
                0xC7,
                2,
                "User Data Option",
                "",
                "",
                0,65535,0,
                ,,,,
                ,,,,
                ;
        Param18 =
                0,
                ,,
                0x0000,
                0xC7,
                2,
                "User Data Length",
                "",
                "",
                0,65535,0,
                ,,,,
                ,,,,
                ;
        Param19 =
                0,
                ,,
                0x0000,
                0xD1,
                1,
                "User Data",
                "",
                "",
                0,255,0,
                ,,,,
                ,,,,
                ;

        Param22 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Trigger Ready",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param23 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Trigger Ack",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param24 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Acquiring",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param25 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Missed Acq",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param26 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Decoding",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param27 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Decode Complete",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param28 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Results Buffer Overrun",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param29 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Results Available",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param30 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "General Fault",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param31 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Soft Event Ack 0",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param32 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Soft Event Ack 1",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param33 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Soft Event Ack 2",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param34 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Soft Event Ack 3",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param35 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Soft Event Ack 4",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param36 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Soft Event Ack 5",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param37 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Soft Event Ack 6",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param38 =
                0,
                ,,
                0x0000,
                0xC1,
                1,
                "Soft Event Ack 7",
                "",
                "",
                0,1,0,
                ,,,,
                ,,,,
                ;
        Param39 =
                0,
                ,,
                0x0000,
                0xC7,
                2,
                "Trigger ID",
                "",
                "",
                0,65535,0,
                ,,,,
                ,,,,
                ;
        Param40 =
                0,
                ,,
                0x0000,
                0xC7,
                2,
                "Result ID",
                "",
                "",
                0,65535,0,
                ,,,,
                ,,,,
                ;
        Param41 =
                0,
                ,,
                0x0000,
                0xC7,
                2,
                "Result Code",
                "",
                "",
                0,65535,0,
                ,,,,
                ,,,,
                ;
        Param42 =
                0,
                ,,
                0x0000,
                0xC7,
                2,
                "Result Extended",
                "",
                "",
                0,65535,0,
                ,,,,
                ,,,,
                ;
        Param43 =
                0,
                ,,
                0x0000,
                0xC7,
                2,
                "Result Length",
                "",
                "",
                0,65535,0,
                ,,,,
                ,,,,
                ;
        Param44 =
                0,
                ,,
                0x0000,
                0xD1,
                1,
                "Result Data",
                "",
                "",
                0,255,0,
                ,,,,
                ,,,,
                ;

[Assembly]
        Object_Name = "Assembly Object";
        Object_Class_Code = 0x04;
        Assem11 =
                "input format",
                ,
                ,
                0x0000,
                ,,
                1,Param22,              $ Trigger Ready
                1,Param23,              $ Trigger Ack
                1,Param24,              $ Acquiring
                1,Param25,              $ Missed Acq
                4,,                     $ Reserved

                1,Param26,              $ Decoding
                1,Param27,              $ Decode Complete
                1,Param28,              $ Results Buffer Overrun
                1,Param29,              $ Results Available
                3,,                     $ Reserved
                1,Param30,              $ General Fault

                1,Param31,              $ Soft Event Ack 0
                1,Param32,              $ Soft Event Ack 1
                1,Param33,              $ Soft Event Ack 2
                1,Param34,              $ Soft Event Ack 3
                1,Param35,              $ Soft Event Ack 4
                1,Param36,              $ Soft Event Ack 5
                1,Param37,              $ Soft Event Ack 6
                1,Param38,              $ Soft Event Ack 7

                24,,                    $ Reserved

                16,Param39,             $ Trigger ID

                16,Param40,             $ Result ID
                16,Param41,             $ Result Code

                16,Param42,             $ Result Extended
                16,Param43,             $ Result Length

                3872,Param44;           $ Result Data

        Assem21 =
                "output format",
                ,
                ,
                0x0000,
                ,,
                1,Param4,               $ Trigger Enable
                1,Param5,               $ Trigger
                1,Param6,               $ Buffer Results Enable
                1,Param7,               $ Results Ack
                4,,                     $ Reserved

                1,Param9,               $ Soft Event 0
                1,Param10,              $ Soft Event 1
                1,Param11,              $ Soft Event 2
                1,Param12,              $ Soft Event 3
                1,Param13,              $ Soft Event 4
                1,Param14,              $ Soft Event 5
                1,Param15,              $ Soft Event 6
                1,Param16,              $ Soft Event 7

                16,,                    $ Reserved

                16,Param17,             $ User Data Option
                16,Param18,             $ User Data Length

                3904,Param19;           $ User Data

[Connection Manager]
        Object_Name = "Connection Manager Object";
        Object_Class_Code = 0x06;
        Connection1 =
                0x84030002,             $ trigger & transport
                                        $  
                                        $  value  bits
                                        $    2:   0-15 = supported transport classes (class 1)
                                        $    1:     16 = cyclic (1 = supported)
                                        $    0:     17 = change of state (0 = not supported)
                                        $    0:     18 = on demand (0 = not supported)
                                        $    0:  19-23 = reserved (must be zero)
                                        $    4:  24-27 = exclusive owner
                                        $    0:  28-30 = reserved (must be zero)
                                        $    0:     31 = client 0 (don't care for classes 0 and 1)
                                        $  
                0x44640405,             $ connection parameters
                                        $  
                                        $  value  bits
                                        $    1:      0 = O=>T fixed (1 = supported)
                                        $    0:      1 = O=>T variable (0 = not supported)
                                        $    1:      2 = T=>O fixed (1 = supported)
                                        $    0:      3 = T=>O variable (0 = not supported)
                                        $    0:    4-7 = reserved (must be zero)
                                        $    4:   8-11 = O=>T header (4 byte run/idle)
                                        $    0:  12-15 = T=>O header (no header)
                                        $    4:  16-19 = O=>T connection type (point-to-point)
                                        $    6:  20-23 = T=>O connection type (multicast, point-to-point)
                                        $    4:  24-27 = O=>T priority (scheduled)
                                        $    4:  28-31 = T=>O priority (scheduled)
                                        $  
                ,Param3,Assem21,        $ O=>T RPI,Size,Format
                ,Param2,Assem11,        $ T=>O RPI,Size,Format
                ,,                      $ config part 1 (not used)
                ,,                      $ config part 2 (not used)
                "Consume Data From/Produce Data To",    $ connection name
                "",                     $ Help string
                "20 04 24 01 2c 15 2c 0b";

        Connection2 =
                0x82030002,             $ trigger & transport
                                        $  
                                        $  value  bits
                                        $    2:   0-15 = supported transport classes (class 1)
                                        $    1:     16 = cyclic (1 = supported)
                                        $    0:     17 = change of state (0 = not supported)
                                        $    0:     18 = on demand (0 = not supported)
                                        $    0:  19-23 = reserved (must be zero)
                                        $    2:  24-27 = input only
                                        $    0:  28-30 = reserved (must be zero)
                                        $    0:     31 = client 0 (don't care for classes 0 and 1)
                                        $  
                0x44640305,             $ connection parameters
                                        $  
                                        $  value  bits
                                        $    1:      0 = O=>T fixed (1 = supported)
                                        $    0:      1 = O=>T variable (0 = not supported)
                                        $    1:      2 = T=>O fixed (1 = supported)
                                        $    0:      3 = T=>O variable (0 = not supported)
                                        $    0:    4-7 = reserved (must be zero)
                                        $    3:   8-11 = O=>T header (0 byte heartbeat)
                                        $    0:  12-15 = T=>O header (no header)
                                        $    4:  16-19 = O=>T connection type (point-to-point)
                                        $    6:  20-23 = T=>O connection type (multicast,point-to-point)
                                        $    4:  24-27 = O=>T priority (scheduled)
                                        $    4:  28-31 = T=>O priority (scheduled)
                                        $  
                ,0,,                    $ O=>T RPI,Size,Format
                ,Param2,Assem11,        $ T=>O RPI,Size,Format
                ,,                      $ config part 1 (not used)
                ,,                      $ config part 2 (not used)
                "Consume Data From",    $ connection name
                "",                     $ Help string
                "20 04 24 01 2c fe 2c 0b";    $ inputs only path

        Connection3 =
                0x84030002,             $ trigger & transport
                                        $  
                                        $  value  bits
                                        $    2:   0-15 = supported transport classes (class 1)
                                        $    1:     16 = cyclic (1 = supported)
                                        $    0:     17 = change of state (0 = not supported)
                                        $    0:     18 = on demand (0 = not supported)
                                        $    0:  19-23 = reserved (must be zero)
                                        $    4:  24-27 = exclusive owner
                                        $    0:  28-30 = reserved (must be zero)
                                        $    0:     31 = client 0 (don't care for classes 0 and 1)
                                        $  
                0x44643405,             $ connection parameters
                                        $  
                                        $  value  bits
                                        $    1:      0 = O=>T fixed (1 = supported)
                                        $    0:      1 = O=>T variable (0 = not supported)
                                        $    1:      2 = T=>O fixed (1 = supported)
                                        $    0:      3 = T=>O variable (0 = not supported)
                                        $    0:    4-7 = reserved (must be zero)
                                        $    4:   8-10 = O=>T header (4 byte run/idle)
                                        $    0:     11 = reserved (must be zero)
                                        $    3:  12-14 = T=>O header  (0 byte heartbeat)
                                        $    0:     15 = reserved (must be zero)
                                        $    4:  16-19 = O=>T connection type (point-to-point)
                                        $    4:  20-23 = T=>O connection type (point-to-point)
                                        $    4:  24-27 = O=>T priority (scheduled)
                                        $    4:  28-31 = T=>O priority (scheduled)
                                        $  
                ,Param3,Assem21,        $ O=>T RPI,Size,Format
                ,0,,                    $ T=>O RPI,Size,Format
                ,,                      $ config part 1 (not used)
                ,,                      $ config part 2 (not used)
                "Produce Data To",      $ connection name
                "",                     $ Help string
                "20 04 24 01 2c 15 2c fe";    $ outputs only path

[Port]
        Object_Name = "Port Object";
        Object_Class_Code = 0xF4;
        Port1 =
                TCP,
                "EtherNet/IP port",
                "20 F5 24 01",
                1,
                0x15,
                ;

[TCP/IP Interface Class]
        Revision = 4;
        Object_Name = "TCP/IP Interface Object";
        Object_Class_Code = 0xF5;
        MaxInst = 1;
        Number_Of_Static_Instances = 1;
        Max_Number_Of_Dynamic_Instances = 0;


@csobsidian
Copy link

status=0x01 [connection failure] , additional=[0x011C]

I believe the extended response code for 0x011C is "Transport Class Not Supported"

@Michailov89
Copy link
Author

status=0x01 [connection failure] , additional=[0x011C]

I believe the extended response code for 0x011C is "Transport Class Not Supported"
Thank you. But what does it mean and where in the code is the mistake?

@kevinherron
Copy link
Contributor

status=0x01 [connection failure] , additional=[0x011C]
I believe the extended response code for 0x011C is "Transport Class Not Supported"
Thank you. But what does it mean and where in the code is the mistake?

I think the "Transport Class and Trigger" parameter should be 0x01, not 0xA3.

But even if this works you're still very much on your own after that. The library only supports Class 3 (explicit messaging).

You'll need a copy of the EtherNet/IP spec and a healthy understanding of Class 1 to get any further I think.

@Michailov89
Copy link
Author

Ok, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants