[BUILD-FAILURE]: Job 'PLC4X/PLC4X/develop [develop] [663]'

2021-11-04 Thread Apache Jenkins Server
BUILD-FAILURE: Job 'PLC4X/PLC4X/develop [develop] [663]':

Check console output at "https://ci-builds.apache.org/job/PLC4X/job/PLC4X/job/develop/663/;>PLC4X/PLC4X/develop
 [develop] [663]"

Re: some problems with S7 cyclic subscriptions

2021-11-04 Thread Cesar Garcia
Hi Guido,

The subscription feature for Siemens plcs is currently in the oven, I can
safely support you in that regard.

If you have a hybrid architecture, with S7-300 and S7-1500 (1200) devices,
it is important to point out that the new S7-1500 series only supports a
subset of the features of the S7-300, so it does not include the
possibility of reeralize S7 subscriptions.

In summary, the S7-1200 & S7-1500 only support PUT / GET.

Currently the variable and alarm subscription is functional for the S7-300,
S7-400. For the VIPA and Sinamics G120PN equipment (and other drivers) I
hope to have the equipment soon.

In [1] you can find an example code for the subscription process. (It's
testing code!)

In [2] you will find the development branch which I hope to request the PR
shortly. But eventually you can test the subscription and other new
features.

I am dedicating  to finalize the alarm processor and carry out tests to
continue with the documentation, so any feedback from you is welcome.

Best regards,

1.
https://github.com/glcj/PLC4XS7ExamplesV9/blob/master/src/main/java/com/ceos/plc4x/s7/PLCAlarmAck.java

2. https://github.com/glcj/plc4x/tree/s7szl





El jue, 4 nov 2021 a las 6:06, Rennert, Guido ()
escribió:

