Author Topic: web page 0.htm DM32 value display  (Read 56 times)

TriRob84

  • Newbie
  • *
  • Posts: 6
  • I'm a llama!
    • View Profile
web page 0.htm DM32 value display
« on: October 07, 2019, 09:14:33 AM »
Hi, on base 0.htm page there are DM1 to DM4 values displayed, what directions should I take if I want to display a value from DM32 double register  in one of display fields. My Nano-10 is collecting data from external Energy meter via Modbus where used energy counter is above 65565 so it clocked up next register by one. Im seeing 13885 and 1 in two registers, I also can see correct DM32 value in Nano just don't know how to change what type of register is displayed on HMI display (double instead of integer) and/or how to read DM32 in N.js file.Regards. 

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3095
    • View Profile
    • Internet Programmable PLCs
Re: web page 0.htm DM32 value display
« Reply #1 on: October 08, 2019, 06:34:21 AM »
If you have two 16-bit value, say lower 16-bit in DM[1] and upper 16-bit in DM[2], then you can form a 32-bit number by defining a variable in Javascript such that:

var data32 = DM[2]<<16 + DM[1]

You will need to know some javascript and jquery so that you can insert the value of the variable "data32" into the 0.htm page from the javascript file M.JS (in particular the refreshScreen() function) so that it will display on the 0.htm page.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

TriRob84

  • Newbie
  • *
  • Posts: 6
  • I'm a llama!
    • View Profile
Re: web page 0.htm DM32 value display
« Reply #2 on: October 08, 2019, 08:56:23 AM »
Thanks for directions, I do have script for Integer and float to be displayed on build in htm pages so gonna try workout DM32 to be displayed based on that. Thanks again.