AW: S7 types supporting Subscriptions

2024-03-15 Thread Christofer Dutz
Hi all,

I wasn’t in favor of this … just added what we would need to fully address it, 
but still I would assume that even then will be some edge-cases.

Throwing an exception sounds quite excessive, but thinking more about it, we do 
return plc status codes for every field.
So, if an operation is requested, that is not supported, we could simply 
indicate that in the status codes returned for that field.
Maybe we need to add some codes we were missing, but I guess that should be a 
lot simpler.

Chris


Von: Cesar Garcia 
Datum: Freitag, 15. März 2024 um 14:15
An: dev@plc4x.apache.org 
Betreff: Re: S7 types supporting Subscriptions
Hello,

I think that makes the API more complex than necessary.

We should keep it as simple as possible.

I think that for the driver there are already some fields that are
MetaData, so we should document and not extend the API.

As you don't point out, for example the S7 has the ability to diagnose
which functions it supports, and then inform the developer. Of course it
takes time to do it.

My grain of sand

El vie, 15 mar 2024 a las 9:02, Christofer Dutz ()
escribió:

> Well in that case we‘d actually have to introduce the following:
>
>
>   *   IsCyclicSubscriptionSupportedForTag
>   *   IsChangeOnValueSubscriptionSupportedForTag
>   *   IsEventSubscriptionSupportedForTag
>
> And possibly the “TagAddress” counterparts.
>
> We’d definitely be blowing up the API that way and making it more complex
> to use.
>
> Possibly throwing an exception when buiding a request might be a better
> option.
> So you use the isXYZSupported functions for general functionality support
> and catch exceptions later.
>
> Chris
>
> Von: Łukasz Dywicki 
> Datum: Freitag, 15. März 2024 um 10:48
> An: dev@plc4x.apache.org 
> Betreff: Re: S7 types supporting Subscriptions
> Thinking of it, maybe it would be better to extend signature of
> subscription inquiry to be isSubscriptionSupported(PlcTag) ?
> My motivation for this is rather basic - the BACnet stuff which is on
> the way will have per-participant subscriptions. Profinet (I suppose) is
> same for cyclic/acyclic subscriptions and so on.
> This gives driver opportunity to make smarter decision. Obviously for
> point to point connection such S7-TCP we can rely on device type
> negotiated earlier, *but* spanning further, we could finally let S7-1200
> subscriptions only for MODE events.
>
> Cheers,
> Łukasz
>
> On 13.03.2024 21:16, Christofer Dutz wrote:
> > Changing the title ….
> >
> > So, I just updated the S7 driver to no longer simply report true on
> “isSubscriptionSupported()” and it now only reports “true”, if it’s a
> S7-300 or S7-400.
> > If there is more, that needs to be enabled in order to support
> subscriptions on such a device, it would be cool, if we could detect that
> during the connection process and report accordingly.
> >
> > Chris
> >
> >
> > Von: Cesar Garcia 
> > Datum: Mittwoch, 13. März 2024 um 21:12
> > An: dev@plc4x.apache.org 
> > Betreff: Re: Board report 
> > Hello Chris,
> >
> > The S7-300/S7-400 devices have an important group of functions for event
> > handling. In the process part (PCS7) this is handled intensively.
> >
> > At the time, all these operations are on the Tag associated with the
> > request, so any service type subscription is a subscription to events.
> >
> > In general the S7-300/S7-400 support;
> >
> > - *MODE*: Change of operating state in the controller, change from
> STOP
> > to RUN and vice versa.
> > - *SYS*: System events, associated with internal events of the
> > controller or events previously parameterized for their indication.
> > - *USR*: Events programmed by the user and that are registered in the
> > internal diagnostic buffer.
> > - *ALM*: Alarm events generated by the user program, ALARM_S,
> ALARM_8,
> > NOTIFY.
> > - And additionally "*CYC*" cyclic mode transfer.
> >
> >
> > But in general they are all seen as events, hence the inconsistency
> pointed
> > out by Bjorn.
> >
> > All these events are implemented, of course, they have many points of
> > improvement that must be addressed.
> >
> > I currently do not have a PN or CP-343-1 CPU for testing with S7-300.
> >
> > As you point out, with Zylk's contribution it can complement the CP-443-1
> > for redudance tests (thanks Zylk).
> >
> > Well, the story is long... I'm going for a good coffee.
> >
> > Kind regards,
> >
> > El mié, 13 mar 2024 a las 14:57, Christofer Dutz (<
> christofer.d...@c-ware.de>)
> > escribió:
> >
> >> Hi

Re: S7 types supporting Subscriptions

