More information needed on utils.create_logger

126 views
Skip to first unread message

Mike Spath

unread,
Jun 14, 2019, 9:54:12 AM6/14/19
to modbus-tk
Hello:
I'm trying to figure out how to best use the logger with modbus-tk

so far I use it to log to the screen but I'd like to have a log file.

logger = modbus_tk.utils.create_logger(name="console", record_format="%(message)s")

Thanks,
Mike

Luc JEAN

unread,
Jun 14, 2019, 11:27:39 AM6/14/19
to modb...@googlegroups.com
Hello Mike,

modbus_tk uses the standard logging mechanism of python. You will find all the possibilities in the doc of this module

Best
luc

--
You received this message because you are subscribed to the Google Groups "modbus-tk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modbus-tk+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modbus-tk/03057a9a-7c4e-4b5f-b4e9-4119cb2128e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike Spath

unread,
Jun 17, 2019, 9:54:26 AM6/17/19
to modbus-tk
Thank you for the information Luc but I'm afraid I don't follow along. So you are saying I need to import logging and use the standard logging functions in python? 
I just want to create a log file and dump messages in.
Thanks,
Mike


On Friday, June 14, 2019 at 11:27:39 AM UTC-4, luc wrote:
Hello Mike,

modbus_tk uses the standard logging mechanism of python. You will find all the possibilities in the doc of this module

Best
luc
Le 14 juin 2019 à 15:54, Mike Spath <mds....@gmail.com> a écrit :

Hello:
I'm trying to figure out how to best use the logger with modbus-tk

so far I use it to log to the screen but I'd like to have a log file.

logger = modbus_tk.utils.create_logger(name="console", record_format="%(message)s")

Thanks,
Mike

--
You received this message because you are subscribed to the Google Groups "modbus-tk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modb...@googlegroups.com.

Mike Spath

unread,
Jun 20, 2019, 5:54:26 PM6/20/19
to modbus-tk
Hi Luc:
I have made such great progress with your help, thank you!
I have connected to a real PLC and my code can read registers(coils), write registers (coils) but the PLC can write registers (coils) but cannot write registers(coils) to me, the slave. The PLC and read/write all with the Simply Modbus slave (simulator software). Please let me know what I can do to troubleshoot. I'm going to try minimalmodbus as a library, not sre if thay will get me anything.
Please give any suggestion.
Thanks,
Mike

To unsubscribe from this group and stop receiving emails from it, send an email to modbus-tk+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modbus-tk/ff6015a1-fb25-4034-be8c-18bfa1cad9c7%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Thank you,
Mike Spath

Mike Spath

unread,
Jun 20, 2019, 7:57:43 PM6/20/19
to modbus-tk
correction, the PLC can write registers and coils but it cannot read registers and coils that the slave sets.

Mike Spath

unread,
Jun 21, 2019, 11:36:26 AM6/21/19
to modbus-tk
Hi Luc:
You have not responded in a while, do I need to give more information? I have a simulated slave master software on a windows 7 machine using a usb to serial dongle that communicates great with my raspberry pi zero w board. The PLC can communicate with the same modbus slave simulator software. When I connect my raspberry pi slave to the PLC the PLC can write coils, registers but receives no replies from me, they are also unable to read any register or coil they set.
I tried to change settings on the serial port (timeout, baudrate, etc.) but no success.
I tried to use minimalmodbus and I cannot even get that to communicate with the simulation software.

Please offer some suggestion or reply. I'm in dire need of some suggestions.

Thank you,
Mike

Luc JEAN

unread,
Jun 21, 2019, 11:46:06 AM6/21/19
to modb...@googlegroups.com
Hello Mike,

I am sorry but I didn’t have time yo look at your issue. I gave you a few advices but it is difficult to say more and quite impossible to debug modbus issues by email.

Thansk for your understanding
Best
luc

--
You received this message because you are subscribed to the Google Groups "modbus-tk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modbus-tk+...@googlegroups.com.

Mike Spath

unread,
Jun 21, 2019, 3:42:38 PM6/21/19
to modbus-tk
Hi Luc:
No worries, thank you for your help. I'm so close to getting this to work....
Mike


For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages