PyPLC

HI
i have a problem after i clone PyPLC device server when i want to run this device it shows me an error i dont know what to do ?
what error do you get? How did you clone the device server?
Hi Faissal,

We would need a bit more of information to solve the issue.

Try my latest version of PyPLC from github and paste here your errors:

https://github.com/sergirubio/PyPLC/

Sergi Rubio
Keep on dancing,

http://www.tango-controls.org/resources/howto/how-fandango/
Edited 7 years ago
when im wiring the plc i configure the plc modbus communication therefore i configure the ip of my pc when i run the device server ,the state attribute shows me "unknown", it didn't recognize the plc.


Edited 7 years ago
Hi Andy ,Sergio
i clone the device server with 'git clone' command from the github.
when i call the init method the terminal shows me this instruction :
ModbusMap> Wrong Definition!:%s2
Edited 7 years ago
Defining ModbusMap property is not required unless you many variables to read (>50). Try first by reading 10 registers from your Modbus device (e.g. PyTango.DeviceProxy('your/modbus/device').ReadHoldingRegisters([0,10]) ) and then create an attribute returning this same values:

DynamicAttributes:
ARRAY=DevVarLongArray(ReadHoldingRegisters([0,10]))


Regarding Modbus with siemens (which I never tried before), I answered in the other thread:

http://www.tango-controls.org/community/forum/c/development/python/pyplc-communication-with-siemens/?page=1#post-2397
Keep on dancing,

http://www.tango-controls.org/resources/howto/how-fandango/
Hi Sergio,
Thanks for this thread.
I have a issue when creating new PyPLC DS instance, i've got these errors:
tango-cs@tango9-vm:~/Downloads/PyPLC-master/PyPLC$ python PyPLC.py PLCtest
Failed to import EventChannelFactory notifd/factory/tango9-vm from the Tango database
Applying FullTangoInheritance from <class '__main__.PyPLC'> and <class 'fandango.dynamic.DynamicDS'>
Updating PyPLCClass from DynamicDSClass
Updating PyPLCClass.attr_list from DynamicDSClass
Updating PyPLCClass.class_property_list from DynamicDSClass
Updating PyPLCClass.cmd_list from DynamicDSClass
Updating PyPLCClass.device_property_list from DynamicDSClass
In DynamicDS.CreateDynamicCommands(PyPLC/PLCtest)
class = PyPLC; classes = ['dserver/PyPLC/PLCtest', 'DServer']
devs = []
Out of DynamicDS.CreateDynamicCommands(PyPLC/PLCtest)
In DynamicDSClass.__new__(<class 'fandango.interface.inheritance.PyPLCClass'>): updating properties
DynamicSpectrumSize property NOT found in database
In PyPLCClass constructor
In DynamicDSClass.dyn_attr([])
In DynamicDSClass.__new__(<class 'fandango.interface.inheritance.PyPLCClass'>): updating properties
DynamicSpectrumSize property NOT found in database
In PyPLCClass constructor
Segmentation fault (core dumped)
tango-cs@tango9-vm:~/Downloads/PyPLC-master/PyPLC$


Is it the first time you launch this device or it was running already in the past?

Segmentation fault at startup may occur if you have configured a polling period for an attribute that has been later renamed or removed.

Is that the case?

Sergi
Keep on dancing,

http://www.tango-controls.org/resources/howto/how-fandango/
Hi Sergi,
it's the first time.

Regards
… could you try to generate a corefile and paste here the backtrace?

> ulimit -n 99999
> … run PyPLC and generate a "core" file after the segfault
> gdb -c core -f /usr/bin/python
#> bt

If you can paste here the contents of your PyPLC properties (hiding IP's) I can crosscheck if everything is ok.
Keep on dancing,

http://www.tango-controls.org/resources/howto/how-fandango/
Edited 6 years ago
 
Register or login to create to post a reply.