Author Topic: New Version 3.99x Now Available  (Read 4392 times)

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
New Version 3.99x Now Available
« on: July 17, 2017, 09:45:39 AM »
V3.99x
BarLevel - Added ShowValue property
EthernetIPforCLXCom - fixed problem with writing UDINT
Keypad - Was throwing exception if limits were set and Enter was clicked with nothing
Modbus - Fixed problem when writing "FALSE" to a bit
PLCAddressItem - did not support the ListSeparator for globalization
EthernetIPforCLXCom - Added BeginWriteRaw and WriteRaw for writing complete UDTs using byte array
GraphicIndicator - Added Flash1 property
EthernetIPforCLXCom - Added WriteCustomString for user defined strings
EthernetIPforCLXCom - Added WriteUDT for writing complete UDT based on Structure or Class
EthernetIPforCLXCom - Added ReadRaw to return the byte array in raw format
Emailer - fixed a problem when using Username and password
IniParser - Made values preserve case, but section and keys remain case insensitive
BarMeter - New control
SelectorSwitch3PosByValue - corrected image alignment with small legend plate
BasicLabel - New numeric keypad



A new feature has been added to the EthernetIPforCLXCom driver that has been heavily requested for a long time. This is the ability to write all data to a UDT in a single call. Since this feature takes a little knowledge of code writing and can get complex, there are a couple resources to help with it:

http://advancedhmi.com/documentation/index.php?title=WriteUDT

https://github.com/AdvancedHMI/AdvancedHMICodeSamples/tree/master/EthernetIPforCLXCom/WriteUDT


« Last Edit: July 17, 2017, 02:33:50 PM by Archie »

Phrog30

  • Guest
Re: New Version 3.99x Now Available
« Reply #1 on: July 17, 2017, 02:19:43 PM »
Is reading udts on the horizon?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: New Version 3.99x Now Available
« Reply #2 on: July 17, 2017, 02:27:38 PM »
Is reading udts on the horizon?
Should be in the next version. A ReadRaw method is in this release which is the first step toward ReadUDT

Phrog30

  • Guest
Re: New Version 3.99x Now Available
« Reply #3 on: July 17, 2017, 09:33:21 PM »
Awesome, looking forward to it. 

I noticed a few things on the new release, mainly on the new keypad:
1.  The new keypad is missing the keypad passcode.  I don't use this, but for users that did I would assume this would break their app.
2.  If you open the keypad and click in the white box you can then enter text and other characters.  I had prevented this in my version.
3.  Curious why you removed the current value and min/max values from showing on the keypad.  It's really more desirable to show the user the allowed min/max values before they are entered. I also made the whitebox red when values were exceeded.

Just my two pennies.

James

Phrog30

  • Guest
Re: New Version 3.99x Now Available
« Reply #4 on: July 17, 2017, 09:44:37 PM »
Question on writing UDT's, looking at your example:

Code: [Select]
'* Declare the main type that matches the UDT to write to
        Dim rm As RawMaterialType
        rm.RawMaterialID = "Copper"
        rm.TimeStarted.Year = 2017
        rm.TimeStarted.Month = 7
        rm.TimeStarted.Day = 15

        rm.Location = 11
        rm.Tolerance = 0.5
        rm.TargetWeight = 100

        '* Since an Array within a Structure points to an array, we create that array, then assign the
        '* Structure variable to it
        Dim li(2) As LotInformationType
        li(0).ActualWeight = 1
        li(0).LotNumber = "ABCDEF"
        li(0).ExpirationDate = "12/31/2050"
        rm.LotInformation = li

        EthernetIPforCLXCom1.WriteUDT("MyRawMaterial", rm)

Do you have to write to the UDT will all members defined?  Meaning, if I left off "rm.TimeStarted.Day = 15" in defining "RawMaterialType", would the write still work?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: New Version 3.99x Now Available
« Reply #5 on: July 17, 2017, 10:25:14 PM »
1.  The new keypad is missing the keypad passcode.  I don't use this, but for users that did I would assume this would break their app.
2.  If you open the keypad and click in the white box you can then enter text and other characters.  I had prevented this in my version.
3.  Curious why you removed the current value and min/max values from showing on the keypad.  It's really more desirable to show the user the allowed min/max values before they are entered. I also made the whitebox red when values were exceeded.
The Min, Max, and current values will only show up when any of those property values are set. This was done to make a more compact keypad when they are not used. They do not show up when used with the BasicLabel because the validation is done in the BasicLabel code and not the keypad. The BasicLabel will need to be modified for this to work as intended. Since it is still a work in progress, only the BasicLabel uses the new keypad.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: New Version 3.99x Now Available
« Reply #6 on: July 17, 2017, 10:32:17 PM »
Do you have to write to the UDT will all members defined?  Meaning, if I left off "rm.TimeStarted.Day = 15" in defining "RawMaterialType", would the write still work?
If you do not set the value, it will be written as a 0. WriteUDT sends an array of bytes that align with the UDT using the same rules the PLC uses for packing the values in memory, therefore all values are written. The only way to selectively write elements is to write them individually.

If you do not define every UDT element within the VB structure, then it will either not work, or you will get undetermined results.

Phrog30

  • Guest
