Closed rafaelkan closed 7 years ago
Datapoint types are translated using subtypes of tuwien.auto.calimero.dptxlator.DPTXlator
.
For example, DPST-1-3
is main number 1 and subtype 3, and corresponds to DPTXlatorBoolean.DPT_ENABLE
. Its ID is "1.003". You can do either of the following:
... = new DPTXlatorBoolean(DPTXlatorBoolean.DPT_ENABLE);
... = TranslatorTypes.createTranslator(DPTXlatorBoolean.DPT_ENABLE);
... = TranslatorTypes.createTranslator(1, "1.003");
Note that the DPST notation is not directly supported.
Calimero cannot automatically know the exact datapoint types you require. If you want to keep a list of your datapoints, you can use a DatapointMap
with StateDP
s.
OK,
DPTXlatorBoolean dptx = new DPTXlatorBoolean(DPTXlatorBoolean.DPT_ENABLE);
and now how do I get the value of a group and read it?
Take a look at the methods of tuwien.auto.calimero.process.ProcessCommunicator/Impl
.
If you add a process event listener, a ProcessEvent
provides a method getASDU()
. The ASDU you can also pass to a matching DPT translator.
For example how do I know how to read/write 'DPST-1-3' or 'DPST-5-1'