2024-03-15 Thread Cesar Garcia
Hello,

I think that makes the API more complex than necessary.

We should keep it as simple as possible.

I think that for the driver there are already some fields that are
MetaData, so we should document and not extend the API.

As you don't point out, for example the S7 has the ability to diagnose
which functions it supports, and then inform the developer. Of course it
takes time to do it.

My grain of sand

El vie, 15 mar 2024 a las 9:02, Christofer Dutz ()
escribió:

> Well in that case we‘d actually have to introduce the following:
>
>
>   *   IsCyclicSubscriptionSupportedForTag
>   *   IsChangeOnValueSubscriptionSupportedForTag
>   *   IsEventSubscriptionSupportedForTag
>
> And possibly the “TagAddress” counterparts.
>
> We’d definitely be blowing up the API that way and making it more complex
> to use.
>
> Possibly throwing an exception when buiding a request might be a better
> option.
> So you use the isXYZSupported functions for general functionality support
> and catch exceptions later.
>
> Chris
>
> Von: Łukasz Dywicki 
> Datum: Freitag, 15. März 2024 um 10:48
> An: dev@plc4x.apache.org 
> Betreff: Re: S7 types supporting Subscriptions
> Thinking of it, maybe it would be better to extend signature of
> subscription inquiry to be isSubscriptionSupported(PlcTag) ?
> My motivation for this is rather basic - the BACnet stuff which is on
> the way will have per-participant subscriptions. Profinet (I suppose) is
> same for cyclic/acyclic subscriptions and so on.
> This gives driver opportunity to make smarter decision. Obviously for
> point to point connection such S7-TCP we can rely on device type
> negotiated earlier, *but* spanning further, we could finally let S7-1200
> subscriptions only for MODE events.
>
> Cheers,
> Łukasz
>
> On 13.03.2024 21:16, Christofer Dutz wrote:
> > Changing the title ….
> >
> > So, I just updated the S7 driver to no longer simply report true on
> “isSubscriptionSupported()” and it now only reports “true”, if it’s a
> S7-300 or S7-400.
> > If there is more, that needs to be enabled in order to support
> subscriptions on such a device, it would be cool, if we could detect that
> during the connection process and report accordingly.
> >
> > Chris
> >
> >
> > Von: Cesar Garcia 
> > Datum: Mittwoch, 13. März 2024 um 21:12
> > An: dev@plc4x.apache.org 
> > Betreff: Re: Board report 
> > Hello Chris,
> >
> > The S7-300/S7-400 devices have an important group of functions for event
> > handling. In the process part (PCS7) this is handled intensively.
> >
> > At the time, all these operations are on the Tag associated with the
> > request, so any service type subscription is a subscription to events.
> >
> > In general the S7-300/S7-400 support;
> >
> > - *MODE*: Change of operating state in the controller, change from
> STOP
> > to RUN and vice versa.
> > - *SYS*: System events, associated with internal events of the
> > controller or events previously parameterized for their indication.
> > - *USR*: Events programmed by the user and that are registered in the
> > internal diagnostic buffer.
> > - *ALM*: Alarm events generated by the user program, ALARM_S,
> ALARM_8,
> > NOTIFY.
> > - And additionally "*CYC*" cyclic mode transfer.
> >
> >
> > But in general they are all seen as events, hence the inconsistency
> pointed
> > out by Bjorn.
> >
> > All these events are implemented, of course, they have many points of
> > improvement that must be addressed.
> >
> > I currently do not have a PN or CP-343-1 CPU for testing with S7-300.
> >
> > As you point out, with Zylk's contribution it can complement the CP-443-1
> > for redudance tests (thanks Zylk).
> >
> > Well, the story is long... I'm going for a good coffee.
> >
> > Kind regards,
> >
> > El mié, 13 mar 2024 a las 14:57, Christofer Dutz (<
> christofer.d...@c-ware.de>)
> > escribió:
> >
> >> Hi Björn,
> >>
> >> the problem with the subscriptions in S7 are that they do work, but only
> >> on S7 300 (I think).
> >> I mentioned before on this list, that we should probably do
> >> context-sensitive “isXYZSupported” functions.
> >> Unfortunately, I haven’t yet had the time to implement them.
> >>
> >> So, to make it short … in general the S7 protocol doesn’t support
> >> subscriptions, except for a small subset of device types.
> >> If Cesar could possibly tell me which devices support Subscriptions, I
> >> could implement somethin

AW: S7 types supporting Subscriptions

