Hello there!
My answers below.
Qui, 2013-10-17 às 11:34 +0200, Håkon Nessjøen escreveu:
> Hi,
>
> You could just call me Haakon.
Simpler ... because i did not know how to pronounce the å so ... Hakon
was on the way.
>
>
> We should create an ADS router yes. But I think your abstraction with
> PLCItems is something you should write on top of this. As your own
> abstraction layer.
>
Agreed, as said before.
Please search in google for "dbpc freedesktop" and check it out. I have
a bad proof of concept not available for public.
>
> We should try to mimic Beckhoff's own API as close as possible.
>
Thats the main objective.
>
> This would mean that the ADS router would be a program that reads a
> configuration file, where you specify which ams net id's goes to what
> ip's/hosts.
> The ads router will handle all the ads tcp connections going out from
> the local machine.
OK
>
> The library has to connect to the ads router to get access to any PLC.
> I would suggest that this would be by unix sockets, as this library
> would be mainly for posix based systems.
> If you have windows, (the only OS these days, not compatible with
> posix), you would use Beckhoff's own api.
>
Agreed
> So we should only need to think of portability to posix based systems.
>
>
> A few design issues we should confirm first:
>
>
> Should the ads router connect to all routes by default? Or wait
> until an api asks for a specific ams id?
> Should the ads router disconnect from a PLC after a specified amount
> of time where no API clients are connected to a PLC, or try to hold
> the connection up as long as possible?
> Should the ads router clear all notifications added from a specific
> API client if it disconnects, or is it up to the API user to remember
> to clean up? (i think we should track, and clean up)
>
I think the router should only connect when asked and disconnect after
some time elapsed if there is no activity. For like ... 10 minutes or
so. I think the ads router should track different api calls and remove
the notifications when that api disconnects from the router.
So that for 1 PLC, if you have two applications with notifications and
one disconnects, the notifications for that one are cleaned (in the
optimum world).
>
> This means that the libads code needs to be greatly split up. The
> internal ads.h library would be used by the router only. And the
> LibAds.h library would be completely rewritten to connect to the ads
> router. A question then appears:
>
The slip is already done and should remain. Yes, libAds (beckhoff API)
would be rewritten. And the adsrouter added.
>
> How should the protocol between the ads router and the library be? I
> have not have time to think about this, but I would try to make this
> as simple as possible. Since this would be local to the ads router, we
> do not need to think about cpu architecture endianness. So we could
> send full structs without formatting. Maybe just a simple header +
> struct of info. There is no need for checksum either, as unix sockets
> are just data transfered locally in memory, between applications.
We can use more or less the same protocol as libads. It would be also
simpler to transfer data from the api, trough the router and to the plc,
and back. So we could use data structures, that can the same data
structures than the ones available in libads, only adding some
identifying stuff instead of the ams or ip ids.
The main objective should be to structure up the ads router and make it
run, and then optimize it.
> --
> You received this message because you are subscribed to the Google
> Groups "Beckhoff Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
beckhoff-linu...@googlegroups.com.
> To post to this group, send email to
beckhof...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/beckhoff-linux.
> For more options, visit
https://groups.google.com/groups/opt_out.