Jump to content

Recommended Posts


Posted (edited)

An IP address contains 4 addresses. Dec or hex is just a representation of Bits in word.

What is it you wan to do ? combine 4 decimal values into a double word in which every nibble contains one part of the IP adress ?
 

And which PLC are you using ?

Edited by Gambit
Posted

I am using a Q06UDV

I want to be able to enter the IP address as a word. So I've split my IP Address into 4 different parts, ie IP_Part1, IP_Part2, IP_Part3, IP_Part4.

I am wanting to write that into the FB ModbusTCPClient which is in GX Works 2 Library.

The input will be going to the RemoteIPAddress, which is a  Double Word Unsigned.

Posted

So how am I able to take that Hex value and use it for my Remote IP Address in the Modbus TCP Client FB?

I have created my own FB with the Modbus TCP Client within

 

modbusFB.PNG

modbustcp.PNG

Posted (edited)

okay first of all you do not need to specify  D0 D1 D2 etc. Create an array of words Like MyIPadress[0..3]

Then use MyIPaddress[3], MyIPaddress[2],MyIPaddress[1],MyIPaddress[0] instead of Direct adresses.

 

IP_3.JPG

IP_4.JPG

The Temp variable is a local array of  Word(0..1) 

 

Edited by Gambit

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...