2024-03-15 Thread Christofer Dutz
Well in that case we‘d actually have to introduce the following:


  *   IsCyclicSubscriptionSupportedForTag
  *   IsChangeOnValueSubscriptionSupportedForTag
  *   IsEventSubscriptionSupportedForTag

And possibly the “TagAddress” counterparts.

We’d definitely be blowing up the API that way and making it more complex to 
use.

Possibly throwing an exception when buiding a request might be a better option.
So you use the isXYZSupported functions for general functionality support and 
catch exceptions later.

Chris

Von: Łukasz Dywicki 
Datum: Freitag, 15. März 2024 um 10:48
An: dev@plc4x.apache.org 
Betreff: Re: S7 types supporting Subscriptions
Thinking of it, maybe it would be better to extend signature of
subscription inquiry to be isSubscriptionSupported(PlcTag) ?
My motivation for this is rather basic - the BACnet stuff which is on
the way will have per-participant subscriptions. Profinet (I suppose) is
same for cyclic/acyclic subscriptions and so on.
This gives driver opportunity to make smarter decision. Obviously for
point to point connection such S7-TCP we can rely on device type
negotiated earlier, *but* spanning further, we could finally let S7-1200
subscriptions only for MODE events.

Cheers,
Łukasz

On 13.03.2024 21:16, Christofer Dutz wrote:
> Changing the title ….
>
> So, I just updated the S7 driver to no longer simply report true on 
> “isSubscriptionSupported()” and it now only reports “true”, if it’s a S7-300 
> or S7-400.
> If there is more, that needs to be enabled in order to support subscriptions 
> on such a device, it would be cool, if we could detect that during the 
> connection process and report accordingly.
>
> Chris
>
>
> Von: Cesar Garcia 
> Datum: Mittwoch, 13. März 2024 um 21:12
> An: dev@plc4x.apache.org 
> Betreff: Re: Board report 
> Hello Chris,
>
> The S7-300/S7-400 devices have an important group of functions for event
> handling. In the process part (PCS7) this is handled intensively.
>
> At the time, all these operations are on the Tag associated with the
> request, so any service type subscription is a subscription to events.
>
> In general the S7-300/S7-400 support;
>
> - *MODE*: Change of operating state in the controller, change from STOP
> to RUN and vice versa.
> - *SYS*: System events, associated with internal events of the
> controller or events previously parameterized for their indication.
> - *USR*: Events programmed by the user and that are registered in the
> internal diagnostic buffer.
> - *ALM*: Alarm events generated by the user program, ALARM_S, ALARM_8,
> NOTIFY.
> - And additionally "*CYC*" cyclic mode transfer.
>
>
> But in general they are all seen as events, hence the inconsistency pointed
> out by Bjorn.
>
> All these events are implemented, of course, they have many points of
> improvement that must be addressed.
>
> I currently do not have a PN or CP-343-1 CPU for testing with S7-300.
>
> As you point out, with Zylk's contribution it can complement the CP-443-1
> for redudance tests (thanks Zylk).
>
> Well, the story is long... I'm going for a good coffee.
>
> Kind regards,
>
> El mié, 13 mar 2024 a las 14:57, Christofer Dutz ()
> escribió:
>
>> Hi Björn,
>>
>> the problem with the subscriptions in S7 are that they do work, but only
>> on S7 300 (I think).
>> I mentioned before on this list, that we should probably do
>> context-sensitive “isXYZSupported” functions.
>> Unfortunately, I haven’t yet had the time to implement them.
>>
>> So, to make it short … in general the S7 protocol doesn’t support
>> subscriptions, except for a small subset of device types.
>> If Cesar could possibly tell me which devices support Subscriptions, I
>> could implement something to make this happen (Shouldn’t be too much work).
>>
>> One day we’ll probably have simulated subscriptions, but admittedly as
>> nobody really seems to be interested in working on core-services like this,
>> it’s probably gonna take a while.
>> In the past I was able to work on PLC4X full time, but as no company
>> (except Zylk) was really willing to pay for any form of development, I had
>> to pick a job that pays the bills.
>> I’m still on it, but doing this in my free time.
>>
>> Chris
>>
>> Von: Björn Haverland 
>> Datum: Mittwoch, 13. März 2024 um 18:52
>> An: dev@plc4x.apache.org 
>> Betreff: Re: Board report 
>> Hi,
>>
>> as I'm starting to get used to the project I do have some questions,
>> especially regarding the mentioned v1.0.0.
>>
>> I tried to set up a plc4j with the quickstart guide which utilizes the S7
>> protocol.
>>
>> So there ar

Re: S7 types supporting Subscriptions

