@Override
    public CompletableFuture<PlcWriteResponse> write(PlcWriteRequest writeRequest) {
        Map<String, PlcResponseCode> tags = new HashMap<>();
        for (String tagName : writeRequest.getTagNames()) {
            if(writeRequest.getTagResponseCode(tagName) == PlcResponseCode.OK) {
                SimulatedTag tag = (SimulatedTag) writeRequest.getTag(tagName);
                PlcValue value = writeRequest.getPlcValue(tagName);
                device.set(tag, value);
                tags.put(tagName, PlcResponseCode.OK);
            } else {
                tags.put(tagName, writeRequest.getTagResponseCode(tagName));
            }
        }
        PlcWriteResponse response = new DefaultPlcWriteResponse(writeRequest, tags);
        return CompletableFuture.completedFuture(response);
    }
Connection to a test device.
This class is not thread-safe.
plc4j/drivers/simulated/src/main/java/org/apache/plc4x/java/simulated/connection/SimulatedConnection.java