Hi,
anyone has more example about interfacing python with scadabr api than the one in scadabr’s site?
Thank you in advance!
Best regards, Andrea
Hello Andrea,
So far we have not created a tutorial for python, but you can relate to
https://sites.google.com/a/certi.org.br/certi_scadabr/home/minicursos/scadabr
for references.
Vincente in this thread is using python with the API
http://www.scadabr.org.br/?q=node/448
I guess you can ask him in english =]
I´ll try to put up something with python too…
Best Regards
Hello Andrea,
following solution with suds:
Thats just great Vincente,
I was just trying something like this with koding and ScadaBR Server in Linode. Guess anyone can make a interface in python now!
In the ScadaBR there's also some info and examples, but it's all portuguese =/
Cheers
Hi Vincent thank you so much, your coding is working for me! I'm trying....very slowly....to develop a sort of gateway scadabr<-> modbustcp by using scadabr api and pymodbus module to collect data from scadabr with conventional software over modbustcp!! But maybe the scadabr team will be faster than me and they'll implement an OPC server in ScadaBR.... ;-)
Hello,
This is indeed in our plans =]
Not only an OPC Server solution, but also Modbus Slave mode and IEC related protocols. These are solutions that we have been planning for some time, but no sponsor partner has put effort ($$) in this direction.
The study of a plugin-able, slave layer is ongoing. But we are directing time to functionalities and projects that maintain our financial health (this is important - did you know that devs and engineers eat too?).
But be sure that it´s is our backlog =]
Best regards
I managed to get authentification working. I reproduced the steps in APIAccessDWR.getAPI(). For reference:
I know that this a very old subject, but I'm having issues with it and I would like if someone here already had my problem.
@moinmoin, thank you for the code, but I'm having the following error here:
[paladini@starstuff ScadaBR-python-scripts]$ python test1.py
######################################
describing the service:
Suds ( https://fedorahosted.org/suds/ ) version: 0.4 GA build: R699-20100913
Service ( API ) tns="http://scadabr.org.br/api/"
Prefixes (6)
ns0 = "http://ae.api.scadabr.org.br"
ns1 = "http://config.api.scadabr.org.br"
ns2 = "http://constants.api.scadabr.org.br"
ns3 = "http://da.api.scadabr.org.br"
ns4 = "http://hda.api.scadabr.org.br"
ns5 = "http://vo.api.scadabr.org.br"
Ports (1):
(API)
Methods (21):
ackEvents(xs:int[] eventsId, ns0:AckEventsOptions options, )
annotateEvent(xs:int eventId, ns5:EventMessage message, )
browseDataPoints(xs:int dataSourceId, )
browseDataSources(ns2:DataSourceType type, )
browseEventsDefinitions(xs:string eventsPath, ns0:BrowseEventsOptions options, )
browseFlexProjects()
browseTags(xs:string itemsPath, ns3:BrowseTagsOptions options, )
configureDataPoint(xs:int dataSourceId, ns2:DataSourceType type, xs:anyType dataPoint, )
configureDataSource(ns2:DataSourceType type, xs:anyType dataSource, )
getActiveEvents(xs:string eventsPath, ns0:ActiveEventsOptions options, )
getDataHistory(xs:string itemName, ns4:GetDataHistoryOptions options, )
getEventsHistory(xs:string eventsPath, ns0:EventsHistoryOptions options, )
getFlexBuilderConfig(xs:int projectId, )
getStatus()
readData(xs:string[] itemPathList, ns3:ReadDataOptions options, )
removeDataPoint(xs:int id, )
removeDataSource(xs:int id, )
removeFlexProject(xs:int id, )
setFlexBuilderConfig(ns5:FlexProject project, )
writeData(ns5:ItemValue[] itemsList, ns3:WriteDataOptions options, )
writeStringData(ns5:ItemStringValue[] itemsList, ns3:WriteDataOptions options, )
Types (25):
ns5:APIError
ns0:AckEventsOptions
ns0:ActiveEventsOptions
ns2:AlarmLevel
ns0:BrowseEventsOptions
ns3:BrowseTagsOptions
ns2:DataSourceType
ns2:DataType
ns2:ErrorCode
ns5:EventDefinition
ns5:EventMessage
ns5:EventNotification
ns2:EventType
ns0:EventsHistoryOptions
ns5:FlexProject
ns4:GetDataHistoryOptions
ns5:ItemInfo
ns5:ItemStringValue
ns5:ItemValue
ns2:QualityCode
ns3:ReadDataOptions
ns5:ReplyBase
ns2:ServerStateCode
ns5:ServerStatus
ns3:WriteDataOptions
######################################
BrowseTagsOptions
(BrowseTagsOptions){
maxReturn = None
}
No handlers could be found for logger "suds.client"
Traceback (most recent call last):
File "test1.py", line 40, in <module>
BrowseTagsResponse = client.service.browseTags(itemsPath,browseTagsOptions)
File "build/bdist.linux-x86_64/egg/suds/client.py", line 542, in __call__
File "build/bdist.linux-x86_64/egg/suds/client.py", line 602, in invoke
File "build/bdist.linux-x86_64/egg/suds/client.py", line 649, in send
File "build/bdist.linux-x86_64/egg/suds/client.py", line 702, in failed
File "build/bdist.linux-x86_64/egg/suds/bindings/binding.py", line 265, in get_fault
suds.WebFault: Server raised fault: 'Invalid Default Password!'
Here you can check my code: https://gist.github.com/paladini/08d2824f5692893157a6. Note that I removed my password for "******", but my password IS correct. Anyone know a workaround / fix for this problem?
Thanks!
Fernando Paladini.