2024-03-15 Thread Łukasz Dywicki
Thinking of it, maybe it would be better to extend signature of 
subscription inquiry to be isSubscriptionSupported(PlcTag) ?
My motivation for this is rather basic - the BACnet stuff which is on 
the way will have per-participant subscriptions. Profinet (I suppose) is 
same for cyclic/acyclic subscriptions and so on.
This gives driver opportunity to make smarter decision. Obviously for 
point to point connection such S7-TCP we can rely on device type 
negotiated earlier, *but* spanning further, we could finally let S7-1200 
subscriptions only for MODE events.


Cheers,
Łukasz

On 13.03.2024 21:16, Christofer Dutz wrote:

Changing the title ….

So, I just updated the S7 driver to no longer simply report true on 
“isSubscriptionSupported()” and it now only reports “true”, if it’s a S7-300 or 
S7-400.
If there is more, that needs to be enabled in order to support subscriptions on 
such a device, it would be cool, if we could detect that during the connection 
process and report accordingly.

Chris


Von: Cesar Garcia 
Datum: Mittwoch, 13. März 2024 um 21:12
An: dev@plc4x.apache.org 
Betreff: Re: Board report 
Hello Chris,

The S7-300/S7-400 devices have an important group of functions for event
handling. In the process part (PCS7) this is handled intensively.

At the time, all these operations are on the Tag associated with the
request, so any service type subscription is a subscription to events.

In general the S7-300/S7-400 support;

- *MODE*: Change of operating state in the controller, change from STOP
to RUN and vice versa.
- *SYS*: System events, associated with internal events of the
controller or events previously parameterized for their indication.
- *USR*: Events programmed by the user and that are registered in the
internal diagnostic buffer.
- *ALM*: Alarm events generated by the user program, ALARM_S, ALARM_8,
NOTIFY.
- And additionally "*CYC*" cyclic mode transfer.


But in general they are all seen as events, hence the inconsistency pointed
out by Bjorn.

All these events are implemented, of course, they have many points of
improvement that must be addressed.

I currently do not have a PN or CP-343-1 CPU for testing with S7-300.

As you point out, with Zylk's contribution it can complement the CP-443-1
for redudance tests (thanks Zylk).

Well, the story is long... I'm going for a good coffee.

Kind regards,

El mié, 13 mar 2024 a las 14:57, Christofer Dutz ()
escribió:


Hi Björn,

the problem with the subscriptions in S7 are that they do work, but only
on S7 300 (I think).
I mentioned before on this list, that we should probably do
context-sensitive “isXYZSupported” functions.
Unfortunately, I haven’t yet had the time to implement them.

So, to make it short … in general the S7 protocol doesn’t support
subscriptions, except for a small subset of device types.
If Cesar could possibly tell me which devices support Subscriptions, I
could implement something to make this happen (Shouldn’t be too much work).

One day we’ll probably have simulated subscriptions, but admittedly as
nobody really seems to be interested in working on core-services like this,
it’s probably gonna take a while.
In the past I was able to work on PLC4X full time, but as no company
(except Zylk) was really willing to pay for any form of development, I had
to pick a job that pays the bills.
I’m still on it, but doing this in my free time.

Chris

Von: Björn Haverland 
Datum: Mittwoch, 13. März 2024 um 18:52
An: dev@plc4x.apache.org 
Betreff: Re: Board report 
Hi,

as I'm starting to get used to the project I do have some questions,
especially regarding the mentioned v1.0.0.

I tried to set up a plc4j with the quickstart guide which utilizes the S7
protocol.

So there are examples, in the example folder as well, which are just not
working. (The Subscription for instance) I do understand that the lib
hasn't had a Major release yet, but I think it could set people off.

I like to suggest to change the docs on that points. I know it is hard to
test everything but if a feature isn't implemented a wrong documentation
just leads to frustration.
Cesar has implemented a working CyclicSubscription, and I think he is
going to merge it to the dev branch soon. But still there are other
subscription methods shown which won't work, just yet.

I'd like to hear your opinion on this.

Best regards

Bjoern



Gesendet von Outlook für Android

From: Christofer Dutz 
Sent: Wednesday, March 13, 2024 12:00:11 PM
To: dev@plc4x.apache.org 
Subject: Board report 

Hi all,

unfortunately I had almost forgotten to submit the board report after
coming back from my little snowboard vacation.
I took the liberty of posting the following report. If there are changes
you’d like to see, please tell me asap and I can edit it.



## Description:
The mission of the Apache PLC4X project is creating a set of libraries for
communicating with industrial 

S7 types supporting Subscriptions

2024-03-13 Thread Christofer Dutz
Changing the title ….

