Author Topic: Bit write with Logix ethernet / How to get data type from Read()  (Read 1939 times)

spaderkung

  • Newbie
  • *
  • Posts: 7
    • View Profile
Hi all,

To make this work I have the following solution, that unfortunately does not work for INT.bit, only for DINT.bit. Is there a way to get the datatype from the driver read response? Then I can do it right.

The CIP message should as I understand it (1756-PM020A-EN-P, page 12) report the datatype, so it would be nice to be able to get that one too when calling AdvancedHMIDrivers.EthernetIPforCLXCom.Read().

This is my current solution, not usable for INT - only DINT.
1. Detect if the tag has a dot suffix - Tag.x
2. Read Tag as DINT and bit mask to desired value
3. Write tag as DINT

« Last Edit: January 16, 2015, 07:13:51 AM by spaderkung »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5311
    • View Profile
    • AdvancedHMI
Re: Bit write with Logix ethernet / How to get data type from Read()
« Reply #1 on: January 16, 2015, 07:33:42 AM »
Dim TagInfo As MfgControl.AdvancedHMI.Drivers.CLXTag
TagInfo=EthernetIPforCLXCom1.GetTagInformation("MyTag")

spaderkung

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Bit write with Logix ethernet / How to get data type from Read()
« Reply #2 on: January 16, 2015, 09:12:36 AM »
Thanks,

I did not have that method in my version, and have upgrade to using BetaV397c, more specifically the drivers:
AdvancedHMIDrivers.dll
MfgControl.AdvancedHMI.Drivers.dll

I built the AdvancedHMI solution on my PC and has referenced the compiled drivers.

EDIT: This version seems to have affected my whole project. I cannot connect anymore.
AdvancedHMIDrivers.EthernetIPforCLXCom connection = new AdvancedHMIDrivers.EthernetIPforCLXCom();
connection.IPAddress = "...";

NullReferenceException on Line 115 in EthernetIPforCLXCom.vb.
And a MsgBox saying: Incomplete solution.

« Last Edit: January 16, 2015, 09:39:13 AM by spaderkung »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5311
    • View Profile
    • AdvancedHMI
Re: Bit write with Logix ethernet / How to get data type from Read()
« Reply #3 on: January 16, 2015, 12:48:23 PM »
If you are trying to put the latest drivers into a version that is older than 3.80, it will not work. There were some major architecture changes on Version 3.80.

The only way to upgrade is to import all of your forms and classes into the latest solution, then correct the namespace issues.

spaderkung

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Bit write with Logix ethernet / How to get data type from Read()
« Reply #4 on: January 16, 2015, 01:42:33 PM »
Ok, thanks again.

The error is there for all above v3.70 as you said. But I do not understand why.

I do not have any namespace issues reported by VS and everything compiles ok. Although using my old project, I wrote a new test class and the only thing I did was to create an instance of it, but modify the IP-property throws exception.

My application does not contain any UI, only read/write operations. It only uses the drivers mentioned; not the ones for control. Could there be some build issues (version/architecture) changes made in 3.80 that are hidden from VS because the direct calls to some DLL?

« Last Edit: January 16, 2015, 02:21:02 PM by spaderkung »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5311
    • View Profile
    • AdvancedHMI
Re: Bit write with Logix ethernet / How to get data type from Read()
« Reply #5 on: January 16, 2015, 02:47:45 PM »
If you are getting a popup of "Incomplete Solution", then not all of the components are there with the Solution. It means some or all of the controls or drivers have been removed from the Solution. This in turn can cause other exceptions.

spaderkung

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Bit write with Logix ethernet / How to get data type from Read()
« Reply #6 on: January 16, 2015, 03:12:26 PM »
Many thanks, resolved

At least for the exception, it was AdvancedHMIControls.dll that was needed. So I hope it will work now, but I have no PLC until after the weekend.

I saw another thread in the bug section where it was reported that the dependencies had increased in the later versions... I can understand why as the focus of the project is a HMI platform. But this would be a cleaner and more configurable platform if the graphical interfaces which I believe are in the "Control" was separated from the IO-part contained in "Drivers".

And I saw that v 1.70 also had the GetTagInfo(), so I could have settled for that to solve my original question : )

The dll's needed are
AdvancedHMIControls  (for versions > 1.7 up to and including v 1.97, which was the most recent)
AdvancedHMIDrivers
MfgControl.AdvancedHMI.Drivers
« Last Edit: January 16, 2015, 03:21:31 PM by spaderkung »