No announcement yet.

Casting 16 bits to a 16-bit Modbus Holding Register (MHR)

  • Filter
  • Time
  • Show
Clear All
new posts

  • Casting 16 bits to a 16-bit Modbus Holding Register (MHR)

    Good afternoon,

    I'm creating a datalog (data sampling object) on a Weintek HMI (cMT3103) and trying to log the open/closed status of 16 valves in the same Excel csv file with the analog values.

    Analog values for pressure, temperature, & level are sampled every 2 sec, but I'm not sure how to also sample bit elements to the same csv file. Can I cast the 16 valve outputs (Y0-Y15) to a 16-bit MHR address (MHR522:0 - MHR522:15)? This would put it in a single column in the csv file, but another option is to have separate columns for each of the 16 valves. How would I cast the bit status of Y0 to a 16-bit MHR address? Any other suggestions?

    The table below lists the MHR addressing to the Weintek HMI. Screenshot is from EasyBuilder Pro (Data Sampling Object) and shows the Data Record configuration. It starts recording at MHR500 from the Do-More PLC and additional records have to be in chronological order:

    Modbus Holding Register (MHR):
    500-501 Pressure 1
    502-503 Pressure 2
    504-505 Pressure 3
    506-507 Pressure 4
    508-509 Level 1
    510-511 Level 2
    512-513 Temperature 1
    514-515 Temperature 2
    516-517 Temperature 3
    518-519 Temperature 4
    520-521 Temperature 5
    522 Open/closed status of 16 valves

    EasyBuilder Pro - Data Sampling Object
    EasyBuilder Pro (Weintek)

    Thanks for the help!

  • #2
    You just need to do a MOVE of Y0:UW (unsigned word) to MHR522.
    There are 10 kinds of people in this world, those who know binary, and those who do not.