Hi. Still waiting for your reply, which will be highly appreciated.
From my research of this topic I understand the following.
modbus_rtu.RtuMaster uses serial type object. This serial class is
inherited from either Win32Serial, PosixSerial or JavaSerial, which in
their turn inherit from SerialBase class, which I should change.
However those intermediary classes import some other libraries (win32
for example) which will probably not be accessible on the modem. I
should describe in more details, what the module is capable of. It has
Python interpreter with ~2 Mb of flash memory and ~1 Mb RAM. It has 2
serial ports, ASC0 and ASC1 which are controlled from python by SER
and SER2 classes.
Here's the list of methods:
SER.send(string)
SER.receive(timeout)
SER.read()
SER.sendbyte(byte)
SER.receivebyte(timeout)
SER.readbyte()
SER.set_speed(speed, <char format>)
SER.setDCD(DCD_value)
SER.setCTS(CTS_value)
SER.setDSR(DSR_value)
SER.setRI(RI_value)
SER.getRTS()
SER.getDTR()
More detailed info can be found here:
http://www.roundsolutions.com/techdocs/python/Easy_Script_Python_r13.pdf
I really hope you could give me an idea, where should I apply those,
to be able to use modbus-tk on this modem. Thank you.
> Hello,
> The serial communication is managed by the pyserial lib.
> I think that if you create a class that mimick the pyserial.SerialBase public
> interface (seehttp://
pyserial.svn.sourceforge.net/viewvc/pyserial/trunk/pyserial/se...)
> that should work ok.
> There is a few functions to implement (open, read, write, close, isOpen ...)
> and member variables to provide (interCharTimeout, timeout ...) Check the
> RtuMaster class in modbus_rtu.py
> Then pass an instance of this class as 1st arg of the RtuMaster constructor.
> I think there is nothing to change in modbus-tk code.
> Best
> luc
>
> PS: For my information, What kind of GSM modem to you use?
>
> 2011/6/30 Ren <
gang...@gmail.com>