Author Topic: SelectorSwitch3Pos question ModbusTCP  (Read 711 times)

EE_Kraig

  • Newbie
  • *
  • Posts: 37
    • View Profile
SelectorSwitch3Pos question ModbusTCP
« on: March 02, 2017, 07:43:31 PM »
Using this control for an HOA and I have a question just to make sure I have things set up correctly. When I have the switch in left or right position, the value in the PLC register is 256 and zero in the middle. Is that right? Seems like an odd value.

Also, what I'd really like since I'm trying to make a new .NET HMI for an existing PLC, is there a way to have one value sent to one address based on position? So 0 for off, 1 for Auto, 2 for Hand all sent to 40005?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: SelectorSwitch3Pos question ModbusTCP
« Reply #1 on: March 02, 2017, 08:13:07 PM »
Using the SelectSwitch3PosByValue will give that option. Set these properties:

ValueOfCenterPostion = 0
ValueOfLeftPosition = 2
ValueOfRightPosition =1
PLCAddressValue = 40005
Text = "HAND  OFF  AUTO"

EE_Kraig

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: SelectorSwitch3Pos question ModbusTCP
« Reply #2 on: March 06, 2017, 12:23:01 PM »
Using the SelectSwitch3PosByValue will give that option. Set these properties:

ValueOfCenterPostion = 0
ValueOfLeftPosition = 2
ValueOfRightPosition =1
PLCAddressValue = 40005
Text = "HAND  OFF  AUTO"

OK I set it up just like this but it's not working. Maybe I don't understand the control properly. No matter what address I put in the control, when I start my .NET app, the control snaps to the center position. That made me think it was working on feedback, so I forced by PLC address to 2, the control didn't move. I can't click on it to move it off the center. A couple times I was able to click to the left position and it snapped back to center and can no longer click. And when it did let me, then the value is 512 in the PLC??

EE_Kraig

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: SelectorSwitch3Pos question ModbusTCP
« Reply #3 on: March 06, 2017, 01:27:41 PM »
Figured out the 512 thing, I had to change the SwapBytes property for my Modbus driver.

So the main problem remains, can't operate the control.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: SelectorSwitch3Pos question ModbusTCP
« Reply #4 on: March 06, 2017, 02:14:54 PM »
It turns out being a bug in the Modbus driver. Install the patch 2 and it should fix the problem:

https://sourceforge.net/projects/advancedhmi/files/advancedhmi/3.5/Patches

- Download and exact Patch2V399v
- Extract the file
- Open you solution in Visual Studio
- In Solution Explorer, expand down the AdvancedHMIDrivers project
- Right the \support folder and select Add->Existing Item
- Browse to and select the extracted patch
- Rebuild the solution

EE_Kraig

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: SelectorSwitch3Pos question ModbusTCP
« Reply #5 on: March 06, 2017, 03:00:35 PM »
Thanks Archie! Working now.