Author Topic: Advanced HMI interface to Automation Direct BRX PLC  (Read 1989 times)

mplekker

  • Newbie
  • *
  • Posts: 10
    • View Profile
Advanced HMI interface to Automation Direct BRX PLC
« on: November 15, 2023, 08:29:13 AM »
Hello,
I'm looking for something that seems to be hard to find.  I am using VS 2023 and Advanced HMI  together with an Automation Direct BRX PLC using the MODBUS protocol.  It works pretty good:  I can use AdvancedHMI's Basic Button from the toolbox for example and it gives me options such as "PLCAddressClick", "PLCAddressVisible" and so on.  On the BRX PLC side it uses discrete MODBUS bits named MC and MI, so that the PLC can communicate with the AdvancedHMI BasicButton.

What I am looking to do now is use a timer inside VS (like a small C program) and control an MC MODBUS bit inside the PLC.  I am trying to build in like a watch dog timer.  The problem I run into is that there is no timer inside the standard AdvancedHMIControls Components Toolbox.  The only timers I find are the ones in the "All Windows Forms" and the "Components" Toolbox sections and those do not have PLC Address properties associated with them.  Could anyone point me into the right direction as to how to approach this?  Basically all I want to do is control a PLC MODBUS input with a blinker or timer inside VS.

Much appreciated!
Mario

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Advanced HMI interface to Automation Direct BRX PLC
« Reply #1 on: November 15, 2023, 09:51:44 AM »
- From the All Windows Forms toolbox, add a timer to the form.
- Set the Interval to the number of milliseconds
- Set Enabled to True
- Double click the timer on the form to get back to code
- Add this code:
Code: [Select]
ModbusTCPCom1.Write("40001",1)

mplekker

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Advanced HMI interface to Automation Direct BRX PLC
« Reply #2 on: December 04, 2023, 04:20:39 PM »
Thank you Archie.  Now if I want to link this ("400001", 1) to a MODBUS address on the PLC, then where can I find the physical modbus address that I am writing to with the timer?  For example, if I use a button with a "PLCAddressClick" value of 99 from the AdvancedHMI Component toolbox and I activate that particular button then I see the status of MC99 change on the BRX PLC side.  Where can I find the input on the BRX PLC side for the timer when I use the ModbusTCPCom1.Write("40001",1) code?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Advanced HMI interface to Automation Direct BRX PLC
« Reply #3 on: December 04, 2023, 05:07:17 PM »
The address of 40001 in AdvancedHMI should write to MHR40001

mplekker

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Advanced HMI interface to Automation Direct BRX PLC
« Reply #4 on: December 04, 2023, 09:08:39 PM »
Got it, thank you again