-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Hi Paul,
On 10/09/15 03:54, Paul, Hsieh-Fu Tsai wrote:
> I am very unfamiliar with all these. But right now i'm interested
> in using Wago PLC to control a bunch of solenoid pumps for a
> scientific project. I have manage to address a 4DO on a Wago
> 750-881 plc. these are %QX0.0 to %QX0.3.
>
> I tried to address through from pymodbus.client.sync import
> ModbusTcpClient client = ModbusTcpClient('192.168.11.3')
> client.write_register(0,1)
I have no idea what %QX0.0…3 translate to in Modbus either or what a
4DO is.
I note you don't specify a unit ID, so that write_register command is
basically saying:
client.write_register(0,1, unit=0)
Unit ID 0 is basically a broadcast address, not everything is required
to honour it.
I'm not familiar with IEC61131 specifically, there are a few
"standards" regarding Modbus addressing, one being that registers are
offset by 1 and are given as 5 or 6 digit decimal numbers where the
first digit is the register type.
https://en.wikipedia.org/wiki/Modbus#Coil.2C_discrete_input.2C_input_register.2C_holding_register_numbers_and_addresses
I'm not sure what register gets written to with write_register, I
suspect it's supposed to write to a holding register, but the Modbus
standard is silent on whether that's the case and in fact, it's up to
implementers to decide whether the address spaces are separate or not.
My advice would be to use the ipython shell, do your import of
ModbusTcpClient, create an instance and have a fiddle. I found that
to be the most helpful way to discover how to communicate with a
device years ago when I first struck Modbus.
Regards,
- --
Stuart Longland (aka Redhatter, VK4MSL)
I haven't lost my mind...
...it's backed up on a tape somewhere.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCAAGBQJV8eDrAAoJEE36GRQQveO3ekMP/2QNawXtL9R4jHDgqqKHwrcZ
QVYmyM7fyKGLftAUEZhjkcTwDaWDK4xEW6fScZAzElDLB26CgwiHAKsGBmUPtXRH
GxRBTp4hx5p3VszGL5aWm683aghDoFH7he3Erwuh4iyyjFFOy7HOoKHWVoU3soxi
SoNWT9tKuwPzl2AwOPqaZE33llxtAhGtaEyGEWQSSkAVy0GDPhtqkmxZ59CaMMaT
DtCr3wDSOjAWPq27sQ7vvnNmSBhMdic0E5VItn9Zo/N54onsryBPcDe7xL1B3SDR
OwCRCTwsCEDiAo8Gx0WUKrAPG1LkkQx/O58GnDnU9rth+7Xv+6tRhRkWDYjq+okQ
t++gHQYxDP8PTNnpZa7r+p/MAusm8+t2UMiYAD95Uriw3H6nDYzqcJr3wshEZduy
gKRZtGSJK3d0PRAWwUItkTs8oHgf6jnRtd2vFPVNY3678ALkzDD9bYuIjV/jH6h8
pt2xJBBezQ4fJYianE234fJLk6qDYFpfi5xUopllhr3ffAxUCGd6n7sJnC8/GG8l
fVNJd6RJe+hnoClSdskOen1R7VZ3qX9V0tKuLVbCtGcCs7R9JtDkjU4AG3vJZ2UN
DpFsTPfRQbWWoeviONTn3w8URSLdFOW9j2+Jo+nz9inKAstd7kwP8QH5VPb+UlQY
Vq1S1jnpZoQKFop9H9rr
=Wvwd
-----END PGP SIGNATURE-----