Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - larryhts

Pages: 1 ... 5 6 [7]
91
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?????

92
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

93
Thanks again Godra

94
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

95
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

96
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.

97
How about a Controls Component that could convert and display modbus tcp  strings.

Thanks Larry

98
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

Pages: 1 ... 5 6 [7]