AndyPLC
Member
I'm attempting to read tags from a 1756L81E(FactoryTalk Logix Echo) controller using the PLC4J api. I have one read and one write bool setup in the controller tags set for external access of read/write and read only, respectively. Using the remote run, I can see/update the tags via Logix Designer. I can also connect to the PLC using the software I have, but when I go to read, I'm getting "Unsupported case for discriminated type" when I get the response.
PLC4J code below:
Output in logs:
Any thoughts or Missing information from the post?
PLC4J code below:
Code:
try (PlcConnection plcConnection = new PlcDriverManager().getConnection("eip://127.0.0.1")) {
if (!plcConnection.getMetadata().canRead()) {
logger.error("PLC connection doesn't support reading.");
return;
}
logger.info("PLC connector connected");
// Create a new read request:
PlcReadRequest.Builder builder = plcConnection.readRequestBuilder();
logger.info("Created Builder");
builder.addItem("value-1", "%Output_Tag[0]:BOOL:1");
PlcReadRequest readRequest = builder.build();
// Register a callback executed as soon as a response arrives.
logger.info("Make sync request for PLC data");
PlcReadResponse readResponse = readRequest.execute().get(5000, TimeUnit.MILLISECONDS);
if (readResponse != null) {
printPlcResponse(readResponse);
} else {
logger.error("An error reading PLC, response is NULL");
}
} catch (PlcConnectionException e) {
e.printStackTrace();
}
Output in logs:
Code:
DEBUG o.a.plc4x.java.spi.Plc4xNettyWrapper - Forwarding request to plc CipRRData[sessionHandle=1073741845,status=0,senderContext={0,0,0,0,0,0,0,0},options=0,exchange=CipExchange[service=CipUnconnectedRequest[unconnectedService=CipReadRequest[RequestPathSize=7,tag={-111,10,79,117,116,112,117,116,95,84,97,103,40,0},elementNb=1],backPlane=0,slot=0]]]
DEBUG o.a.p.j.s.GeneratedDriverByteToMessageCodec - Sending bytes to PLC for message CipRRData[sessionHandle=1073741845,status=0,senderContext={0,0,0,0,0,0,0,0},options=0,exchange=CipExchange[service=CipUnconnectedRequest[unconnectedService=CipReadRequest[RequestPathSize=7,tag={-111,10,79,117,116,112,117,116,95,84,97,103,40,0},elementNb=1],backPlane=0,slot=0]]] as data 6f0030001500004000000000000000000000000000000000000000000000020000000000b2002000520220062401059d12004c07910a4f75747075745f5461672800010001000000
WARN o.a.p.j.s.GeneratedDriverByteToMessageCodec - Error decoding package with content [6f0018001500004000000000000000000000000000000000000000000000020000000000b2000800d200010111030100]: Unsupported case for discriminated type
org.apache.plc4x.java.spi.generation.ParseException: Unsupported case for discriminated type
Any thoughts or Missing information from the post?