Author Topic: Outputs  (Read 1125 times)

mach62468

  • Newbie
  • *
  • Posts: 5
    • View Profile
Outputs
« on: January 11, 2018, 01:38:02 PM »
I am currently trying to use some of the switchs and buttons to control bits on a controlLogix. I can read values but I am unable to write.Any help would be greatly appreciated.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: Outputs
« Reply #1 on: January 11, 2018, 01:51:38 PM »
Create Controller scope tag named MyButton of type BOOL
In AdvancedHMI add a BasicButton to the form
Set PLCAddressClick to MyButton


Create a controller scope tag named MyDint of type DINT
In AdvancedHMI, add a BasicLabel to the form
Set PLCAddressValue to MyDint
Set PLCAddressKeypad to MyDint

Run the application and click on either item

mach62468

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Outputs
« Reply #2 on: January 11, 2018, 02:26:43 PM »
I believe that is what I have done but does not work. See photo below.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: Outputs
« Reply #3 on: January 11, 2018, 03:03:49 PM »
Set the OutputType of your button to Toggle so you can see it better in RSLogix

mach62468

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Outputs
« Reply #4 on: January 12, 2018, 09:25:34 AM »
Ok so it works as long as I dont run my code. How would I set the value of the bit by using code instead of a button?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: Outputs
« Reply #5 on: January 12, 2018, 09:56:11 AM »
EthernetIPforCLXCom1.Write("MyTag", "1")

mach62468

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Outputs
« Reply #6 on: January 12, 2018, 10:50:53 AM »
Thanks alot! Is there somewhere I can find source code like this?

Godra

  • Hero Member
  • *****
  • Posts: 1436
    • View Profile
Re: Outputs
« Reply #7 on: January 12, 2018, 11:18:01 AM »
Out of curiosity, what events did you want to trigger these writes?