Author Topic: What would you like to see in the next major release?  (Read 81117 times)

czeman

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: What would you like to see in the next major release?
« Reply #60 on: January 07, 2018, 10:16:19 PM »
I would Like to see a driver for the AutomationDirect Productivity series processors Ethernet/IP. I have been using them more and more to replace the Allen Bradley's in our machine builds. Thanks

What's wrong with using modbus tcp?

There are limitations as to what you can do versus what you'd be able to with native (for lack of a better term?) communications with the processor. It also increases development time. I'm using a DoMore PLC to control my home lighting, smoke detectors, sump pumps, etc. and would LOVE a driver for the Automation Direct controllers. I'd be willing to purchase good drivers.

+1 for Automation Direct drivers

Chris

larryhts

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: What would you like to see in the next major release?
« Reply #61 on: January 17, 2018, 04:42:27 PM »
How about a Controls Component that could convert and display modbus tcp  strings.

Thanks Larry

Godra

  • Hero Member
  • *****
  • Posts: 1436
    • View Profile
Re: What would you like to see in the next major release?
« Reply #62 on: January 17, 2018, 10:01:09 PM »
How about a Controls Component that could convert and display modbus tcp  strings.

Thanks Larry

For now, you could try using the BasicLabel control from this post:

http://advancedhmi.com/forum/index.php?topic=1946.msg11054#msg11054

larryhts

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: What would you like to see in the next major release?
« Reply #63 on: January 18, 2018, 06:15:05 AM »
How about a Controls Component that could convert and display modbus tcp  strings.

Thanks Larry

For now, you could try using the BasicLabel control from this post:

http://advancedhmi.com/forum/index.php?topic=1946.msg11054#msg11054

Thanks Godra,  I will try it out today.

larryhts

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: What would you like to see in the next major release?
« Reply #64 on: January 18, 2018, 08:23:18 AM »
How about a Controls Component that could convert and display modbus tcp  strings.

Thanks Larry

For now, you could try using the BasicLabel control from this post:

http://advancedhmi.com/forum/index.php?topic=1946.msg11054#msg11054

Thanks Godra,  I will try it out today.

I have updated the SubscriptionHandler in the "AdvancedHMIControls" and the BasicLable in the Controls Folder. I have set the modbusDriver max length and when I run the project I still get no value. If  I set the "InterpretValueAsModbusString" back to False I get a numerical value  from the address. This shows that the string is there.  I tried using  Archie's Button read and it works but I need a  read without the click event.
Private Sub btnRead_Click(sender As Object, e As EventArgs) Handles btnRead.Click
        Dim length As Integer = 6
        Dim i As Integer = 0
        Dim StartAddress As Integer
        Dim Buffer As String = Nothing
        While i < length
            StartAddress = 40009 + i
            val = ModbusTCPCom1.Read(StartAddress)
            Dim BufferBytes As Byte() = BitConverter.GetBytes(val)
            Dim SingleChar() As Char = {"", ""}
            'From integer to ascii
            SingleChar(0) = Chr(BufferBytes(1))
            SingleChar(1) = Chr(BufferBytes(0))
            Buffer = Buffer & SingleChar(0) & SingleChar(1)
            i += 1
        End While
        tbxRead.Text = Buffer
    End Sub

Larry

larryhts

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: What would you like to see in the next major release?
« Reply #65 on: January 18, 2018, 03:34:02 PM »
How about a Controls Component that could convert and display modbus tcp  strings.

Thanks Larry

For now, you could try using the BasicLabel control from this post:

http://advancedhmi.com/forum/index.php?topic=1946.msg11054#msg11054

Thanks Godra,  I will try it out today.

I have updated the SubscriptionHandler in the "AdvancedHMIControls" and the BasicLable in the Controls Folder. I have set the modbusDriver max length and when I run the project I still get no value. If  I set the "InterpretValueAsModbusString" back to False I get a numerical value  from the address. This shows that the string is there.  I tried using  Archie's Button read and it works but I need a  read without the click event.
Private Sub btnRead_Click(sender As Object, e As EventArgs) Handles btnRead.Click
        Dim length As Integer = 6
        Dim i As Integer = 0
        Dim StartAddress As Integer
        Dim Buffer As String = Nothing
        While i < length
            StartAddress = 40009 + i
            val = ModbusTCPCom1.Read(StartAddress)
            Dim BufferBytes As Byte() = BitConverter.GetBytes(val)
            Dim SingleChar() As Char = {"", ""}
            'From integer to ascii
            SingleChar(0) = Chr(BufferBytes(1))
            SingleChar(1) = Chr(BufferBytes(0))
            Buffer = Buffer & SingleChar(0) & SingleChar(1)
            i += 1
        End While
        tbxRead.Text = Buffer
    End Sub

Larry

I copied the wrong code sorry.  Here is the code that works with the button"
 Private Sub BtnReadPLCClick(sender As Object, e As EventArgs) Handles btnReadPLC.Click

        Dim str(8) As String

        '* Read it from the PLC
        str = ModbusTCPCom31.Read("40002", str.Length)

        Dim ResultString As String

        ResultString = MfgControl.AdvancedHMI.Drivers.Common.CalculationsAndConversions.WordsToString(str)

        tbxReadPLC.Text = ResultString

        Debug.Print(ResultString)

    End Sub"


This converts the the modbus right  to display the string. Using the new basic label I get the integer values for the string. Any help would be great.  I will be using this on about 10 AutomationDirect P250's as a collection point for the sql database. Thanks for your time and effort on this great product......

