PLC http command to Exor webpanel

To control the dimming level of a Exor panel I need to send this command from plc to panel: POST on https://127.0.0.1/rest/api/v1/display Content-type application/json;charset=utf-8’ Post-data { action: “set_brightness”, brightness: } is a value between 0 and 255 Most handy it would be to put this command in a button at my eHMI page. An other way might be from the plc. I know there is a library ‘PLCnextBase’ with the function “PBCL_SysLinuxShell”, can I use this and how? Kind regards, Wilco

Hello Wilco, the following solutions should be possible: 1. Most handy it would be to put this command in a button at my eHMI page. → For this solution I would like to recommend you to implement a C++ program to send the POST-Command via TCP Socket. In this case you can define the needed In-Port variables (On/Off as Bool and intensity as Int) and connect it in IEC61131 Code (in PLCnext Engineer) to specified Out-Port variables (On/Off as Bool and intensity as Int). Then you can use this variables in eHMI-Page. 2. It should be also possible to use the FB “PBCL_SysLinuxShell” in library ‘PLCnextBase’. Please try at first to send the POST command in Linux-Shell via curl: e.g.: with auth token: XYZ (if needed) curl -v -H “Content-Type: application/json” -H “Authorization: Basic XYZ==” -d ‘{action: “set_brightness”, brightness: }’ -k -X POST https://127.0.0.1/rest/api/v1/display If this command works, you can send it via FB “PBCL_SysLinuxShell”. I hope I could help you. Best Regrads Eduard

Hi Eduard, many thanks for your reply, I will do some tests. Kind regards, Wilco

On the CLI I gave the following command: curl -v -H “Content-Type: application/json” -H “Authorization: Basic YWRtaW46YWRtaW4=” -d ‘{action: “set_brightness”, brightness: 10}’ -k -X POST https://10.0.1.222/rest/api/v1/display Parts, like the authorization seems to bee accepted, although it ends with a fault message. Any idea’s? [admin@axcf2152:~$ curl -v -H “Content-Type: application/json” -H “Authorization: Basic YWRtaW46YWRtaW4=” -d ‘{action: “set_brightness”, brightness: 10}’ -k -X POST https://10.0.1.222/rest/api/v1/display Note: Unnecessary use of -X or --request, POST is already inferred. * Trying 10.0.1.222:443… * Connected to 10.0.1.222 (10.0.1.222) port 443 (#0) * found 129 certificates in /etc/ssl/certs/ca-certificates.crt * ALPN, offering http/1.1 * SSL connection using TLS1.2 / ECDHE_RSA_AES_256_GCM_SHA384 * server certificate verification SKIPPED * server certificate status verification SKIPPED * common name: HMI-f399 (does not match ‘10.0.1.222’) * server certificate expiration date OK * server certificate activation date OK * certificate public key: RSA * certificate version: #3 * subject: CN=HMI-f399 * start date: Thu, 01 Jan 1970 00:00:09 GMT * expire date: Thu, 31 Dec 2037 23:23:23 GMT * issuer: CN=HMI-f399 * ALPN, server accepted to use http/1.1 > POST /rest/api/v1/display HTTP/1.1 > Host: 10.0.1.222 > User-Agent: curl/7.69.1 > Accept: / > Content-Type: application/json > Authorization: Basic YWRtaW46YWRtaW4= > Content-Length: 42 > * upload completely sent off: 42 out of 42 bytes * Mark bundle as not supporting multiuse < HTTP/1.1 400 Bad Request < Date: Tue, 31 Aug 2021 15:52:08 GMT < Content-Type: text/html < Content-Length: 391 < Connection: keep-alive < jmuconfig-auth-user: admin < jmuconfig-auth-groups: dialout video data comm admin < SyntaxError: Unexpected token a at Object.parse (native) at parse (/usr/lib/jmuconfig/server.js:13:424) at /usr/lib/jmuconfig/server.js:9:4910 at IncomingMessage.onEnd (/usr/lib/jmuconfig/server.js:9:7962) at IncomingMessage.g (events.js:180:16) at IncomingMessage.emit (events.js:92:17) at _stream_readable.js:944:16 * Connection #0 to host 10.0.1.222 left intact at process._tickCallback (node.js:458:13) admin@axcf2152:~$ Kind regards, Wilco

Hi Wilco, hmm, hard to say as this is now a pure curl question, maybe you can find soething in the curl - Documentation Overview which might help here… BR, Frank

Hello all, I have found the correct sentence to control the dimming level of an Exor eX7xx panel by the use of cUrl. To get the status of the panel: curl -v -H “Content-Type: application/json” -u admin:admin -k https://10.0.1.222/rest/api/v1/display To set the dimming level to #10 (0..255): curl -v -H “Content-Type: application/json” -u admin:admin -d ‘{“action”:“set_brightness”, “brightness”:“10” }’ -k -X POST https://10.0.1.222/rest/api/v1/display In this example the user is ‘admin’ with password ‘admin’ and the panel is located at ‘10.0.1.222’. And to use it with the plcnext this cUrl sentence should be used with the FB “PBCL_SysLinuxShell” in the library ‘PLCnextBase’. Problem solved (although not tested yet with PBCL_SysLinuxShell :wink: Kind regards, Wilco Meewis