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 - juanma1364

Pages: [1]
1
Support Questions / Re: Reading of multiple Modbus RTU bit registers
« on: March 25, 2020, 10:00:01 PM »
Godra you're right, this is my first experience with AdvancedHMI.

The idea is precisely to know it to get to use it more frequently.

I take advantage of your comments and all your answers to move forward.

Thank you very much Godra

2
Support Questions / Re: Reading of multiple Modbus RTU bit registers
« on: March 25, 2020, 06:58:13 PM »

Godra, I've tried the component
"Data Subscriber 21" and the following code:

 Private Qs As String = ""
    Private Sub DataSubscriber21_DataReturned (As Object sender, and As Drivers.Common.PlcComEventArgs)
        If e.ErrorId = 0 Then
            If e.PlcAddress = "011313,16" Then
                Me.Label9.Text = ""
                Qs = ""
                For i = 0 To e.Values.Count - 1
                    If i = e.Values.Count - 1 Then
                        Qs & = "Q" & (i + 1) & "=" & e.Values ​​(i)
                    Else
                        Qs & = "Q" & (i + 1) & "=" & e.Values ​​(i) & ","
                    End If
                Next
                Me.Label9.Text = Qs
            End If
        End If
    End Sub

    Private QQs As String = ""
    Private Sub ModbusRTUCom1_DataReceived (sender As Object, and As Drivers.Common.PlcComEventArgs) Handles ModbusRTUCom1.DataReceived
        If e.ErrorId = 0 Then
            If e.PlcAddress = "011313.6" Then
                Me.Label10.Text = ""
                QQs = ""
                For i = 0 To e.Values.Count - 1
                    If i = e.Values.Count - 1 Then
                        QQs & = "Q" & (i + 1) & "=" & e.Values ​​(i)
                    Else
                        QQs & = "Q" & (i + 1) & "=" & e.Values ​​(i) & ","
                    End If
                Next
                Me.Label10.Text = Qs
            End If
        End If
    End Sub


And I still don't get the plot I need.

this gives me the following data output:

"05 01 2C 30 00 01 F4 D1"

And I need this data output:

"05 01 2C 30 00 10 34 DD"

I have this problem with several AdvancedHMI components in their Property "PLCAddressValue", the Modbus function "01" with the address "011313,16" does not support me

The only thing that works for me is the code:

"ModbusRTUCom1.Read (" 011313 ", 16)"

I hope I don't bother with so many questions.

Greetings and thanks

3
Support Questions / Re: Reading of multiple Modbus RTU bit registers
« on: March 25, 2020, 05:35:12 PM »
Ok Godra..I will try to use that with the associated events.

4
Support Questions / Re: Reading of multiple Modbus RTU bit registers
« on: March 25, 2020, 05:21:33 PM »

Right Godra,
The code is in the

"Private Sub MainForm_Load"

I only did it as proof.

Now I am going to use the AdvancedHMI components to carry out the continuous execution of the program at BITS level.

Godra..you are a genius.

If you have an example code for me that you want to share, I would appreciate it

Thank you

5
Support Questions / Re: Reading of multiple Modbus RTU bit registers
« on: March 25, 2020, 05:03:53 PM »
Surely godra

At this moment I am proceeding to implement the event "DataReceived" with the necessary modifications and I test.

Thank you very much again Godra

6
Support Questions / Re: Reading of multiple Modbus RTU bit registers
« on: March 25, 2020, 04:54:06 PM »
Ok Godra, Thank you very much for your answers.

I don't always use the serial port monitor, only when AdvancedHMI doesn't give me the frame I need and I want to see what it's sending.

Also the serial monitor in this case was not causing me problems.

It was just that it was necessary to send the correct frame requested by the PLC Manufacturer.

I already managed to find the solution, modify this:

 "Private Sub MainForm_Load (sender As Object, and As EventArgs) Handles MyBase.Load
    Dim Q1 () As String
    Q1 = ModbusRTUCom1.Read ("1: 11313", 16)
    Label2.Text = Q1 (1)
    End Sub "

For this:

 "Private Sub MainForm_Load (sender As Object, and As EventArgs) Handles MyBase.Load
    Dim Q1 () As String
    Q1 = ModbusRTUCom1.Read ("011313", 16)
    Label2.Text = Q1 (1)
    End Sub "

This last one correctly sends me the frame I need and I get the response from the PLC at Bit level.

I can only optimize the code

Thanks and regards

7
Support Questions / Re: Reading of multiple Modbus RTU bit registers
« on: March 25, 2020, 10:30:04 AM »
I add information that may help.

I have tried "Modbus Poll" and had no problems, it shows me the bits corresponding to the state of the Outputs.

Attached image.

