Search in sources :

Example 6 with SimulatedField

use of org.apache.plc4x.java.simulated.field.SimulatedField in project plc4x by apache.

the class SimulatedDeviceTest method random.

@Test
public void random() {
    SimulatedDevice device = new SimulatedDevice("foobar");
    SimulatedField field = SimulatedField.of("RANDOM/foo:Integer");
    Optional<PlcValue> value = device.get(field);
    assertTrue(value.isPresent());
}
Also used : PlcValue(org.apache.plc4x.java.api.value.PlcValue) SimulatedField(org.apache.plc4x.java.simulated.field.SimulatedField) Test(org.junit.jupiter.api.Test)

Aggregations

SimulatedField (org.apache.plc4x.java.simulated.field.SimulatedField)6 PlcValue (org.apache.plc4x.java.api.value.PlcValue)4 HashMap (java.util.HashMap)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 PlcField (org.apache.plc4x.java.api.model.PlcField)2 DefaultPlcSubscriptionField (org.apache.plc4x.java.spi.model.DefaultPlcSubscriptionField)2 Test (org.junit.jupiter.api.Test)2 PlcReadResponse (org.apache.plc4x.java.api.messages.PlcReadResponse)1 PlcWriteResponse (org.apache.plc4x.java.api.messages.PlcWriteResponse)1 PlcResponseCode (org.apache.plc4x.java.api.types.PlcResponseCode)1 DefaultPlcReadResponse (org.apache.plc4x.java.spi.messages.DefaultPlcReadResponse)1 DefaultPlcWriteResponse (org.apache.plc4x.java.spi.messages.DefaultPlcWriteResponse)1 ResponseItem (org.apache.plc4x.java.spi.messages.utils.ResponseItem)1 PlcLINT (org.apache.plc4x.java.spi.values.PlcLINT)1