Jump to content
Sign in to follow this  
parksh

Send the packet

Recommended Posts

parksh

Hi?

I like to send a some packet to modbus/tcp device to control it.

I do success in python as follow:

==============================

sdata = struct.pack('BB',0x00,0x00)

sock.send(sdata)

=============================

and it works well;

but now i don't know how to do like this in Autoit.

if anyone knows, Please let me kown.

i try to do like this:

$szData = Binary("0x00,0x00")

TCPSend($ConnectedSocket, $szData)

but this does not work like above python source.

Share this post


Link to post
Share on other sites
parksh

this is my want to send data

$szData = Binary("0x00,0x00,0x00,0x00,0x00,0x09,0x01,0x10,0x00,0x08,0x00,0x01,0x02,0x00,0x01");

but i can't send it.

why should Binary("0x00,0x00") be change like Binary("0xBB0000")?

Share this post


Link to post
Share on other sites
jvanegmond

Because AutoIt is not Python. You're using the AutoIt function, not the Python function.

Share this post


Link to post
Share on other sites
KDV

Hi?

I like to send a some packet to modbus/tcp device to control it.

I do success in python as follow:

==============================

sdata = struct.pack('BB',0x00,0x00)

sock.send(sdata)

=============================

and it works well;

but now i don't know how to do like this in Autoit.

if anyone knows, Please let me kown.

i try to do like this:

$szData = Binary("0x00,0x00")

TCPSend($ConnectedSocket, $szData)

but this does not work like above python source.

 

Hi,

I'd like to creat some scripts to automate a module using Modbus TCP/IP.

So I'm looking for the libary for this fucntion. I knew you worked on this long time ago.

Could you share me your script please? Send to me at kduanvo@yahoo.com

Thanks

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×