Notifications
Clear all

Programming a new serial protocol for QHMI

2 Posts
2 Users
0 Reactions
3,903 Views
Posts: 1
Member
Topic starter
 

Is it possible to program a new serial protocol for QHMI. Can Java Script running as part of QHMI be used to access a serial channel and get information from a serial device using the device specific protocol and then update tags inside QHMI with the information received from the serial channel?.


 
Posted : 19/05/2023 6:44 pm CEST
Matthias
Posts: 35
Member Admin
 

Hello,

you have to keep in mind that currently all JavaScript that is written in QuickHMI is executed on the client. Not the server. So unless you have a serial device on each connecting client this won't work. At some time in the future we might support server side JavaScript using Node, but that is still some time away.

If you have client side serial devices you might want to look at this article: https://developer.mozilla.org/en-US/docs/Web/API/SerialPort

Since I don't have a serial device at hand at the moment, I unfortunately couldn't test the function. In any case, the user of the visualisation must allow the connection to the serial device at least once with a mouse click.


 
Posted : 23/05/2023 8:48 am CEST