Larry

Godra

  • Hero Member
  • *****
  • Posts: 1436
    • View Profile
Re: What would you like to see in the next major release?
« Reply #66 on: January 18, 2018, 06:01:00 PM »
I have attached pictures of my test project.

Why don't you go ahead and try to replicate it in a fresh AHMI v3.99x project (besides for the bottom BasicLabel which was using EthernetIPforCLX driver)?
Remember to replace the BasicLabel control and SubscriptionHandler class (you do this by adding each one of them as existing item to their corresponding folder).

Each BasicLabel for Modbus has only 1 address inside PLCaddressKeypadCollection (the same address as its PLCAddressValue) so you can use the AlphaKeyboard pop up to write strings.
« Last Edit: January 18, 2018, 07:38:15 PM by Godra »

Godra

  • Hero Member
  • *****
  • Posts: 1436
    • View Profile
Re: What would you like to see in the next major release?
« Reply #67 on: January 18, 2018, 08:41:15 PM »
The modified BasicLabel control was updated and replaced (so download it again from the link provided previously).

larryhts

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: What would you like to see in the next major release?
« Reply #68 on: January 18, 2018, 09:01:46 PM »
Thanks again Godra

larryhts

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: What would you like to see in the next major release?
« Reply #69 on: January 19, 2018, 06:57:39 AM »
Thanks again Godra

Godra,      I tried as you said" new start up, downloaded and added both The "SubscriptionHandler & BasicLabel" this morning added one modbusTCPCom driver Copyed your settings except for the IP address and point address. Was on line with the PLC in view.
Still when run the label is blank with the "InterpretValueAsModbusString" set to true.
If I set it to false The label show the integer value for the regester address.
The PLC is a "AutomationDirect P2-550. I am not sure what to do. I need it to be able to poll the address's running in the back ground. No user input.  I am able to read the string using a "BasicBotton" and a"AnalogValueDisplay"  From a post by Archie.


Private Sub btnReadArchie_Click(sender As Object, e As EventArgs) Handles btnReadArchie.Click
        Dim str(4) As String
        '* Read it from the PLC
        str = ModbusTCPCom1.Read("40009", str.Length)
        Dim ResultString As String
        ResultString = MfgControl.AdvancedHMI.Drivers.Common.CalculationsAndConversions.WordsToString(str)
        tbxReadArchie.Text = ResultString
    End Sub

Godra

  • Hero Member
  • *****
  • Posts: 1436
    • View Profile
Re: What would you like to see in the next major release?
« Reply #70 on: January 19, 2018, 10:36:34 AM »
I just tried it as you did and it didn't work for me either.

This seems to have something to do with subscriptions or the driver, since a single BasicLabel with enabled InterpretValueAsModbusString property doesn't subscribe properly.

If you put another BasicLabel on the form and set its PLCAddressValue to 40008 (or some other 4xxxx address), not necessarily enabling the InterpretValueAsModbusString, then your first label should show the string.
« Last Edit: January 19, 2018, 11:40:07 AM by Godra »

Godra

  • Hero Member
  • *****
  • Posts: 1436
    • View Profile
Re: What would you like to see in the next major release?
« Reply #71 on: January 19, 2018, 11:03:45 AM »
This definitely has something to do with the driver's Subscribe function since it doesn't work if I try to use it through the code, without any BasicLabel on the form.

This doesn't work:
        Me.ModbusTCPCom1.Subscribe("40008", 2, 250, AddressOf PolledDataReturned)

This works:
        Me.ModbusTCPCom1.Subscribe("40008", 1, 250, AddressOf PolledDataReturned)

This also works:
        Me.ModbusTCPCom1.Subscribe("40008", 1, 250, AddressOf PolledDataReturned)
        Me.ModbusTCPCom1.Subscribe("40009", 10, 250, AddressOf PolledDataReturned)

This also works:
        Me.ModbusTCPCom1.Subscribe("40008", 5, 250, AddressOf PolledDataReturned)
        Me.ModbusTCPCom1.Subscribe("40015", 10, 250, AddressOf PolledDataReturned)

Archie would have to check this.
« Last Edit: January 19, 2018, 11:14:36 AM by Godra »

larryhts

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: What would you like to see in the next major release?
« Reply #72 on: January 19, 2018, 12:40:57 PM »
I just tried it as you did and it didn't work for me either.

This seems to have something to do with subscriptions or the driver, since a single BasicLabel with enabled InterpretValueAsModbusString property doesn't subscribe properly.

If you put another BasicLabel on the form and set its PLCAddressValue to 40008 (or some other 4xxxx address), not necessarily enabling the InterpretValueAsModbusString, then your first label should show the string.

I just tried it with the 2 basiclabels and still got nothing as the string in the first got the integer in the second one.

Not sure where to go from here?????

Godra

  • Hero Member
  • *****
  • Posts: 1436
    • View Profile
Re: What would you like to see in the next major release?
« Reply #73 on: January 19, 2018, 01:04:10 PM »
All I could suggest is that you download the ModRSsim2 simulator, use it instead of your PLC and see if you will get the responses I've been mentioning.

Godra

  • Hero Member
  • *****
  • Posts: 1436
    • View Profile
Re: What would you like to see in the next major release?
« Reply #74 on: January 19, 2018, 01:13:33 PM »
Here is one more suggestion for tests with your PLC:

In Visual Studio, open the BasicLabel class and set a breakpoint as it is in the attached picture.
Then run the app and see if it stops at that line.