Re: New Version 3.99x Now Available
« Reply #7 on: July 17, 2017, 10:41:00 PM »
Do you have to write to the UDT will all members defined?  Meaning, if I left off "rm.TimeStarted.Day = 15" in defining "RawMaterialType", would the write still work?
If you do not set the value, it will be written as a 0. WriteUDT sends an array of bytes that align with the UDT using the same rules the PLC uses for packing the values in memory, therefore all values are written. The only way to selectively write elements is to write them individually.

If you do not define every UDT element within the VB structure, then it will either not work, or you will get undetermined results.

That's what I was afraid of.  You may find this to be a huge problem.  As a big user of structured data types, I may have a very large structure.  At the same time I may only want to read or write to one, or just a few members.  It doesn't seem very efficient to have to write to all even if you don't need to.  UDT's are very powerful, hopefully you will find a way to get your driver to work with them effectively.

James

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: New Version 3.99x Now Available
« Reply #8 on: July 17, 2017, 11:06:56 PM »
That's what I was afraid of.  You may find this to be a huge problem.  As a big user of structured data types, I may have a very large structure.  At the same time I may only want to read or write to one, or just a few members.  It doesn't seem very efficient to have to write to all even if you don't need to.  UDT's are very powerful, hopefully you will find a way to get your driver to work with them effectively.
I don't know what you mean by working with them effectively. Write can write to individual elements. Write can also write to atomic arrays embedded in UDT. WriteUDT can completely populate a large UDT with data very quickly. WriteUDT can populate data on an embedded UDT within another UDT. WriteUDT can write to a single element of a UDT array.

Tell me what software or driver offers a better option and I will look into how it works.

Phrog30

  • Guest
Re: New Version 3.99x Now Available
« Reply #9 on: July 18, 2017, 08:11:05 AM »
Let me ask the question again, I don't think I asked correctly and/or used the correct example.

If I want to write to a UDT with 100 members starting at member 5 and stopping at member 15, do I have to write to the entire structure, or just the 10 that I want?  As long as the data is contiguous will it work?  In my original question/example, I should have used "rm.TargetWeight = 100" instead of "rm.TimeStarted.Day = 15".  I would expect if I skipped a member that things would not work.  But, if I have to write to an entire array just to change a few, then that would be a problem.

When you said, "WriteUDT can populate data on an embedded UDT within another UDT. ", that sounds like it will.  I assume embedded is nested?

James

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: New Version 3.99x Now Available
« Reply #10 on: July 18, 2017, 11:48:33 AM »
If I want to write to a UDT with 100 members starting at member 5 and stopping at member 15, do I have to write to the entire structure, or just the 10 that I want?  As long as the data is contiguous will it work?  In my original question/example, I should have used "rm.TargetWeight = 100" instead of "rm.TimeStarted.Day = 15".  I would expect if I skipped a member that things would not work.  But, if I have to write to an entire array just to change a few, then that would be a problem.

When you said, "WriteUDT can populate data on an embedded UDT within another UDT. ", that sounds like it will.  I assume embedded is nested?
If you are wanting to use the WriteUDT to write data starting at any random atomic value within a UDT, then it will not work. The reason is the starting point references an atomic value and not a UDT, therefore it will not write data beyond the atomic element. I would be surprised if any software had this capability because it could create very unpredictable results if random blocks of bytes were allowed to be written and span across tag memory locations. In fact, if you even start at the beginning of a UDT and try to write only part of the data, the PLC will reject it with "Not Enough Data".

If you are referring to populating a UDT that is nested in the middle of another UDT, then it will work because the reference tag is a UDT. For instance, lets say you had a UDT with 2 UDT's nested into it, one for read only values and one for write values. You can use WriteUDT to populate the writable values without disturbing the read only values because you would be referencing a UDT type and not an atomic value.

In the first case, it is still necessary to write values to individual tags within the UDT. The other possibility to do this with a single packet would require an implementation of a MultiWrite, which is not implemented in the AdvancedHMI driver.

Phrog30

  • Guest
Re: New Version 3.99x Now Available
« Reply #11 on: July 18, 2017, 03:01:09 PM »
I can't really speak for other drivers or packages.  Except for alarming, I've never really had a need for multi read/write, however, that was in other packages.  I do know that CLX/CpLX can write/copy data into the middle of a UDT, but that is comparing apples to oranges.  I think what you have developed so far is very good.  Honestly, I would rather use AHMI over FTViewME anyday!!

"The other possibility to do this with a single packet would require an implementation of a MultiWrite, which is not implemented in the AdvancedHMI driver.", is this on the todo list? :)

James

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5260
    • View Profile
    • AdvancedHMI
Re: New Version 3.99x Now Available
« Reply #12 on: July 19, 2017, 08:48:01 AM »
"The other possibility to do this with a single packet would require an implementation of a MultiWrite, which is not implemented in the AdvancedHMI driver.", is this on the todo list? :)
Yes, this will eventually be in a future version.

Homie

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: New Version 3.99x Now Available
« Reply #13 on: March 15, 2018, 11:57:02 AM »
Good Morning

I purchased the CLX driver some time ago (end of 2016).
Now I start a new project, and want to use the latest version for that (Want to use UDTs).
Is there a way to download the latest version to include it into my project?
The link always brought me to same version to download.

Is there a schedule for the next major version? Maybe not called beta.
Including propper UDT reading?

Best Regards
Thomas