This preconfiguration can be used with the objects: PmaFolder or PmaRoot.
Creates the
PmaFolder object with subobjects:
-
Commun with objects and methods configured as communication driver interface.
-
Test contains panel and data for testing the communication with connected devices.
The created preconfigured connection is functional usually immediately. Otherwise it is necessary to obtain the connection parameters specified by the device manufacturer or in the documentation: PmChar - Driver for communication by user defined ASCII/BIN protocol.
- The panel is used for communication testing and it is not essential for the functionality.
PmaFolder Test has methods that call methods with the same names in the
Commun object. There is additional the "
onReceive" method that contains examples of processing individual cathegories of communication requests.
The control itself in the image is solved step by step. By repeatedly calling the "
StartGetReceive" method by the
Start Get API button and selecting the appropriate parameter in the URL address, you can, for example, find information about the device on URL:
urladdr/api/devices/XXXXX. In the left half of the image, JSON structure data is visible as it came from the communication. In the right half of the image, these data is displayed as processed in the
"onReceive" method.
By adding
/state to the end of the address and by calling the "
StartGetReceive" method it is possible to detect current state of the device. If the device allows changing some state or value it can be entered into
PUT parameters parameter. The corresponding property and its value must be entered in correct syntax (example:
{"on":true} or
{"brightness":100,"red":255,"green":255,"blue":0}, etc.)
Complete entry of URL address with the parameter before calling the
StartPutReceive method by pressing the
Start Put API button may, for example, look like this:
url:
http://217.197.144.56:9090/api/devices/46458 and PUT parameters:
{"brightness":100,"red":255,"green":255,"blue":0}
These configurators can be set before the preconfiguration is created:
The name of created object | Name of the object created in the tree of Pma objects. The maximum name length is 30 characters. This is a system name, so it must contain only alphanumeric and must not contain any diacritics, empty string, spaces and the first character must not be a number. Default: "iNELS" |
---|
|
URL address and port | |
---|