SoftPLS
Allows you to write and run custom logic directly on a Evolo Gateway
Written By Aleksander Bless
Last updated 14 days ago
The SoftPLS application allows you to write and run custom logic directly on a Evolo Gateway. The logic is written in JavaScript and runs cyclically based on the update frequency.
Get started
Go to Configuration โ Applications
Click "Add Application"
Fill in the fields for the application
The following fields must be filled in:
Name and description Enter a name for the application and add a description if desired
Gateway Select the gateway for the data points to be used.
Run Frequency (ms) Time interval in milliseconds between each run of the program.
Data points To be read/written.
Writing logic:
You write the logic yourself in JavaScript. There are no limitations on functionality, and all Node.js functions are available.
Reading data points:
const value = datapoints[0];
Writing to data points:
write(0, true);
Example: Write true to data point 0 if the value is greater than 10:
if (datapoints[0] > 10) { write(0, true); }Logging:
For logging to the Gatewayโs system log:
utils.log_info('Dette er en informasjonsmelding'); utils.log_error('Dette er en feilmelding');Storing temporary values:
SoftPLS provides access to a memory object for storing data between cycles. Data is saved to the Gatewayโs hard drive up to every 10 minutes.
memory.lastExec = new Date().getTime(); memory.counter = memory.counter ? memory.counter + 1 : 1;
Example: Saving the system clock to delay an action.
Important limitations:
Maximum of 100 data points per application.
At least one data point must be read or written.
Data points without data return zero.
Use log_info(), log_error(), and write() with caution to avoid overloading the system log and fieldbus.