Recent Posts

Pages: 1 ... 6 7 [8] 9 10
71
Support Questions / Re: Modbus 16bit addresses
« Last post by Archie on February 12, 2024, 07:16:33 PM »
I checked the code and it will use function code 6 if there is only a single register to read.
72
Support Questions / Re: Modbus 16bit addresses
« Last post by zipfrog2022 on February 12, 2024, 06:04:36 PM »
Can you not use function code 6? 16 is to write multiple registers and 6 is to write a single register.
AdvancedHMI uses function code 3 to read 16 bit registers and function code 16 to write them.

Normally you use addresses in the 40000+ range, such as 40001

I
73
Support Questions / Re: Modbus 16bit addresses
« Last post by Archie on February 12, 2024, 01:31:03 PM »
AdvancedHMI uses function code 3 to read 16 bit registers and function code 16 to write them.

Normally you use addresses in the 40000+ range, such as 40001

I
74
Support Questions / Modbus 16bit addresses
« Last post by zipfrog2022 on February 12, 2024, 01:21:17 PM »
I am working on setting up some fairly basic actuator controls. All my single bit items work fine. What I need to know is how to read a 16bit address or write a 16bit address.

To send a operation command lets say for open / closed its function code 06, offset is 4096, bit 0= open, bit 1=closed, bit 2= setpoint.

How would I read these or write these. I would like to either use selector switch to change from open close using the bits above or push button to send the open / closed commands.

Help understanding how to work with the 16bit addresses would be greatly appreciated.

Thanks
75
Feature Request / Re: LIVE VIDEO WITH SAVE FUNCTION
« Last post by smithpetermark@gmail.com on February 11, 2024, 02:17:29 AM »
I cannot get this control working and in fact now my Solution is throwing errors.

I know this post is old.

I deleted the control and the dll resource and have no errors and will try again.

OK -  reread the instructions and succeeded.  I used the encoder from here btw: https://sourceforge.net/projects/x264vfw/
76
Open Discussion / Re: ON/OFF Button for bit in a register Modbus TCP
« Last post by Nikola Tesla on February 05, 2024, 01:51:08 PM »
in conjunction with the subtract you want to use a logical AND.

ModbusTCPCom1.Write("40001", Value AND (65535 - 2 ^ (b_Num - 1)))

I can't test that right now, but the 65535 assumes it is an unsigned 16 bit integer, it may need to be a 32767

Thanks Archie!

I have just teste with a ModbusPal Tcp Servidor Simulator and run with 65535 y 32767, this week I'll test with a plc.

77
Open Discussion / Re: ON/OFF Button for bit in a register Modbus TCP
« Last post by Archie on February 05, 2024, 01:24:07 PM »
in conjunction with the subtract you want to use a logical AND.

ModbusTCPCom1.Write("40001", Value AND (65535 - 2 ^ (b_Num - 1)))

I can't test that right now, but the 65535 assumes it is an unsigned 16 bit integer, it may need to be a 32767
78
Open Discussion / ON/OFF Button for bit in a register Modbus TCP
« Last post by Nikola Tesla on February 05, 2024, 01:18:02 PM »
Hi, I'm new with VB and I was looking for some forum posts to create a couple of buttons for an application. The first button is to set to 1 independent bits of a modbus tcp register and for that I have used Godra's code in another post:

Private Sub BasicButton1_Click(sender As Object, e As EventArgs) Handles BasicButton1.Click
    Try
        Dim b_Num As Integer = 1 'or if dynamically changing then call it from a TextBox, like: Dim b_Num As Integer = TextBox1.Text
        Dim Value = Me.ModbusTCPCom1.Read("40001")
        Me.ModbusTCPCom1.Write("40001", Value Or 2 ^ (b_Num - 1))
    Catch ex As Exception
        System.Windows.Forms.MessageBox.Show("Failed to write value. " & ex.Message)
    End Try

 The second button I created to disable the bit of the word I enabled earlier and for this I used the same Godra code and changed the following command:

Me.ModbusTCPCom1.Write("40001", Value - 2 ^ (b_Num - 1)).

The off button is only connected and appears on screen if the bit it disables is set to 1, but if you quickly hit the button before the associated bit is disabled, it is able to subtract more than once the same bit, how could I avoid it to subtract more than once and not modify the register in a wrong way? Can you think of another way to create an off/on button for independent bits of a register?

79
Feature Request / Re: Multiple StationAddress from one ModbusRTUCom in one Form
« Last post by fayeq on February 05, 2024, 01:47:59 AM »
up
80
Open Discussion / 1756-L81E 5580 Controller f/s
« Last post by kingparmer on February 02, 2024, 09:44:57 AM »
Have an extra controller still in factory sealed box, It was ordered for a project and ended up not needing.

$2500 obo

LMK if anyone is interested.
Pages: 1 ... 6 7 [8] 9 10