> Hello,
>
>
>
> as a complete newbie in Java, S7 and PLC4X it does not help - if I have to
> get some data from a Siemens-PLC. We decided to use PLC4X and as always
> there can occur some little problems. Now I am involved in using PLC4X for
> about one week.
>
>
>
> Ok let me first say what I use at the moment:
>
>- Java 11 64-Bit-Version on Intel (Windows 10) and Arm-System (Debian)
>- PLC4X version 0.9.0 (but I tested in this case 0.10.0-SNAPSHOT, too)
>- Siemens S7-300, S7-1500 (Software-PLC) and hopefully some more types
>in the next weeks
>
>
>
> As preparation for more functionality I created an ugly short test
> program, which does some reading out of a data block. This is really
> running fine an I was surprised to get to this point in really a short
> time. So I think that the PLC4X is a well kind of stuff.
>
>
>
> To improve at second the reading of data out of the PLC I tried to use the
> possibility of ‘subscription’ – unfortunately this has been without success
> the last 2 days. So I decided to ask what I am doing wrong.
>
>
>
> As an attachment there are some more information to be found as pictures
> and some text parts.
>
>
>
> Explanation:
>
>
>
> I try to establish a subscription request by doing the builder and execute
> the request afterwards (attachment Source_SubscriptionRequest.txt):
>
>
>
>
> *// Create a new subscription request cyclic mode only ! 
> *PlcSubscriptionRequest.Builder
> builder = plcConnection.subscriptionRequestBuilder();
>
> *for *(String searchName : deviceData.*dataMap*.keySet()) {
> *switch *(deviceData.getSubscriptionType(searchName)) {
> *case **"CYCLIC"*: {
> builder.addCyclicField(searchName,
> deviceData.getDataPlaceAndType(searchName), Duration.*ofMillis*(Integer.
> *valueOf*(deviceData.getSubscriptionTime(searchName;
> };*break*;
> *case **"ONCHANGE"*: {
> *// TODO add onchange subscription builder*
> };*break*;
> *case **"ONEVENT"*: {
> *// TODO add onevent subscription builder*
> };*break*;
> *default*: {
>
> };*break*;
> }
> }
>
> *// finalize the subscription builder *PlcSubscriptionRequest
> subscriptionRequest = builder.build();
>
>
> *// activate the subscriptions now (here it doesn't matter if you use the
> synchronize or asynchronize approach) *PlcSubscriptionResponse
> plcSubscriptionResponse = subscriptionRequest.execute().get(20, TimeUnit.
> *SECONDS*);
>
> *// PlcSubscriptionResponse plcSubscriptionResponse =
> subscriptionRequest.execute().get(); // PlcSubscriptionResponse
> plcSubscriptionResponse = subscriptionRequest.execute().get(5000,
> TimeUnit.MILLISECONDS);*
>
>
>
> The ‘deviceData’-class contains all configuration values which are read
> out of a very simple properties-file. The picture ‘Debug_BuilderInfo.PNG’
> shows the content of the two entries and I think they are OK so far.
>
> The property-file contains these information about the entries:
>
>
>
> # data address is the physical address inside the plc and the type
> data_set_001=TEST_BIT0|%DB100:0.0:BOOL|BOOL|CYCLIC|333
> data_set_002=TEST_BIT1|%DB100:0.1:BOOL|BOOL|CYCLIC|444
>
>
>
> The fieldname in the first line will be later ‘TEST_BIT0’ the address and
> type will be ‘%DB100:0.0:BOOL’  it should be a cyclic mode ‘CYCLIC’ and the
> cycle time should be ‘333’ [ms]. The other values in the line are not used
> inside the program (maybe later but not now).
>
>
>
>
>
> Unfortunately this will lead me to an error I can’t resolve now. (the out
> is the attachment Console_OutputOnError.txt)
>
>
>
> "C:\Program
> Files\Java\openjdk-11.0.8.10-2.windows.redhat.x86_64\bin\java.exe"
> 

AW: some problems with S7 cyclic subscriptions

2021-11-04 Thread Christofer Dutz
Hi Guido,

first of all, welcome here ... I am sure we'll be able to help you.

Regarding your problem with the subcriptions. This is actually something we 
already discussed interenally (here on the list).
The problem is, that this sort of subscription, that was recently added to the 
S7 driver, is only supported on a very limited subset oft he S7 devices. I 
think currently only the big S7 400 devicess support that, but I'm sure Cesar 
(the one who implemented that feature) will be able to give you more 
information on this.

Right now I would expect it to simply fail on S7 300, S7 1200 and S7 1500 ... 
and of course the LOGO ...

So as a next step, I think we should make the driver aware of this and return a 
sensible error in case of requesting a subscription builder from a connection 
to a device, that doesn't support this.

On a longer perspective we have plans to simulate subscriptions by internally 
polling in the background, but that is a feature that hasn't been implemented 
yet, but we have it on our shedule.

Chris


Von: Rennert, Guido 
Gesendet: Donnerstag, 4. November 2021 11:06
An: dev@plc4x.apache.org
Betreff: some problems with S7 cyclic subscriptions

Hello,

as a complete newbie in Java, S7 and PLC4X it does not help - if I have to get 
some data from a Siemens-PLC. We decided to use PLC4X and as always there can 
occur some little problems. Now I am involved in using PLC4X for about one week.

Ok let me first say what I use at the moment:

  *   Java 11 64-Bit-Version on Intel (Windows 10) and Arm-System (Debian)
  *   PLC4X version 0.9.0 (but I tested in this case 0.10.0-SNAPSHOT, too)
  *   Siemens S7-300, S7-1500 (Software-PLC) and hopefully some more types in 
the next weeks

As preparation for more functionality I created an ugly short test program, 
which does some reading out of a data block. This is really running fine an I 
was surprised to get to this point in really a short time. So I think that the 
PLC4X is a well kind of stuff.

To improve at second the reading of data out of the PLC I tried to use the 
possibility of 'subscription' - unfortunately this has been without success the 
last 2 days. So I decided to ask what I am doing wrong.

As an attachment there are some more information to be found as pictures and 
some text parts.

Explanation:

I try to establish a subscription request by doing the builder and execute the 
request afterwards (attachment Source_SubscriptionRequest.txt):

// Create a new subscription request cyclic mode only !
PlcSubscriptionRequest.Builder builder = 
plcConnection.subscriptionRequestBuilder();

for (String searchName : deviceData.dataMap.keySet()) {
switch (deviceData.getSubscriptionType(searchName)) {
case "CYCLIC": {
builder.addCyclicField(searchName, 
deviceData.getDataPlaceAndType(searchName), 
Duration.ofMillis(Integer.valueOf(deviceData.getSubscriptionTime(searchName;
};break;
case "ONCHANGE": {
// TODO add onchange subscription builder
};break;
case "ONEVENT": {
// TODO add onevent subscription builder
};break;
default: {

};break;
}
}
// finalize the subscription builder
PlcSubscriptionRequest subscriptionRequest = builder.build();

// activate the subscriptions now (here it doesn't matter if you use the 
synchronize or asynchronize approach)
PlcSubscriptionResponse plcSubscriptionResponse = 
subscriptionRequest.execute().get(20, TimeUnit.SECONDS);
// PlcSubscriptionResponse plcSubscriptionResponse = 
subscriptionRequest.execute().get();
// PlcSubscriptionResponse plcSubscriptionResponse = 
subscriptionRequest.execute().get(5000, TimeUnit.MILLISECONDS);

The 'deviceData'-class contains all configuration values which are read out of 
a very simple properties-file. The picture 'Debug_BuilderInfo.PNG' shows the 
content of the two entries and I think they are OK so far.
The property-file contains these information about the entries:



# data address is the physical address inside the plc and the type
data_set_001=TEST_BIT0|%DB100:0.0:BOOL|BOOL|CYCLIC|333
data_set_002=TEST_BIT1|%DB100:0.1:BOOL|BOOL|CYCLIC|444

The fieldname in the first line will be later 'TEST_BIT0' the address and type 
will be '%DB100:0.0:BOOL'  it should be a cyclic mode 'CYCLIC' and the cycle 
time should be '333' [ms]. The other values in the line are not used inside the 
program (maybe later but not now).


Unfortunately this will lead me to an error I can't resolve now. (the out is 
the attachment Console_OutputOnError.txt)

"C:\Program Files\Java\openjdk-11.0.8.10-2.windows.redhat.x86_64\bin\java.exe" 
-agentlib:jdwp=transport=dt_socket,address=127.0.0.1:50521,suspend=y,server=n 
-Dplc_name=KoehlInhouseTestSPS 
-javaagent:D:\Programme\IntelliJ_IDEA_2019.3.4\plugins\java\lib\rt\debugger-agent.jar
 -Dfile.encoding=UTF-8 -classpath 

some problems with S7 cyclic subscriptions

2021-11-04 Thread Rennert, Guido
Hello,

as a complete newbie in Java, S7 and PLC4X it does not help - if I have to get 
some data from a Siemens-PLC. We decided to use PLC4X and as always there can 
occur some little problems. Now I am involved in using PLC4X for about one week.

Ok let me first say what I use at the moment:

  *   Java 11 64-Bit-Version on Intel (Windows 10) and Arm-System (Debian)
  *   PLC4X version 0.9.0 (but I tested in this case 0.10.0-SNAPSHOT, too)
  *   Siemens S7-300, S7-1500 (Software-PLC) and hopefully some more types in 
the next weeks

As preparation for more functionality I created an ugly short test program, 
which does some reading out of a data block. This is really running fine an I 
was surprised to get to this point in really a short time. So I think that the 
PLC4X is a well kind of stuff.

To improve at second the reading of data out of the PLC I tried to use the 
possibility of 'subscription' - unfortunately this has been without success the 
last 2 days. So I decided to ask what I am doing wrong.

As an attachment there are some more information to be found as pictures and 
some text parts.

Explanation:

I try to establish a subscription request by doing the builder and execute the 
request afterwards (attachment Source_SubscriptionRequest.txt):

// Create a new subscription request cyclic mode only !
PlcSubscriptionRequest.Builder builder = 
plcConnection.subscriptionRequestBuilder();

for (String searchName : deviceData.dataMap.keySet()) {
switch (deviceData.getSubscriptionType(searchName)) {
case "CYCLIC": {
builder.addCyclicField(searchName, 
deviceData.getDataPlaceAndType(searchName), 
Duration.ofMillis(Integer.valueOf(deviceData.getSubscriptionTime(searchName;
};break;
case "ONCHANGE": {
// TODO add onchange subscription builder
};break;
case "ONEVENT": {
// TODO add onevent subscription builder
};break;
default: {

};break;
}
}
// finalize the subscription builder
PlcSubscriptionRequest subscriptionRequest = builder.build();

// activate the subscriptions now (here it doesn't matter if you use the 
synchronize or asynchronize approach)
PlcSubscriptionResponse plcSubscriptionResponse = 
subscriptionRequest.execute().get(20, TimeUnit.SECONDS);
// PlcSubscriptionResponse plcSubscriptionResponse = 
subscriptionRequest.execute().get();
// PlcSubscriptionResponse plcSubscriptionResponse = 
subscriptionRequest.execute().get(5000, TimeUnit.MILLISECONDS);

The 'deviceData'-class contains all configuration values which are read out of 
a very simple properties-file. The picture 'Debug_BuilderInfo.PNG' shows the 
content of the two entries and I think they are OK so far.
The property-file contains these information about the entries:



# data address is the physical address inside the plc and the type
data_set_001=TEST_BIT0|%DB100:0.0:BOOL|BOOL|CYCLIC|333
data_set_002=TEST_BIT1|%DB100:0.1:BOOL|BOOL|CYCLIC|444

The fieldname in the first line will be later 'TEST_BIT0' the address and type 
will be '%DB100:0.0:BOOL'  it should be a cyclic mode 'CYCLIC' and the cycle 
time should be '333' [ms]. The other values in the line are not used inside the 
program (maybe later but not now).


Unfortunately this will lead me to an error I can't resolve now. (the out is 
the attachment Console_OutputOnError.txt)

"C:\Program Files\Java\openjdk-11.0.8.10-2.windows.redhat.x86_64\bin\java.exe" 
-agentlib:jdwp=transport=dt_socket,address=127.0.0.1:50521,suspend=y,server=n 
-Dplc_name=KoehlInhouseTestSPS 
-javaagent:D:\Programme\IntelliJ_IDEA_2019.3.4\plugins\java\lib\rt\debugger-agent.jar
 -Dfile.encoding=UTF-8 -classpath