So, I just updated the S7 driver to no longer simply report true on 
“isSubscriptionSupported()” and it now only reports “true”, if it’s a S7-300 or 
S7-400.
If there is more, that needs to be enabled in order to support subscriptions on 
such a device, it would be cool, if we could detect that during the connection 
process and report accordingly.

Chris


Von: Cesar Garcia 
Datum: Mittwoch, 13. März 2024 um 21:12
An: dev@plc4x.apache.org 
Betreff: Re: Board report 
Hello Chris,

The S7-300/S7-400 devices have an important group of functions for event
handling. In the process part (PCS7) this is handled intensively.

At the time, all these operations are on the Tag associated with the
request, so any service type subscription is a subscription to events.

In general the S7-300/S7-400 support;

   - *MODE*: Change of operating state in the controller, change from STOP
   to RUN and vice versa.
   - *SYS*: System events, associated with internal events of the
   controller or events previously parameterized for their indication.
   - *USR*: Events programmed by the user and that are registered in the
   internal diagnostic buffer.
   - *ALM*: Alarm events generated by the user program, ALARM_S, ALARM_8,
   NOTIFY.
   - And additionally "*CYC*" cyclic mode transfer.


But in general they are all seen as events, hence the inconsistency pointed
out by Bjorn.

All these events are implemented, of course, they have many points of
improvement that must be addressed.

I currently do not have a PN or CP-343-1 CPU for testing with S7-300.

As you point out, with Zylk's contribution it can complement the CP-443-1
for redudance tests (thanks Zylk).

Well, the story is long... I'm going for a good coffee.

Kind regards,

El mié, 13 mar 2024 a las 14:57, Christofer Dutz ()
escribió:

> Hi Björn,
>
> the problem with the subscriptions in S7 are that they do work, but only
> on S7 300 (I think).
> I mentioned before on this list, that we should probably do
> context-sensitive “isXYZSupported” functions.
> Unfortunately, I haven’t yet had the time to implement them.
>
> So, to make it short … in general the S7 protocol doesn’t support
> subscriptions, except for a small subset of device types.
> If Cesar could possibly tell me which devices support Subscriptions, I
> could implement something to make this happen (Shouldn’t be too much work).
>
> One day we’ll probably have simulated subscriptions, but admittedly as
> nobody really seems to be interested in working on core-services like this,
> it’s probably gonna take a while.
> In the past I was able to work on PLC4X full time, but as no company
> (except Zylk) was really willing to pay for any form of development, I had
> to pick a job that pays the bills.
> I’m still on it, but doing this in my free time.
>
> Chris
>
> Von: Björn Haverland 
> Datum: Mittwoch, 13. März 2024 um 18:52
> An: dev@plc4x.apache.org 
> Betreff: Re: Board report 
> Hi,
>
> as I'm starting to get used to the project I do have some questions,
> especially regarding the mentioned v1.0.0.
>
> I tried to set up a plc4j with the quickstart guide which utilizes the S7
> protocol.
>
> So there are examples, in the example folder as well, which are just not
> working. (The Subscription for instance) I do understand that the lib
> hasn't had a Major release yet, but I think it could set people off.
>
> I like to suggest to change the docs on that points. I know it is hard to
> test everything but if a feature isn't implemented a wrong documentation
> just leads to frustration.
> Cesar has implemented a working CyclicSubscription, and I think he is
> going to merge it to the dev branch soon. But still there are other
> subscription methods shown which won't work, just yet.
>
> I'd like to hear your opinion on this.
>
> Best regards
>
> Bjoern
>
>
>
> Gesendet von Outlook für Android
> 
> From: Christofer Dutz 
> Sent: Wednesday, March 13, 2024 12:00:11 PM
> To: dev@plc4x.apache.org 
> Subject: Board report 
>
> Hi all,
>
> unfortunately I had almost forgotten to submit the board report after
> coming back from my little snowboard vacation.
> I took the liberty of posting the following report. If there are changes
> you’d like to see, please tell me asap and I can edit it.
>
>
>
> ## Description:
> The mission of the Apache PLC4X project is creating a set of libraries for
> communicating with industrial programmable logic controllers (PLCs) using a
> variety of protocols but with a shared API.
>
> ## Project Status:
> Current project status: Ongoing with moderate activity
> Issues for the board: None
>
> ## Membership Data:
> Apache PLC4X was founded 2019-04-17 (5 years ago)
> There are currently 21 committers and 13 PMC members in this project.
> The Committer-to-PMC ratio is roughly 3:2.
>
> Community changes, past quarter:
> - No new PMC members. Last addition was César García on 2021-10-01.
> - No new committers.