I only need to be able to see those bits in AdvancedHMI, to then sample them, with different AdvancedHMI components.

Greetings and thanks for the help.

8
Support Questions / Re: Reading of multiple Modbus RTU bit registers
« on: March 25, 2020, 07:42:11 AM »
Dear Godra, good morning.

I just ran the test with the event "DataReceived".
The result remains the same, that is, I get an error, the response of the slave through what the serial port shows me is as follows:

"05 81 51 C0 6D"

Interpreting the PLC manufacturer's manual, it tells me that code 51 determines the following:

"
Exception Code 51

Telegram error (function code error, error coding
Registration, data quantity error) "

This error, I interpret, is generated by me because I am not sending you the Correct Mdbus Telegram,
I am sending the following telegram:

"05 01 2C 30 00 01 F4 D1"

When should I send the following telegram:

"05 01 2C 30 00 10 34 DD"

Since the manufacturer of the PLC asks me that when using the Modbus function "01" always use multiples of 16.

How could I send the telegram with the Modbus function "01" and multiples of 16 in AdvancedHMI?

I hope I have been clear in the development of the problem I have.

Thank you very much for the help.

9
Support Questions / Re: Reading of multiple Modbus RTU bit registers
« on: March 24, 2020, 08:50:36 PM »

I'm going to test with the event "DataReceived" and publish the result tomorrow.

Thank you very much Godra for all your help.

10
Support Questions / Re: Reading of multiple Modbus RTU bit registers
« on: March 24, 2020, 07:28:06 PM »

Godra

I have changed the address to 011313 and the error persists.


11
Support Questions / Re: Reading of multiple Modbus RTU bit registers
« on: March 24, 2020, 06:15:57 PM »
You are right Godra .. sorry.

The error also continues.

Send screenshot

12
Support Questions / Re: Reading of multiple Modbus RTU bit registers
« on: March 24, 2020, 05:53:24 PM »
Thank you very much Godra for your prompt response, I am going to test the code and comment on the result.

I send a screenshot of what ModbusMaster generated.

The error appears in the image.

I have tried modifying the points.

I have tried 16 points and the error at the exit is
"05 01 02 0B"

1 point and 10 points.
the error at the exit is
"05 81 51 C0"

And I could not receive any response from the slave.

13
Support Questions / Re: Reading of multiple Modbus RTU bit registers
« on: March 24, 2020, 05:19:18 PM »

sorry godra, interpret ModbysMaster as a patch.

On why I use code, it was simply to do a quick test with code that I had read in the advancedHMI forums.

I will try to do what you tell me with the event "DataReceived"

and I will publish the results

14
Support Questions / Re: Reading of multiple Modbus RTU bit registers
« on: March 24, 2020, 04:42:11 PM »

Ok Godra I do the test.

How is the procedure to install "Modbus Master"?
I calculate that it will go in the "Drivers" folder, is this correct?

I add information about this.
I did tests with code in AdvancedHMI, and executing the following code:

 'Private Sub MainForm_Load (sender As Object, e As EventArgs) Handles MyBase.Load
    'Dim Q1 () As String
    'Q1 = ModbusRTUCom1.Read ("1: 11313", 16)
    'Label2.Text = Q1 (1)
    'End Sub

 I get the following through the serial port data output.

 "05 01 2C 30 00 10 34 DD"

Which gives me the following answer:

 "05 01 02 0B 00 4F 0C"

and I think that is correct, since my Modbus slave has the address "05"
Function code "01"
 and the function values ​​are
"02 0B" corresponding to binary would be "1000001011"
If I separate the bits, the last ones refer to the values ​​of the output that I have currently active, for example:

"1101" (The last BITS)
it tells me that I have outputs 1,3 and 4 of the PLC are activated and that is true.

Attached photos.

The problem I have now is that I can't display those bits in AdvancedHMI so I can use them for reference.
 Is there a way to see it?

Greetings and Thank you very much for the Help.

15
Support Questions / Reading of multiple Modbus RTU bit registers
« on: March 24, 2020, 01:20:19 AM »
Dear I have a problem with reading the states of the outputs of a PLC using modbus RTU.
I need to read the status of 8 outputs of a PLC, the manufacturer of the same determines that to get these states I must access using the function "01" to Read, with the following condition:

"For function 01H, reading multiple bits, always use multiple quantities of 16."

 My question would be with which element of advancedHMI can I achieve this?

I have tried several components of advancedHMI but the hex code I have at the exit of my PC is the following:

"05 01 2C 30 00 01 F4 D1"

and i need it to be

"05 01 2C 30 00 10 34 DD"

On the other hand, I need later a way to interpret and extract the bits that come in the frame to be able to establish the state of each output.

Attached image of the PLC manual

I appreciate your responses.

Best regards

Pages: [1]