Re: S7 write test doubt
Hello Chris, Yes, it definitely helped! I tested the previous 'INTERNAL_ERROR' write requests with the last updates you made (and using the Siemens S7-300): builderWriter.addItem("mivariable", "%DB20:DBW06:INT", 1); builderWriter.addItem("mivariable", "%DB20:DBD06:DINT", 1); And they are working perfectly now! Thank you so much for fixing the issue. I will keep doing more tests using the PLC4x library, and let you know of the results Thank you for the time and effort. Best, Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 8 de Julio 2020 22:08:32 Asunto: Re: S7 write test doubt Ok ... so I couldn't wait till tomorrow. I fixed the C code generation and pushed the changes. In my setup here now it should be possible to write the values you couldn't previously. Please check and report back if it helped. This was actually a great demo of the power of our mspec code generation (ok .. I had a bug in the C one) but in general the bug was a complete spec bug. So I updated the spec and the java and C drivers got updated automatically :-) Chris Am 08.07.20, 21:11 schrieb "Christofer Dutz" : Hi Iñigo, so indeed I was able to fix the issue. However it did show a little inconvenience in my PLC4C code generation which I need to address. So I won't be able to push my changes this evening, but am positive about being able to fix them tomorrow. Chris Am 08.07.20, 20:28 schrieb "Christofer Dutz" : Hi Iñigo, good news ... I think I found the issue we were having. It turns out that when sending data to the S7 if you have INT,UINT,DINT,UDINT but interestingly not SINT and USINT you need to use the Data Transport Size of "INTEGER" instead of "BYTE/WORD/DWORD". Also did I notice that we were serializing the "length" for data items wrongly ... I hope I'll be able to finish a fix this evening. Chris Am 08.07.20, 19:02 schrieb "Christofer Dutz" : Hi Iñigo, perhaps I can help with this (Sorry I was drowning in all sorts of work-things lately). I think I'll setup my S7 to have a INT or DINT variable and will try to reproduce the error here. Chris Am 07.07.20, 10:36 schrieb "Iñigo Angulo" : Hi Etienne, Thank you for the advice. I will also use WireShark to try to make a clearer idea of where the problem is coming from. I will let you know of the progress i do. Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Etienne Robinet" <43...@etu.he2b.be> Para: "dev" Enviados: Lunes, 6 de Julio 2020 12:47:39 Asunto: Re: S7 write test doubt Hi, If you get the internal error, maybe try WireShark. He will tell you the exact error so you can know exactly where the problem is coming from. Regards Etienne > Le 3 juil. 2020 à 17:32, Cesar Garcia a écrit : > > Hi Iñigo, > > If you have the opportunity to test the previous version, it is currently > under evaluation by the team (0.6.1 PR). > > You can check the versión here > > https://github.com/glcj/plc4x/tree/s7alarm > > In addition to the examples placed in the official repository, here you > will find a number of examples with native S7 types. > > https://github.com/glcj/PLC4XS7Examples > > I will be attentive to any request since it is in my interest that this > version is very well debugged. > > I hope it is useful for you > > >> El vie., 3 jul. 2020 a las 3:24, Iñigo Angulo () escribió: >> >> Hi Chris, >>
Re: S7 write test doubt
Ok ... so I couldn't wait till tomorrow. I fixed the C code generation and pushed the changes. In my setup here now it should be possible to write the values you couldn't previously. Please check and report back if it helped. This was actually a great demo of the power of our mspec code generation (ok .. I had a bug in the C one) but in general the bug was a complete spec bug. So I updated the spec and the java and C drivers got updated automatically :-) Chris Am 08.07.20, 21:11 schrieb "Christofer Dutz" : Hi Iñigo, so indeed I was able to fix the issue. However it did show a little inconvenience in my PLC4C code generation which I need to address. So I won't be able to push my changes this evening, but am positive about being able to fix them tomorrow. Chris Am 08.07.20, 20:28 schrieb "Christofer Dutz" : Hi Iñigo, good news ... I think I found the issue we were having. It turns out that when sending data to the S7 if you have INT,UINT,DINT,UDINT but interestingly not SINT and USINT you need to use the Data Transport Size of "INTEGER" instead of "BYTE/WORD/DWORD". Also did I notice that we were serializing the "length" for data items wrongly ... I hope I'll be able to finish a fix this evening. Chris Am 08.07.20, 19:02 schrieb "Christofer Dutz" : Hi Iñigo, perhaps I can help with this (Sorry I was drowning in all sorts of work-things lately). I think I'll setup my S7 to have a INT or DINT variable and will try to reproduce the error here. Chris Am 07.07.20, 10:36 schrieb "Iñigo Angulo" : Hi Etienne, Thank you for the advice. I will also use WireShark to try to make a clearer idea of where the problem is coming from. I will let you know of the progress i do. Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Etienne Robinet" <43...@etu.he2b.be> Para: "dev" Enviados: Lunes, 6 de Julio 2020 12:47:39 Asunto: Re: S7 write test doubt Hi, If you get the internal error, maybe try WireShark. He will tell you the exact error so you can know exactly where the problem is coming from. Regards Etienne > Le 3 juil. 2020 à 17:32, Cesar Garcia a écrit : > > Hi Iñigo, > > If you have the opportunity to test the previous version, it is currently > under evaluation by the team (0.6.1 PR). > > You can check the versión here > > https://github.com/glcj/plc4x/tree/s7alarm > > In addition to the examples placed in the official repository, here you > will find a number of examples with native S7 types. > > https://github.com/glcj/PLC4XS7Examples > > I will be attentive to any request since it is in my interest that this > version is very well debugged. > > I hope it is useful for you > > >> El vie., 3 jul. 2020 a las 3:24, Iñigo Angulo () escribió: >> >> Hi Chris, >> >> Yes, I was thinking about why those dataypes were returning a List, thanks >> for the explanation >> >> I tried the SINT access. For reading values works perfectly. But when >> writing, Im afraid I am getting the same INTERNAL_ERROR message as for INT >> and DINT. I will make further tests, and let you know of the progress i >> make. >> >> Thanks! >> >> Iñigo >> >> - >> Iñigo Angulo >> >> ZYLK.net :: consultoría.openSource >> Ribera de Axpe, 11 >> Edificio A, modulo 201-203 >&
Re: S7 write test doubt
Hi Iñigo, so indeed I was able to fix the issue. However it did show a little inconvenience in my PLC4C code generation which I need to address. So I won't be able to push my changes this evening, but am positive about being able to fix them tomorrow. Chris Am 08.07.20, 20:28 schrieb "Christofer Dutz" : Hi Iñigo, good news ... I think I found the issue we were having. It turns out that when sending data to the S7 if you have INT,UINT,DINT,UDINT but interestingly not SINT and USINT you need to use the Data Transport Size of "INTEGER" instead of "BYTE/WORD/DWORD". Also did I notice that we were serializing the "length" for data items wrongly ... I hope I'll be able to finish a fix this evening. Chris Am 08.07.20, 19:02 schrieb "Christofer Dutz" : Hi Iñigo, perhaps I can help with this (Sorry I was drowning in all sorts of work-things lately). I think I'll setup my S7 to have a INT or DINT variable and will try to reproduce the error here. Chris Am 07.07.20, 10:36 schrieb "Iñigo Angulo" : Hi Etienne, Thank you for the advice. I will also use WireShark to try to make a clearer idea of where the problem is coming from. I will let you know of the progress i do. Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Etienne Robinet" <43...@etu.he2b.be> Para: "dev" Enviados: Lunes, 6 de Julio 2020 12:47:39 Asunto: Re: S7 write test doubt Hi, If you get the internal error, maybe try WireShark. He will tell you the exact error so you can know exactly where the problem is coming from. Regards Etienne > Le 3 juil. 2020 à 17:32, Cesar Garcia a écrit : > > Hi Iñigo, > > If you have the opportunity to test the previous version, it is currently > under evaluation by the team (0.6.1 PR). > > You can check the versión here > > https://github.com/glcj/plc4x/tree/s7alarm > > In addition to the examples placed in the official repository, here you > will find a number of examples with native S7 types. > > https://github.com/glcj/PLC4XS7Examples > > I will be attentive to any request since it is in my interest that this > version is very well debugged. > > I hope it is useful for you > > >> El vie., 3 jul. 2020 a las 3:24, Iñigo Angulo () escribió: >> >> Hi Chris, >> >> Yes, I was thinking about why those dataypes were returning a List, thanks >> for the explanation >> >> I tried the SINT access. For reading values works perfectly. But when >> writing, Im afraid I am getting the same INTERNAL_ERROR message as for INT >> and DINT. I will make further tests, and let you know of the progress i >> make. >> >> Thanks! >> >> Iñigo >> >> - >> Iñigo Angulo >> >> ZYLK.net :: consultoría.openSource >> Ribera de Axpe, 11 >> Edificio A, modulo 201-203 >> 48950 Erandio (Bizkaia) >> +34 944272119 >> - >> >> - Mensaje original - >> De: "Christofer Dutz" >> Para: "dev" >> Enviados: Jueves, 2 de Julio 2020 16:42:16 >> Asunto: Re: S7 write test doubt >> >> Hi Iñigo, >> >> happy you made quite some progress. >> >> If you were asking yourself why for BYTE, WORD and DWORD the driver is >> returning a List ... these are considered Bit-Strings. If you want to >> read/write a single byte as an integer value, please use SINT instead. >>
Re: S7 write test doubt
Hi Iñigo, good news ... I think I found the issue we were having. It turns out that when sending data to the S7 if you have INT,UINT,DINT,UDINT but interestingly not SINT and USINT you need to use the Data Transport Size of "INTEGER" instead of "BYTE/WORD/DWORD". Also did I notice that we were serializing the "length" for data items wrongly ... I hope I'll be able to finish a fix this evening. Chris Am 08.07.20, 19:02 schrieb "Christofer Dutz" : Hi Iñigo, perhaps I can help with this (Sorry I was drowning in all sorts of work-things lately). I think I'll setup my S7 to have a INT or DINT variable and will try to reproduce the error here. Chris Am 07.07.20, 10:36 schrieb "Iñigo Angulo" : Hi Etienne, Thank you for the advice. I will also use WireShark to try to make a clearer idea of where the problem is coming from. I will let you know of the progress i do. Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Etienne Robinet" <43...@etu.he2b.be> Para: "dev" Enviados: Lunes, 6 de Julio 2020 12:47:39 Asunto: Re: S7 write test doubt Hi, If you get the internal error, maybe try WireShark. He will tell you the exact error so you can know exactly where the problem is coming from. Regards Etienne > Le 3 juil. 2020 à 17:32, Cesar Garcia a écrit : > > Hi Iñigo, > > If you have the opportunity to test the previous version, it is currently > under evaluation by the team (0.6.1 PR). > > You can check the versión here > > https://github.com/glcj/plc4x/tree/s7alarm > > In addition to the examples placed in the official repository, here you > will find a number of examples with native S7 types. > > https://github.com/glcj/PLC4XS7Examples > > I will be attentive to any request since it is in my interest that this > version is very well debugged. > > I hope it is useful for you > > >> El vie., 3 jul. 2020 a las 3:24, Iñigo Angulo () escribió: >> >> Hi Chris, >> >> Yes, I was thinking about why those dataypes were returning a List, thanks >> for the explanation >> >> I tried the SINT access. For reading values works perfectly. But when >> writing, Im afraid I am getting the same INTERNAL_ERROR message as for INT >> and DINT. I will make further tests, and let you know of the progress i >> make. >> >> Thanks! >> >> Iñigo >> >> - >> Iñigo Angulo >> >> ZYLK.net :: consultoría.openSource >> Ribera de Axpe, 11 >> Edificio A, modulo 201-203 >> 48950 Erandio (Bizkaia) >> +34 944272119 >> - >> >> - Mensaje original - >> De: "Christofer Dutz" >> Para: "dev" >> Enviados: Jueves, 2 de Julio 2020 16:42:16 >> Asunto: Re: S7 write test doubt >> >> Hi Iñigo, >> >> happy you made quite some progress. >> >> If you were asking yourself why for BYTE, WORD and DWORD the driver is >> returning a List ... these are considered Bit-Strings. If you want to >> read/write a single byte as an integer value, please use SINT instead. >> >> So regarding one of your questions ... could you instead of doing: >>builderWriter.addItem("mivariable", "%DB20:DBB06:BYTE", 127); >> Please try: >>builderWriter.addItem("mivariable", "%DB20:DBB06:SINT", 127); >> >> And if you're getting an INTERNAL_ERROR that's probably our fault. As I >> mentioned, we haven't done too much writing as no one ever uses that ;-) >> >> Chris >> >> >> >> >> Am 02.07.20, 15:56 schrieb "
Re: S7 write test doubt
Hi Iñigo, perhaps I can help with this (Sorry I was drowning in all sorts of work-things lately). I think I'll setup my S7 to have a INT or DINT variable and will try to reproduce the error here. Chris Am 07.07.20, 10:36 schrieb "Iñigo Angulo" : Hi Etienne, Thank you for the advice. I will also use WireShark to try to make a clearer idea of where the problem is coming from. I will let you know of the progress i do. Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Etienne Robinet" <43...@etu.he2b.be> Para: "dev" Enviados: Lunes, 6 de Julio 2020 12:47:39 Asunto: Re: S7 write test doubt Hi, If you get the internal error, maybe try WireShark. He will tell you the exact error so you can know exactly where the problem is coming from. Regards Etienne > Le 3 juil. 2020 à 17:32, Cesar Garcia a écrit : > > Hi Iñigo, > > If you have the opportunity to test the previous version, it is currently > under evaluation by the team (0.6.1 PR). > > You can check the versión here > > https://github.com/glcj/plc4x/tree/s7alarm > > In addition to the examples placed in the official repository, here you > will find a number of examples with native S7 types. > > https://github.com/glcj/PLC4XS7Examples > > I will be attentive to any request since it is in my interest that this > version is very well debugged. > > I hope it is useful for you > > >> El vie., 3 jul. 2020 a las 3:24, Iñigo Angulo () escribió: >> >> Hi Chris, >> >> Yes, I was thinking about why those dataypes were returning a List, thanks >> for the explanation >> >> I tried the SINT access. For reading values works perfectly. But when >> writing, Im afraid I am getting the same INTERNAL_ERROR message as for INT >> and DINT. I will make further tests, and let you know of the progress i >> make. >> >> Thanks! >> >> Iñigo >> >> - >> Iñigo Angulo >> >> ZYLK.net :: consultoría.openSource >> Ribera de Axpe, 11 >> Edificio A, modulo 201-203 >> 48950 Erandio (Bizkaia) >> +34 944272119 >> - >> >> - Mensaje original - >> De: "Christofer Dutz" >> Para: "dev" >> Enviados: Jueves, 2 de Julio 2020 16:42:16 >> Asunto: Re: S7 write test doubt >> >> Hi Iñigo, >> >> happy you made quite some progress. >> >> If you were asking yourself why for BYTE, WORD and DWORD the driver is >> returning a List ... these are considered Bit-Strings. If you want to >> read/write a single byte as an integer value, please use SINT instead. >> >> So regarding one of your questions ... could you instead of doing: >>builderWriter.addItem("mivariable", "%DB20:DBB06:BYTE", 127); >> Please try: >>builderWriter.addItem("mivariable", "%DB20:DBB06:SINT", 127); >> >> And if you're getting an INTERNAL_ERROR that's probably our fault. As I >> mentioned, we haven't done too much writing as no one ever uses that ;-) >> >> Chris >> >> >> >> >> Am 02.07.20, 15:56 schrieb "Iñigo Angulo" : >> >>Hi, >> >>I have been doing further tests with the S7 driver. I would like to >> ask you some doubts, which i am not sure if relate to the PLC4X driver or >> the actual hardware (Siemens S7-300) i am using (pretty novice in PLC data >> access im afraid...) >> >> >>The "Read value" tests I have done work correctly for different >> datatypes, for example: >> >>builderReader.addItem("mivariable", "%DB20:DBX5.0:BOOL"); //Single >> boolean value >>builderReader.addItem("mivariable", "%DB20:DBB06:BYTE"); //returns >> a PlcList (Array of 8 boolean values) >>builderReader.addItem("mivariable", "%DB20:DBW06:WORD");
Re: S7 write test doubt
Hi Etienne, Thank you for the advice. I will also use WireShark to try to make a clearer idea of where the problem is coming from. I will let you know of the progress i do. Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Etienne Robinet" <43...@etu.he2b.be> Para: "dev" Enviados: Lunes, 6 de Julio 2020 12:47:39 Asunto: Re: S7 write test doubt Hi, If you get the internal error, maybe try WireShark. He will tell you the exact error so you can know exactly where the problem is coming from. Regards Etienne > Le 3 juil. 2020 à 17:32, Cesar Garcia a écrit : > > Hi Iñigo, > > If you have the opportunity to test the previous version, it is currently > under evaluation by the team (0.6.1 PR). > > You can check the versión here > > https://github.com/glcj/plc4x/tree/s7alarm > > In addition to the examples placed in the official repository, here you > will find a number of examples with native S7 types. > > https://github.com/glcj/PLC4XS7Examples > > I will be attentive to any request since it is in my interest that this > version is very well debugged. > > I hope it is useful for you > > >> El vie., 3 jul. 2020 a las 3:24, Iñigo Angulo () escribió: >> >> Hi Chris, >> >> Yes, I was thinking about why those dataypes were returning a List, thanks >> for the explanation >> >> I tried the SINT access. For reading values works perfectly. But when >> writing, Im afraid I am getting the same INTERNAL_ERROR message as for INT >> and DINT. I will make further tests, and let you know of the progress i >> make. >> >> Thanks! >> >> Iñigo >> >> - >> Iñigo Angulo >> >> ZYLK.net :: consultoría.openSource >> Ribera de Axpe, 11 >> Edificio A, modulo 201-203 >> 48950 Erandio (Bizkaia) >> +34 944272119 >> - >> >> - Mensaje original - >> De: "Christofer Dutz" >> Para: "dev" >> Enviados: Jueves, 2 de Julio 2020 16:42:16 >> Asunto: Re: S7 write test doubt >> >> Hi Iñigo, >> >> happy you made quite some progress. >> >> If you were asking yourself why for BYTE, WORD and DWORD the driver is >> returning a List ... these are considered Bit-Strings. If you want to >> read/write a single byte as an integer value, please use SINT instead. >> >> So regarding one of your questions ... could you instead of doing: >>builderWriter.addItem("mivariable", "%DB20:DBB06:BYTE", 127); >> Please try: >>builderWriter.addItem("mivariable", "%DB20:DBB06:SINT", 127); >> >> And if you're getting an INTERNAL_ERROR that's probably our fault. As I >> mentioned, we haven't done too much writing as no one ever uses that ;-) >> >> Chris >> >> >> >> >> Am 02.07.20, 15:56 schrieb "Iñigo Angulo" : >> >>Hi, >> >>I have been doing further tests with the S7 driver. I would like to >> ask you some doubts, which i am not sure if relate to the PLC4X driver or >> the actual hardware (Siemens S7-300) i am using (pretty novice in PLC data >> access im afraid...) >> >> >>The "Read value" tests I have done work correctly for different >> datatypes, for example: >> >>builderReader.addItem("mivariable", "%DB20:DBX5.0:BOOL"); //Single >> boolean value >>builderReader.addItem("mivariable", "%DB20:DBB06:BYTE"); //returns >> a PlcList (Array of 8 boolean values) >>builderReader.addItem("mivariable", "%DB20:DBW06:WORD"); //returns >> a PlcList (Array of 16 boolean values) >>builderReader.addItem("mivariable", "%DB20:DBD06:DWORD"); >> //returns a PlcList (Array of 32 boolean values) >>builderReader.addItem("mivariable", "%DB20:DBW06:INT"); //returns >> a PlcInteger (16 bit integer (signed)) >>builderReader.addItem("mivariable", "%DB20:DBD06:DINT"); //returns >> a PlcInteger (32 bit integer (signed)) >>builderReader.addItem("mivariable", "%DB20:DBD06:REAL"); //returns >> a PlcFloat (32 bit IEEE 754 full precision floating point value (signed)) >> >
Re: S7 write test doubt
Hi, If you get the internal error, maybe try WireShark. He will tell you the exact error so you can know exactly where the problem is coming from. Regards Etienne > Le 3 juil. 2020 à 17:32, Cesar Garcia a écrit : > > Hi Iñigo, > > If you have the opportunity to test the previous version, it is currently > under evaluation by the team (0.6.1 PR). > > You can check the versión here > > https://github.com/glcj/plc4x/tree/s7alarm > > In addition to the examples placed in the official repository, here you > will find a number of examples with native S7 types. > > https://github.com/glcj/PLC4XS7Examples > > I will be attentive to any request since it is in my interest that this > version is very well debugged. > > I hope it is useful for you > > >> El vie., 3 jul. 2020 a las 3:24, Iñigo Angulo () escribió: >> >> Hi Chris, >> >> Yes, I was thinking about why those dataypes were returning a List, thanks >> for the explanation >> >> I tried the SINT access. For reading values works perfectly. But when >> writing, Im afraid I am getting the same INTERNAL_ERROR message as for INT >> and DINT. I will make further tests, and let you know of the progress i >> make. >> >> Thanks! >> >> Iñigo >> >> - >> Iñigo Angulo >> >> ZYLK.net :: consultoría.openSource >> Ribera de Axpe, 11 >> Edificio A, modulo 201-203 >> 48950 Erandio (Bizkaia) >> +34 944272119 >> - >> >> - Mensaje original - >> De: "Christofer Dutz" >> Para: "dev" >> Enviados: Jueves, 2 de Julio 2020 16:42:16 >> Asunto: Re: S7 write test doubt >> >> Hi Iñigo, >> >> happy you made quite some progress. >> >> If you were asking yourself why for BYTE, WORD and DWORD the driver is >> returning a List ... these are considered Bit-Strings. If you want to >> read/write a single byte as an integer value, please use SINT instead. >> >> So regarding one of your questions ... could you instead of doing: >>builderWriter.addItem("mivariable", "%DB20:DBB06:BYTE", 127); >> Please try: >>builderWriter.addItem("mivariable", "%DB20:DBB06:SINT", 127); >> >> And if you're getting an INTERNAL_ERROR that's probably our fault. As I >> mentioned, we haven't done too much writing as no one ever uses that ;-) >> >> Chris >> >> >> >> >> Am 02.07.20, 15:56 schrieb "Iñigo Angulo" : >> >>Hi, >> >>I have been doing further tests with the S7 driver. I would like to >> ask you some doubts, which i am not sure if relate to the PLC4X driver or >> the actual hardware (Siemens S7-300) i am using (pretty novice in PLC data >> access im afraid...) >> >> >>The "Read value" tests I have done work correctly for different >> datatypes, for example: >> >>builderReader.addItem("mivariable", "%DB20:DBX5.0:BOOL"); //Single >> boolean value >>builderReader.addItem("mivariable", "%DB20:DBB06:BYTE"); //returns >> a PlcList (Array of 8 boolean values) >>builderReader.addItem("mivariable", "%DB20:DBW06:WORD"); //returns >> a PlcList (Array of 16 boolean values) >>builderReader.addItem("mivariable", "%DB20:DBD06:DWORD"); >> //returns a PlcList (Array of 32 boolean values) >>builderReader.addItem("mivariable", "%DB20:DBW06:INT"); //returns >> a PlcInteger (16 bit integer (signed)) >>builderReader.addItem("mivariable", "%DB20:DBD06:DINT"); //returns >> a PlcInteger (32 bit integer (signed)) >>builderReader.addItem("mivariable", "%DB20:DBD06:REAL"); //returns >> a PlcFloat (32 bit IEEE 754 full precision floating point value (signed)) >> >> >>In the "Write value" tests, write request for all datatype seem to >> work fine: >> >>builderWriter.addItem("mivariable", "%DB20:DBX6.1:BOOL", true); >> //write response code "OK" >>builderWriter.addItem("mivariable", "%DB20:DBB06:BYTE", 127); >> //write response code "OK" >>builderWriter.addItem("mivariable", "%DB20:DBW06:WORD", 7); >> //write response code "OK" >>build
Re: S7 write test doubt
Hi, Thank you for the information Cesar and Chris. I will take a look at those examples too, and continue doing further tests. I will keep you inform about the progress I do. Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Viernes, 3 de Julio 2020 17:41:56 Asunto: Re: S7 write test doubt Hi all, but there is one really big difference between 0.6.x and 0.7.x ... in the 0.6 drivers when writing I explicitly split up write requests that for every filed a single value is sent. But yes .. it would be interesting. But the INTERNAL_ERROR for me implies that the problem is definitely on our side. Chris Am 03.07.20, 17:32 schrieb "Cesar Garcia" : Hi Iñigo, If you have the opportunity to test the previous version, it is currently under evaluation by the team (0.6.1 PR). You can check the versión here https://github.com/glcj/plc4x/tree/s7alarm In addition to the examples placed in the official repository, here you will find a number of examples with native S7 types. https://github.com/glcj/PLC4XS7Examples I will be attentive to any request since it is in my interest that this version is very well debugged. I hope it is useful for you El vie., 3 jul. 2020 a las 3:24, Iñigo Angulo () escribió: > Hi Chris, > > Yes, I was thinking about why those dataypes were returning a List, thanks > for the explanation > > I tried the SINT access. For reading values works perfectly. But when > writing, Im afraid I am getting the same INTERNAL_ERROR message as for INT > and DINT. I will make further tests, and let you know of the progress i > make. > > Thanks! > > Iñigo > > - > Iñigo Angulo > > ZYLK.net :: consultoría.openSource > Ribera de Axpe, 11 > Edificio A, modulo 201-203 > 48950 Erandio (Bizkaia) > +34 944272119 > - > > - Mensaje original - > De: "Christofer Dutz" > Para: "dev" > Enviados: Jueves, 2 de Julio 2020 16:42:16 > Asunto: Re: S7 write test doubt > > Hi Iñigo, > > happy you made quite some progress. > > If you were asking yourself why for BYTE, WORD and DWORD the driver is > returning a List ... these are considered Bit-Strings. If you want to > read/write a single byte as an integer value, please use SINT instead. > > So regarding one of your questions ... could you instead of doing: > builderWriter.addItem("mivariable", "%DB20:DBB06:BYTE", 127); > Please try: > builderWriter.addItem("mivariable", "%DB20:DBB06:SINT", 127); > > And if you're getting an INTERNAL_ERROR that's probably our fault. As I > mentioned, we haven't done too much writing as no one ever uses that ;-) > > Chris > > > > > Am 02.07.20, 15:56 schrieb "Iñigo Angulo" : > > Hi, > > I have been doing further tests with the S7 driver. I would like to > ask you some doubts, which i am not sure if relate to the PLC4X driver or > the actual hardware (Siemens S7-300) i am using (pretty novice in PLC data > access im afraid...) > > > The "Read value" tests I have done work correctly for different > datatypes, for example: > > builderReader.addItem("mivariable", "%DB20:DBX5.0:BOOL"); //Single > boolean value > builderReader.addItem("mivariable", "%DB20:DBB06:BYTE"); //returns > a PlcList (Array of 8 boolean values) > builderReader.addItem("mivariable", "%DB20:DBW06:WORD"); //returns > a PlcList (Array of 16 boolean values) > builderReader.addItem("mivariable", "%DB20:DBD06:DWORD"); > //returns a PlcList (Array of 32 boolean values) > builderReader.addItem("mivariable", "%DB20:DBW06:INT"); //returns > a PlcInteger (16 bit integer (signed)) > builderReader.addItem("mivariable", "%DB20:DBD06:DINT"); //returns > a PlcInteger (32 bit integer (signed)) > builderReader.addItem("mivariable", "%DB20:DBD06:REAL"); //returns > a PlcFloat (32 bit IEEE 754 full precision floati
Re: S7 write test doubt
Hi all, but there is one really big difference between 0.6.x and 0.7.x ... in the 0.6 drivers when writing I explicitly split up write requests that for every filed a single value is sent. But yes .. it would be interesting. But the INTERNAL_ERROR for me implies that the problem is definitely on our side. Chris Am 03.07.20, 17:32 schrieb "Cesar Garcia" : Hi Iñigo, If you have the opportunity to test the previous version, it is currently under evaluation by the team (0.6.1 PR). You can check the versión here https://github.com/glcj/plc4x/tree/s7alarm In addition to the examples placed in the official repository, here you will find a number of examples with native S7 types. https://github.com/glcj/PLC4XS7Examples I will be attentive to any request since it is in my interest that this version is very well debugged. I hope it is useful for you El vie., 3 jul. 2020 a las 3:24, Iñigo Angulo () escribió: > Hi Chris, > > Yes, I was thinking about why those dataypes were returning a List, thanks > for the explanation > > I tried the SINT access. For reading values works perfectly. But when > writing, Im afraid I am getting the same INTERNAL_ERROR message as for INT > and DINT. I will make further tests, and let you know of the progress i > make. > > Thanks! > > Iñigo > > - > Iñigo Angulo > > ZYLK.net :: consultoría.openSource > Ribera de Axpe, 11 > Edificio A, modulo 201-203 > 48950 Erandio (Bizkaia) > +34 944272119 > - > > - Mensaje original - > De: "Christofer Dutz" > Para: "dev" > Enviados: Jueves, 2 de Julio 2020 16:42:16 > Asunto: Re: S7 write test doubt > > Hi Iñigo, > > happy you made quite some progress. > > If you were asking yourself why for BYTE, WORD and DWORD the driver is > returning a List ... these are considered Bit-Strings. If you want to > read/write a single byte as an integer value, please use SINT instead. > > So regarding one of your questions ... could you instead of doing: > builderWriter.addItem("mivariable", "%DB20:DBB06:BYTE", 127); > Please try: > builderWriter.addItem("mivariable", "%DB20:DBB06:SINT", 127); > > And if you're getting an INTERNAL_ERROR that's probably our fault. As I > mentioned, we haven't done too much writing as no one ever uses that ;-) > > Chris > > > > > Am 02.07.20, 15:56 schrieb "Iñigo Angulo" : > > Hi, > > I have been doing further tests with the S7 driver. I would like to > ask you some doubts, which i am not sure if relate to the PLC4X driver or > the actual hardware (Siemens S7-300) i am using (pretty novice in PLC data > access im afraid...) > > > The "Read value" tests I have done work correctly for different > datatypes, for example: > > builderReader.addItem("mivariable", "%DB20:DBX5.0:BOOL"); //Single > boolean value > builderReader.addItem("mivariable", "%DB20:DBB06:BYTE"); //returns > a PlcList (Array of 8 boolean values) > builderReader.addItem("mivariable", "%DB20:DBW06:WORD"); //returns > a PlcList (Array of 16 boolean values) > builderReader.addItem("mivariable", "%DB20:DBD06:DWORD"); > //returns a PlcList (Array of 32 boolean values) > builderReader.addItem("mivariable", "%DB20:DBW06:INT"); //returns > a PlcInteger (16 bit integer (signed)) > builderReader.addItem("mivariable", "%DB20:DBD06:DINT"); //returns > a PlcInteger (32 bit integer (signed)) > builderReader.addItem("mivariable", "%DB20:DBD06:REAL"); //returns > a PlcFloat (32 bit IEEE 754 full precision floating point value (signed)) > > > In the "Write value" tests, write request for all datatype seem to > work fine: > > builderWriter.addItem("mivariable", "%DB20:DBX6.1:BOOL", true); > //write response code "OK" > builderWriter.addItem("mivariable", "%DB20:DBB06:BYTE", 127); > //write response code "OK" > builderWriter.addItem("mivariable", "%DB20:DBW06:WORD", 7); > //
Re: S7 write test doubt
Hi Iñigo, If you have the opportunity to test the previous version, it is currently under evaluation by the team (0.6.1 PR). You can check the versión here https://github.com/glcj/plc4x/tree/s7alarm In addition to the examples placed in the official repository, here you will find a number of examples with native S7 types. https://github.com/glcj/PLC4XS7Examples I will be attentive to any request since it is in my interest that this version is very well debugged. I hope it is useful for you El vie., 3 jul. 2020 a las 3:24, Iñigo Angulo () escribió: > Hi Chris, > > Yes, I was thinking about why those dataypes were returning a List, thanks > for the explanation > > I tried the SINT access. For reading values works perfectly. But when > writing, Im afraid I am getting the same INTERNAL_ERROR message as for INT > and DINT. I will make further tests, and let you know of the progress i > make. > > Thanks! > > Iñigo > > - > Iñigo Angulo > > ZYLK.net :: consultoría.openSource > Ribera de Axpe, 11 > Edificio A, modulo 201-203 > 48950 Erandio (Bizkaia) > +34 944272119 > - > > - Mensaje original - > De: "Christofer Dutz" > Para: "dev" > Enviados: Jueves, 2 de Julio 2020 16:42:16 > Asunto: Re: S7 write test doubt > > Hi Iñigo, > > happy you made quite some progress. > > If you were asking yourself why for BYTE, WORD and DWORD the driver is > returning a List ... these are considered Bit-Strings. If you want to > read/write a single byte as an integer value, please use SINT instead. > > So regarding one of your questions ... could you instead of doing: > builderWriter.addItem("mivariable", "%DB20:DBB06:BYTE", 127); > Please try: > builderWriter.addItem("mivariable", "%DB20:DBB06:SINT", 127); > > And if you're getting an INTERNAL_ERROR that's probably our fault. As I > mentioned, we haven't done too much writing as no one ever uses that ;-) > > Chris > > > > > Am 02.07.20, 15:56 schrieb "Iñigo Angulo" : > > Hi, > > I have been doing further tests with the S7 driver. I would like to > ask you some doubts, which i am not sure if relate to the PLC4X driver or > the actual hardware (Siemens S7-300) i am using (pretty novice in PLC data > access im afraid...) > > > The "Read value" tests I have done work correctly for different > datatypes, for example: > > builderReader.addItem("mivariable", "%DB20:DBX5.0:BOOL"); //Single > boolean value > builderReader.addItem("mivariable", "%DB20:DBB06:BYTE"); //returns > a PlcList (Array of 8 boolean values) > builderReader.addItem("mivariable", "%DB20:DBW06:WORD"); //returns > a PlcList (Array of 16 boolean values) > builderReader.addItem("mivariable", "%DB20:DBD06:DWORD"); > //returns a PlcList (Array of 32 boolean values) > builderReader.addItem("mivariable", "%DB20:DBW06:INT"); //returns > a PlcInteger (16 bit integer (signed)) > builderReader.addItem("mivariable", "%DB20:DBD06:DINT"); //returns > a PlcInteger (32 bit integer (signed)) > builderReader.addItem("mivariable", "%DB20:DBD06:REAL"); //returns > a PlcFloat (32 bit IEEE 754 full precision floating point value (signed)) > > > In the "Write value" tests, write request for all datatype seem to > work fine: > > builderWriter.addItem("mivariable", "%DB20:DBX6.1:BOOL", true); > //write response code "OK" > builderWriter.addItem("mivariable", "%DB20:DBB06:BYTE", 127); > //write response code "OK" > builderWriter.addItem("mivariable", "%DB20:DBW06:WORD", 7); > //write response code "OK" > builderWriter.addItem("mivariable", "%DB20:DBD06:DWORD", 1); > //write response code "OK" > > > Except for the 'INT' and 'DINT' datatypes, which return an > INTERNAL_ERROR response code > > builderWriter.addItem("mivariable", "%DB20:DBW06:INT", 1); //write > response code "INTERNAL_ERROR" > builderWriter.addItem("mivariable", "%DB20:DBD06:DINT", 1); > //write response code "INTERNAL_ERROR" > > > Is the INTERNAL_ERROR code a hardware issue? (Maybe a device > configuration problem?) > > --- > > Also, the other thing I found in the test: > >
Re: S7 write test doubt
Ok, thanks for checking this out. I'll investigate the issue as soon as I'm back in my office. Chris Von: Iñigo Angulo Gesendet: Freitag, 3. Juli 2020 09:24 An: dev Betreff: Re: S7 write test doubt Hi Chris, Yes, I was thinking about why those dataypes were returning a List, thanks for the explanation I tried the SINT access. For reading values works perfectly. But when writing, Im afraid I am getting the same INTERNAL_ERROR message as for INT and DINT. I will make further tests, and let you know of the progress i make. Thanks! Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Jueves, 2 de Julio 2020 16:42:16 Asunto: Re: S7 write test doubt Hi Iñigo, happy you made quite some progress. If you were asking yourself why for BYTE, WORD and DWORD the driver is returning a List ... these are considered Bit-Strings. If you want to read/write a single byte as an integer value, please use SINT instead. So regarding one of your questions ... could you instead of doing: builderWriter.addItem("mivariable", "%DB20:DBB06:BYTE", 127); Please try: builderWriter.addItem("mivariable", "%DB20:DBB06:SINT", 127); And if you're getting an INTERNAL_ERROR that's probably our fault. As I mentioned, we haven't done too much writing as no one ever uses that ;-) Chris Am 02.07.20, 15:56 schrieb "Iñigo Angulo" : Hi, I have been doing further tests with the S7 driver. I would like to ask you some doubts, which i am not sure if relate to the PLC4X driver or the actual hardware (Siemens S7-300) i am using (pretty novice in PLC data access im afraid...) The "Read value" tests I have done work correctly for different datatypes, for example: builderReader.addItem("mivariable", "%DB20:DBX5.0:BOOL"); //Single boolean value builderReader.addItem("mivariable", "%DB20:DBB06:BYTE"); //returns a PlcList (Array of 8 boolean values) builderReader.addItem("mivariable", "%DB20:DBW06:WORD"); //returns a PlcList (Array of 16 boolean values) builderReader.addItem("mivariable", "%DB20:DBD06:DWORD"); //returns a PlcList (Array of 32 boolean values) builderReader.addItem("mivariable", "%DB20:DBW06:INT"); //returns a PlcInteger (16 bit integer (signed)) builderReader.addItem("mivariable", "%DB20:DBD06:DINT"); //returns a PlcInteger (32 bit integer (signed)) builderReader.addItem("mivariable", "%DB20:DBD06:REAL"); //returns a PlcFloat (32 bit IEEE 754 full precision floating point value (signed)) In the "Write value" tests, write request for all datatype seem to work fine: builderWriter.addItem("mivariable", "%DB20:DBX6.1:BOOL", true); //write response code "OK" builderWriter.addItem("mivariable", "%DB20:DBB06:BYTE", 127); //write response code "OK" builderWriter.addItem("mivariable", "%DB20:DBW06:WORD", 7); //write response code "OK" builderWriter.addItem("mivariable", "%DB20:DBD06:DWORD", 1); //write response code "OK" Except for the 'INT' and 'DINT' datatypes, which return an INTERNAL_ERROR response code builderWriter.addItem("mivariable", "%DB20:DBW06:INT", 1); //write response code "INTERNAL_ERROR" builderWriter.addItem("mivariable", "%DB20:DBD06:DINT", 1); //write response code "INTERNAL_ERROR" Is the INTERNAL_ERROR code a hardware issue? (Maybe a device configuration problem?) --- Also, the other thing I found in the test: When I write a value different than BOOL, and then read the same memory address, I dont get the actual value but a 'false' filled array. TO give some examples, with BOOL values: builderWriter.addItem("mivariable", "%DB20:DBX6.1:BOOL", true); builderReader.addItem("mivariable", "%DB20:DBX6.1:BOOL"); //return true builderWriter.addItem("mivariable", "%DB20:DBX6.1:BOOL", false); builderReader.addItem("mivariable", "%DB20:DBX6.1:BOOL"); //return false The written value is "correctly updated" and read fine. with other datatypes: builderWriter.addItem("mivariable", "%DB20:DBB06:BYTE", 1);
Re: S7 write test doubt
Hi Chris, Yes, I was thinking about why those dataypes were returning a List, thanks for the explanation I tried the SINT access. For reading values works perfectly. But when writing, Im afraid I am getting the same INTERNAL_ERROR message as for INT and DINT. I will make further tests, and let you know of the progress i make. Thanks! Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Jueves, 2 de Julio 2020 16:42:16 Asunto: Re: S7 write test doubt Hi Iñigo, happy you made quite some progress. If you were asking yourself why for BYTE, WORD and DWORD the driver is returning a List ... these are considered Bit-Strings. If you want to read/write a single byte as an integer value, please use SINT instead. So regarding one of your questions ... could you instead of doing: builderWriter.addItem("mivariable", "%DB20:DBB06:BYTE", 127); Please try: builderWriter.addItem("mivariable", "%DB20:DBB06:SINT", 127); And if you're getting an INTERNAL_ERROR that's probably our fault. As I mentioned, we haven't done too much writing as no one ever uses that ;-) Chris Am 02.07.20, 15:56 schrieb "Iñigo Angulo" : Hi, I have been doing further tests with the S7 driver. I would like to ask you some doubts, which i am not sure if relate to the PLC4X driver or the actual hardware (Siemens S7-300) i am using (pretty novice in PLC data access im afraid...) The "Read value" tests I have done work correctly for different datatypes, for example: builderReader.addItem("mivariable", "%DB20:DBX5.0:BOOL"); //Single boolean value builderReader.addItem("mivariable", "%DB20:DBB06:BYTE"); //returns a PlcList (Array of 8 boolean values) builderReader.addItem("mivariable", "%DB20:DBW06:WORD"); //returns a PlcList (Array of 16 boolean values) builderReader.addItem("mivariable", "%DB20:DBD06:DWORD"); //returns a PlcList (Array of 32 boolean values) builderReader.addItem("mivariable", "%DB20:DBW06:INT"); //returns a PlcInteger (16 bit integer (signed)) builderReader.addItem("mivariable", "%DB20:DBD06:DINT"); //returns a PlcInteger (32 bit integer (signed)) builderReader.addItem("mivariable", "%DB20:DBD06:REAL"); //returns a PlcFloat (32 bit IEEE 754 full precision floating point value (signed)) In the "Write value" tests, write request for all datatype seem to work fine: builderWriter.addItem("mivariable", "%DB20:DBX6.1:BOOL", true); //write response code "OK" builderWriter.addItem("mivariable", "%DB20:DBB06:BYTE", 127); //write response code "OK" builderWriter.addItem("mivariable", "%DB20:DBW06:WORD", 7); //write response code "OK" builderWriter.addItem("mivariable", "%DB20:DBD06:DWORD", 1); //write response code "OK" Except for the 'INT' and 'DINT' datatypes, which return an INTERNAL_ERROR response code builderWriter.addItem("mivariable", "%DB20:DBW06:INT", 1); //write response code "INTERNAL_ERROR" builderWriter.addItem("mivariable", "%DB20:DBD06:DINT", 1); //write response code "INTERNAL_ERROR" Is the INTERNAL_ERROR code a hardware issue? (Maybe a device configuration problem?) --- Also, the other thing I found in the test: When I write a value different than BOOL, and then read the same memory address, I dont get the actual value but a 'false' filled array. TO give some examples, with BOOL values: builderWriter.addItem("mivariable", "%DB20:DBX6.1:BOOL", true); builderReader.addItem("mivariable", "%DB20:DBX6.1:BOOL"); //return true builderWriter.addItem("mivariable", "%DB20:DBX6.1:BOOL", false); builderReader.addItem("mivariable", "%DB20:DBX6.1:BOOL"); //return false The written value is "correctly updated" and read fine. with other datatypes: builderWriter.addItem("mivariable", "%DB20:DBB06:BYTE", 1); builderReader.addItem("mivariable", "%DB20:DBB06:BYTE"); //returns [false, false, false, false, false, false, false, false] builderWriter.addItem("mivariable", "%DB20:DBB06:BYTE", 127); builderReader
Re: S7 write test doubt
builderReader.addItem("mivariable-0", "%DB20:DBX6.0:BOOL"); //returns false builderReader.addItem("mivariable-1", "%DB20:DBX6.1:BOOL"); //returns false builderReader.addItem("mivariable-2", "%DB20:DBX6.2:BOOL"); //returns false builderReader.addItem("mivariable-3", "%DB20:DBX6.3:BOOL"); //returns false builderReader.addItem("mivariable-4", "%DB20:DBX6.4:BOOL"); //returns false builderReader.addItem("mivariable-5", "%DB20:DBX6.5:BOOL"); //returns false builderReader.addItem("mivariable-6", "%DB20:DBX6.6:BOOL"); //returns false builderReader.addItem("mivariable-7", "%DB20:DBX6.7:BOOL"); //returns false Which leads me to think that could be a write issue, right? Again I understand that these issues could be an actual hardware configuration problem.. but any help or advice would be much appreciated Thank you in advance! iñigo P.S. I attached the test classes if anyone wants to take a look. - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Iñigo Angulo Otegui" Para: "dev" Enviados: Jueves, 2 de Julio 2020 12:45:49 Asunto: Re: S7 write test doubt Hi Julian, Yes, we saw the adopters page and were thinking to contribute there. We will prepare a short text describing the work we are doing with the project and send it to you soon. Thanks iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Julian Feinauer" Para: "dev" Enviados: Jueves, 2 de Julio 2020 12:00:53 Asunto: Re: S7 write test doubt And, as i shortly checked your company profile which looks pretty cool... if you like it, or use it, dont forget to enter your company on the adopters page : ) https://plc4x.apache.org/users/adopters.html Julian Am 02.07.20, 10:31 schrieb "Iñigo Angulo" : Hi Chris, Yes, using the 0.8.0-SNAPSHOT with the update you did the problem is solved now. Thank you for the help and the fast solution! Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 13:18:34 Asunto: Re: S7 write test doubt Hi all, build passed locall, pushed the changes, build on ci passed so you should be ready to give things a new try. However keep in mind, if you built with 0.8.0-SNAPSHOT once today, please be sure to do a "mvn -U install" build or you won't get the update today. Would be cool if you could reply if this helped. Chris Am 01.07.20, 12:30 schrieb "Julian Feinauer" : Thanks both of you! As I just wrote in Slack we can only grow and improve if we get feedback, Bug reports and usage scenarios. And of course thanks Chris for that fast reply and fix <3 Julian Am 01.07.20, 12:24 schrieb "Iñigo Angulo" : Hi Chris, No problem. I will keep track of the issue in Jira, and use the 0.8.0-SNAPSHOT version. Thank you for your help iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 12:06:28 Asunto: Re: S7 write test doubt Hi Iñigo, I will have to ask you to wait for a little while as you stumbled over a problem which goes a little deeper and is related to a major refactoring we did just before Christmas. I
Re: S7 write test doubt
Hi, I have been doing further tests with the S7 driver. I would like to ask you some doubts, which i am not sure if relate to the PLC4X driver or the actual hardware (Siemens S7-300) i am using (pretty novice in PLC data access im afraid...) The "Read value" tests I have done work correctly for different datatypes, for example: builderReader.addItem("mivariable", "%DB20:DBX5.0:BOOL"); //Single boolean value builderReader.addItem("mivariable", "%DB20:DBB06:BYTE"); //returns a PlcList (Array of 8 boolean values) builderReader.addItem("mivariable", "%DB20:DBW06:WORD"); //returns a PlcList (Array of 16 boolean values) builderReader.addItem("mivariable", "%DB20:DBD06:DWORD"); //returns a PlcList (Array of 32 boolean values) builderReader.addItem("mivariable", "%DB20:DBW06:INT"); //returns a PlcInteger (16 bit integer (signed)) builderReader.addItem("mivariable", "%DB20:DBD06:DINT"); //returns a PlcInteger (32 bit integer (signed)) builderReader.addItem("mivariable", "%DB20:DBD06:REAL"); //returns a PlcFloat (32 bit IEEE 754 full precision floating point value (signed)) In the "Write value" tests, write request for all datatype seem to work fine: builderWriter.addItem("mivariable", "%DB20:DBX6.1:BOOL", true); //write response code "OK" builderWriter.addItem("mivariable", "%DB20:DBB06:BYTE", 127); //write response code "OK" builderWriter.addItem("mivariable", "%DB20:DBW06:WORD", 7); //write response code "OK" builderWriter.addItem("mivariable", "%DB20:DBD06:DWORD", 1); //write response code "OK" Except for the 'INT' and 'DINT' datatypes, which return an INTERNAL_ERROR response code builderWriter.addItem("mivariable", "%DB20:DBW06:INT", 1); //write response code "INTERNAL_ERROR" builderWriter.addItem("mivariable", "%DB20:DBD06:DINT", 1); //write response code "INTERNAL_ERROR" Is the INTERNAL_ERROR code a hardware issue? (Maybe a device configuration problem?) --- Also, the other thing I found in the test: When I write a value different than BOOL, and then read the same memory address, I dont get the actual value but a 'false' filled array. TO give some examples, with BOOL values: builderWriter.addItem("mivariable", "%DB20:DBX6.1:BOOL", true); builderReader.addItem("mivariable", "%DB20:DBX6.1:BOOL"); //return true builderWriter.addItem("mivariable", "%DB20:DBX6.1:BOOL", false); builderReader.addItem("mivariable", "%DB20:DBX6.1:BOOL"); //return false The written value is "correctly updated" and read fine. with other datatypes: builderWriter.addItem("mivariable", "%DB20:DBB06:BYTE", 1); builderReader.addItem("mivariable", "%DB20:DBB06:BYTE"); //returns [false, false, false, false, false, false, false, false] builderWriter.addItem("mivariable", "%DB20:DBB06:BYTE", 127); builderReader.addItem("mivariable", "%DB20:DBB06:BYTE"); //returns [false, false, false, false, false, false, false, false] I have tried to combine write single bits and read other datatypes, which seem to work fine: builderWriter.addItem("mivariable", "%DB20:DBX6.1:BOOL", true); builderReader.addItem("mivariable", "%DB20:DBB06:BYTE"); //returns [false, false, false, false, false, false, true, false] builderReader.addItem("mivariable", "%DB20:DBW06:INT"); //return 512 And the other way around, write a byte and read single bits builderWriter.addItem("mivariable", "%DB20:DBB06:BYTE", 127); builderReader.addItem("mivariable-0", "%DB20:DBX6.0:BOOL"); //returns false builderReader.addItem("mivariable-1", "%DB20:DBX6.1:BOOL"); //returns false builderReader.addItem("mivariable-2", "%DB20:DBX6.2:BOOL"); //returns false builderReader.addItem("mivariable-3", "%DB20:DBX6.3:BOOL"); //returns false builderReader.addItem("mivariable-4", "%DB20:DBX6.4:BOOL"); //returns false builderReader.addItem("mivariable-5", "%DB20:DBX6.5:BOOL"); //returns false builderReader.addItem("mivariable-6", "%DB20:DBX6.6:BOOL"); //returns false builderReader.addItem("mivariable-7&quo
Re: S7 write test doubt
Hi Julian, Yes, we saw the adopters page and were thinking to contribute there. We will prepare a short text describing the work we are doing with the project and send it to you soon. Thanks iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Julian Feinauer" Para: "dev" Enviados: Jueves, 2 de Julio 2020 12:00:53 Asunto: Re: S7 write test doubt And, as i shortly checked your company profile which looks pretty cool... if you like it, or use it, dont forget to enter your company on the adopters page : ) https://plc4x.apache.org/users/adopters.html Julian Am 02.07.20, 10:31 schrieb "Iñigo Angulo" : Hi Chris, Yes, using the 0.8.0-SNAPSHOT with the update you did the problem is solved now. Thank you for the help and the fast solution! Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 13:18:34 Asunto: Re: S7 write test doubt Hi all, build passed locall, pushed the changes, build on ci passed so you should be ready to give things a new try. However keep in mind, if you built with 0.8.0-SNAPSHOT once today, please be sure to do a "mvn -U install" build or you won't get the update today. Would be cool if you could reply if this helped. Chris Am 01.07.20, 12:30 schrieb "Julian Feinauer" : Thanks both of you! As I just wrote in Slack we can only grow and improve if we get feedback, Bug reports and usage scenarios. And of course thanks Chris for that fast reply and fix <3 Julian Am 01.07.20, 12:24 schrieb "Iñigo Angulo" : Hi Chris, No problem. I will keep track of the issue in Jira, and use the 0.8.0-SNAPSHOT version. Thank you for your help iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 12:06:28 Asunto: Re: S7 write test doubt Hi Iñigo, I will have to ask you to wait for a little while as you stumbled over a problem which goes a little deeper and is related to a major refactoring we did just before Christmas. I am pretty puzzled that no one ever noticed this, but I'll immediately start working on fixing this. I'm tracking progress here: https://issues.apache.org/jira/browse/PLC4X-206 If that's done I would like to ask you to use the 0.8.0-SNAPSHOT till we've released the next version of PLC4X. Chris Am 01.07.20, 12:00 schrieb "Iñigo Angulo" : Hi Chris, Thanks for the fast answer! I will keep your advice about not adding the cast to the values, and letting the driver do its work. If you want me to try to reproduce any other test just let me know. Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 11:48:48 Asunto: Re: S7 write test doubt And let me give you a little more context ... with the INT type in S7 you happen to know that there an INT is a 16 Bit signed integer. We wanted to abstract from that. Cause another PLC could define INT as 32 bit integer ... So you can generally just work with any numeric type and pass that in. The driver will inspect the value ranges for that particular protocol and give some sensible error messages (At least it should ;-) ). But ... I just noticed
Re: S7 write test doubt
And, as i shortly checked your company profile which looks pretty cool... if you like it, or use it, dont forget to enter your company on the adopters page : ) https://plc4x.apache.org/users/adopters.html Julian Am 02.07.20, 10:31 schrieb "Iñigo Angulo" : Hi Chris, Yes, using the 0.8.0-SNAPSHOT with the update you did the problem is solved now. Thank you for the help and the fast solution! Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 13:18:34 Asunto: Re: S7 write test doubt Hi all, build passed locall, pushed the changes, build on ci passed so you should be ready to give things a new try. However keep in mind, if you built with 0.8.0-SNAPSHOT once today, please be sure to do a "mvn -U install" build or you won't get the update today. Would be cool if you could reply if this helped. Chris Am 01.07.20, 12:30 schrieb "Julian Feinauer" : Thanks both of you! As I just wrote in Slack we can only grow and improve if we get feedback, Bug reports and usage scenarios. And of course thanks Chris for that fast reply and fix <3 Julian Am 01.07.20, 12:24 schrieb "Iñigo Angulo" : Hi Chris, No problem. I will keep track of the issue in Jira, and use the 0.8.0-SNAPSHOT version. Thank you for your help iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 12:06:28 Asunto: Re: S7 write test doubt Hi Iñigo, I will have to ask you to wait for a little while as you stumbled over a problem which goes a little deeper and is related to a major refactoring we did just before Christmas. I am pretty puzzled that no one ever noticed this, but I'll immediately start working on fixing this. I'm tracking progress here: https://issues.apache.org/jira/browse/PLC4X-206 If that's done I would like to ask you to use the 0.8.0-SNAPSHOT till we've released the next version of PLC4X. Chris Am 01.07.20, 12:00 schrieb "Iñigo Angulo" : Hi Chris, Thanks for the fast answer! I will keep your advice about not adding the cast to the values, and letting the driver do its work. If you want me to try to reproduce any other test just let me know. Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 11:48:48 Asunto: Re: S7 write test doubt And let me give you a little more context ... with the INT type in S7 you happen to know that there an INT is a 16 Bit signed integer. We wanted to abstract from that. Cause another PLC could define INT as 32 bit integer ... So you can generally just work with any numeric type and pass that in. The driver will inspect the value ranges for that particular protocol and give some sensible error messages (At least it should ;-) ). But ... I just noticed that indeed I am seeing the same problems you are seeing and that my suggestion just causes a different error ... I'll get working on fixing this right away. I'm really a bit confused about this ... but it does prove that most people just care about reading ;-) Will keep you and the others posted on any progress. Chris Am 01.07.20, 11:33 schrieb "Christofer Dutz" : Hi Iñigo, welcome to the party ... I really hope we'll be able to get you start
Re: S7 write test doubt
Thanks for reporting. As Julian mentioned, this is highly valuable input for us :-) Glad we could help. Chris Am 02.07.20, 10:31 schrieb "Iñigo Angulo" : Hi Chris, Yes, using the 0.8.0-SNAPSHOT with the update you did the problem is solved now. Thank you for the help and the fast solution! Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 13:18:34 Asunto: Re: S7 write test doubt Hi all, build passed locall, pushed the changes, build on ci passed so you should be ready to give things a new try. However keep in mind, if you built with 0.8.0-SNAPSHOT once today, please be sure to do a "mvn -U install" build or you won't get the update today. Would be cool if you could reply if this helped. Chris Am 01.07.20, 12:30 schrieb "Julian Feinauer" : Thanks both of you! As I just wrote in Slack we can only grow and improve if we get feedback, Bug reports and usage scenarios. And of course thanks Chris for that fast reply and fix <3 Julian Am 01.07.20, 12:24 schrieb "Iñigo Angulo" : Hi Chris, No problem. I will keep track of the issue in Jira, and use the 0.8.0-SNAPSHOT version. Thank you for your help iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 12:06:28 Asunto: Re: S7 write test doubt Hi Iñigo, I will have to ask you to wait for a little while as you stumbled over a problem which goes a little deeper and is related to a major refactoring we did just before Christmas. I am pretty puzzled that no one ever noticed this, but I'll immediately start working on fixing this. I'm tracking progress here: https://issues.apache.org/jira/browse/PLC4X-206 If that's done I would like to ask you to use the 0.8.0-SNAPSHOT till we've released the next version of PLC4X. Chris Am 01.07.20, 12:00 schrieb "Iñigo Angulo" : Hi Chris, Thanks for the fast answer! I will keep your advice about not adding the cast to the values, and letting the driver do its work. If you want me to try to reproduce any other test just let me know. Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 11:48:48 Asunto: Re: S7 write test doubt And let me give you a little more context ... with the INT type in S7 you happen to know that there an INT is a 16 Bit signed integer. We wanted to abstract from that. Cause another PLC could define INT as 32 bit integer ... So you can generally just work with any numeric type and pass that in. The driver will inspect the value ranges for that particular protocol and give some sensible error messages (At least it should ;-) ). But ... I just noticed that indeed I am seeing the same problems you are seeing and that my suggestion just causes a different error ... I'll get working on fixing this right away. I'm really a bit confused about this ... but it does prove that most people just care about reading ;-) Will keep you and the others posted on any progress. Chris Am 01.07.20, 11:33 schrieb "Christofer Dutz" : Hi Iñigo, welcome to the party ... I really hope we'll be able to get you started asap ... I just had a look at the code and PlcInteger does have the constructor ...
Re: S7 write test doubt
Hi Chris, Yes, using the 0.8.0-SNAPSHOT with the update you did the problem is solved now. Thank you for the help and the fast solution! Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 13:18:34 Asunto: Re: S7 write test doubt Hi all, build passed locall, pushed the changes, build on ci passed so you should be ready to give things a new try. However keep in mind, if you built with 0.8.0-SNAPSHOT once today, please be sure to do a "mvn -U install" build or you won't get the update today. Would be cool if you could reply if this helped. Chris Am 01.07.20, 12:30 schrieb "Julian Feinauer" : Thanks both of you! As I just wrote in Slack we can only grow and improve if we get feedback, Bug reports and usage scenarios. And of course thanks Chris for that fast reply and fix <3 Julian Am 01.07.20, 12:24 schrieb "Iñigo Angulo" : Hi Chris, No problem. I will keep track of the issue in Jira, and use the 0.8.0-SNAPSHOT version. Thank you for your help iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 12:06:28 Asunto: Re: S7 write test doubt Hi Iñigo, I will have to ask you to wait for a little while as you stumbled over a problem which goes a little deeper and is related to a major refactoring we did just before Christmas. I am pretty puzzled that no one ever noticed this, but I'll immediately start working on fixing this. I'm tracking progress here: https://issues.apache.org/jira/browse/PLC4X-206 If that's done I would like to ask you to use the 0.8.0-SNAPSHOT till we've released the next version of PLC4X. Chris Am 01.07.20, 12:00 schrieb "Iñigo Angulo" : Hi Chris, Thanks for the fast answer! I will keep your advice about not adding the cast to the values, and letting the driver do its work. If you want me to try to reproduce any other test just let me know. Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 11:48:48 Asunto: Re: S7 write test doubt And let me give you a little more context ... with the INT type in S7 you happen to know that there an INT is a 16 Bit signed integer. We wanted to abstract from that. Cause another PLC could define INT as 32 bit integer ... So you can generally just work with any numeric type and pass that in. The driver will inspect the value ranges for that particular protocol and give some sensible error messages (At least it should ;-) ). But ... I just noticed that indeed I am seeing the same problems you are seeing and that my suggestion just causes a different error ... I'll get working on fixing this right away. I'm really a bit confused about this ... but it does prove that most people just care about reading ;-) Will keep you and the others posted on any progress. Chris Am 01.07.20, 11:33 schrieb "Christofer Dutz" : Hi Iñigo, welcome to the party ... I really hope we'll be able to get you started asap ... I just had a look at the code and PlcInteger does have the constructor ... public PlcInteger(Short value) { super(value.intValue(), true); } So I'll try to reproduce the problem ... but for now ... could you just remove the cast from your items? builderWriter.addItem("mivariable-1", "%DB20:DBX6.7:BOOL", true); builderWriter.addItem("mivariable-4", "%DB20:DBW06.0:INT", 2); builderWriter
Re: S7 write test doubt
Hi all, build passed locall, pushed the changes, build on ci passed so you should be ready to give things a new try. However keep in mind, if you built with 0.8.0-SNAPSHOT once today, please be sure to do a "mvn -U install" build or you won't get the update today. Would be cool if you could reply if this helped. Chris Am 01.07.20, 12:30 schrieb "Julian Feinauer" : Thanks both of you! As I just wrote in Slack we can only grow and improve if we get feedback, Bug reports and usage scenarios. And of course thanks Chris for that fast reply and fix <3 Julian Am 01.07.20, 12:24 schrieb "Iñigo Angulo" : Hi Chris, No problem. I will keep track of the issue in Jira, and use the 0.8.0-SNAPSHOT version. Thank you for your help iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 12:06:28 Asunto: Re: S7 write test doubt Hi Iñigo, I will have to ask you to wait for a little while as you stumbled over a problem which goes a little deeper and is related to a major refactoring we did just before Christmas. I am pretty puzzled that no one ever noticed this, but I'll immediately start working on fixing this. I'm tracking progress here: https://issues.apache.org/jira/browse/PLC4X-206 If that's done I would like to ask you to use the 0.8.0-SNAPSHOT till we've released the next version of PLC4X. Chris Am 01.07.20, 12:00 schrieb "Iñigo Angulo" : Hi Chris, Thanks for the fast answer! I will keep your advice about not adding the cast to the values, and letting the driver do its work. If you want me to try to reproduce any other test just let me know. Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 11:48:48 Asunto: Re: S7 write test doubt And let me give you a little more context ... with the INT type in S7 you happen to know that there an INT is a 16 Bit signed integer. We wanted to abstract from that. Cause another PLC could define INT as 32 bit integer ... So you can generally just work with any numeric type and pass that in. The driver will inspect the value ranges for that particular protocol and give some sensible error messages (At least it should ;-) ). But ... I just noticed that indeed I am seeing the same problems you are seeing and that my suggestion just causes a different error ... I'll get working on fixing this right away. I'm really a bit confused about this ... but it does prove that most people just care about reading ;-) Will keep you and the others posted on any progress. Chris Am 01.07.20, 11:33 schrieb "Christofer Dutz" : Hi Iñigo, welcome to the party ... I really hope we'll be able to get you started asap ... I just had a look at the code and PlcInteger does have the constructor ... public PlcInteger(Short value) { super(value.intValue(), true); } So I'll try to reproduce the problem ... but for now ... could you just remove the cast from your items? builderWriter.addItem("mivariable-1", "%DB20:DBX6.7:BOOL", true); builderWriter.addItem("mivariable-4", "%DB20:DBW06.0:INT", 2); builderWriter.addItem("mivariable-2", "%DB20:DBB06:BYTE", 0); Cause PLC4X internally already ensures everything fits into the bounds and internally PLC4X handles the "(short) 2" as an "(int) 2" anyway ;-) Chris Am 01.07.20, 11:19 schrieb "Iñigo Angulo" : Hi, I started doing some basic tests with the S7 protocol using a Siemens S7-300, and the latest 0.7.0 release. The tests consist of reading and
Re: S7 write test doubt
Thanks both of you! As I just wrote in Slack we can only grow and improve if we get feedback, Bug reports and usage scenarios. And of course thanks Chris for that fast reply and fix <3 Julian Am 01.07.20, 12:24 schrieb "Iñigo Angulo" : Hi Chris, No problem. I will keep track of the issue in Jira, and use the 0.8.0-SNAPSHOT version. Thank you for your help iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 12:06:28 Asunto: Re: S7 write test doubt Hi Iñigo, I will have to ask you to wait for a little while as you stumbled over a problem which goes a little deeper and is related to a major refactoring we did just before Christmas. I am pretty puzzled that no one ever noticed this, but I'll immediately start working on fixing this. I'm tracking progress here: https://issues.apache.org/jira/browse/PLC4X-206 If that's done I would like to ask you to use the 0.8.0-SNAPSHOT till we've released the next version of PLC4X. Chris Am 01.07.20, 12:00 schrieb "Iñigo Angulo" : Hi Chris, Thanks for the fast answer! I will keep your advice about not adding the cast to the values, and letting the driver do its work. If you want me to try to reproduce any other test just let me know. Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 11:48:48 Asunto: Re: S7 write test doubt And let me give you a little more context ... with the INT type in S7 you happen to know that there an INT is a 16 Bit signed integer. We wanted to abstract from that. Cause another PLC could define INT as 32 bit integer ... So you can generally just work with any numeric type and pass that in. The driver will inspect the value ranges for that particular protocol and give some sensible error messages (At least it should ;-) ). But ... I just noticed that indeed I am seeing the same problems you are seeing and that my suggestion just causes a different error ... I'll get working on fixing this right away. I'm really a bit confused about this ... but it does prove that most people just care about reading ;-) Will keep you and the others posted on any progress. Chris Am 01.07.20, 11:33 schrieb "Christofer Dutz" : Hi Iñigo, welcome to the party ... I really hope we'll be able to get you started asap ... I just had a look at the code and PlcInteger does have the constructor ... public PlcInteger(Short value) { super(value.intValue(), true); } So I'll try to reproduce the problem ... but for now ... could you just remove the cast from your items? builderWriter.addItem("mivariable-1", "%DB20:DBX6.7:BOOL", true); builderWriter.addItem("mivariable-4", "%DB20:DBW06.0:INT", 2); builderWriter.addItem("mivariable-2", "%DB20:DBB06:BYTE", 0); Cause PLC4X internally already ensures everything fits into the bounds and internally PLC4X handles the "(short) 2" as an "(int) 2" anyway ;-) Chris Am 01.07.20, 11:19 schrieb "Iñigo Angulo" : Hi, I started doing some basic tests with the S7 protocol using a Siemens S7-300, and the latest 0.7.0 release. The tests consist of reading and writing several DB variables. I was able to read different datatypes, for instance: builder.addItem("mivariable-1", "%DB20:DBX05.0:BOOL"); builder.addItem("mivariable-4", "%DB20:DBW06:INT"); However, when I try to write the same memory addresses I only manage to write BOOL values, for example builderWriter.addItem("mivariable-1", "%DB20:DBX6.7:BOOL", true); //WORKS OK builderWriter.addItem("mivariable-4", "%DB20:DBW06.0:INT", (short)2); // FAILS builderWriter.addItem("mivariab
Re: S7 write test doubt
Hi Iñigo, so I think I've sorted it out and am currently running the full build with tests (obviously we need some more tests). As soon as that passes, I'll commit the changes and as soon as our Jenkins is done with building, you should have an updated 0.8.0-SNAPSHOT at your disposal. Chris Am 01.07.20, 12:24 schrieb "Iñigo Angulo" : Hi Chris, No problem. I will keep track of the issue in Jira, and use the 0.8.0-SNAPSHOT version. Thank you for your help iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 12:06:28 Asunto: Re: S7 write test doubt Hi Iñigo, I will have to ask you to wait for a little while as you stumbled over a problem which goes a little deeper and is related to a major refactoring we did just before Christmas. I am pretty puzzled that no one ever noticed this, but I'll immediately start working on fixing this. I'm tracking progress here: https://issues.apache.org/jira/browse/PLC4X-206 If that's done I would like to ask you to use the 0.8.0-SNAPSHOT till we've released the next version of PLC4X. Chris Am 01.07.20, 12:00 schrieb "Iñigo Angulo" : Hi Chris, Thanks for the fast answer! I will keep your advice about not adding the cast to the values, and letting the driver do its work. If you want me to try to reproduce any other test just let me know. Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 11:48:48 Asunto: Re: S7 write test doubt And let me give you a little more context ... with the INT type in S7 you happen to know that there an INT is a 16 Bit signed integer. We wanted to abstract from that. Cause another PLC could define INT as 32 bit integer ... So you can generally just work with any numeric type and pass that in. The driver will inspect the value ranges for that particular protocol and give some sensible error messages (At least it should ;-) ). But ... I just noticed that indeed I am seeing the same problems you are seeing and that my suggestion just causes a different error ... I'll get working on fixing this right away. I'm really a bit confused about this ... but it does prove that most people just care about reading ;-) Will keep you and the others posted on any progress. Chris Am 01.07.20, 11:33 schrieb "Christofer Dutz" : Hi Iñigo, welcome to the party ... I really hope we'll be able to get you started asap ... I just had a look at the code and PlcInteger does have the constructor ... public PlcInteger(Short value) { super(value.intValue(), true); } So I'll try to reproduce the problem ... but for now ... could you just remove the cast from your items? builderWriter.addItem("mivariable-1", "%DB20:DBX6.7:BOOL", true); builderWriter.addItem("mivariable-4", "%DB20:DBW06.0:INT", 2); builderWriter.addItem("mivariable-2", "%DB20:DBB06:BYTE", 0); Cause PLC4X internally already ensures everything fits into the bounds and internally PLC4X handles the "(short) 2" as an "(int) 2" anyway ;-) Chris Am 01.07.20, 11:19 schrieb "Iñigo Angulo" : Hi, I started doing some basic tests with the S7 protocol using a Siemens S7-300, and the latest 0.7.0 release. The tests consist of reading and writing several DB variables. I was able to read different datatypes, for instance: builder.addItem("mivariable-1", "%DB20:DBX05.0:BOOL"); builder.addItem("mivariable-4", "%DB20:DBW06:INT"); However, when I try to write the same memory addresses I only manage to write BOOL values, for example builderWriter.addItem("mivariable-1", "%DB20:DBX6.7:BOOL", true); //WORKS OK builderWriter.addItem("mivaria
Re: S7 write test doubt
Hi Chris, No problem. I will keep track of the issue in Jira, and use the 0.8.0-SNAPSHOT version. Thank you for your help iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 12:06:28 Asunto: Re: S7 write test doubt Hi Iñigo, I will have to ask you to wait for a little while as you stumbled over a problem which goes a little deeper and is related to a major refactoring we did just before Christmas. I am pretty puzzled that no one ever noticed this, but I'll immediately start working on fixing this. I'm tracking progress here: https://issues.apache.org/jira/browse/PLC4X-206 If that's done I would like to ask you to use the 0.8.0-SNAPSHOT till we've released the next version of PLC4X. Chris Am 01.07.20, 12:00 schrieb "Iñigo Angulo" : Hi Chris, Thanks for the fast answer! I will keep your advice about not adding the cast to the values, and letting the driver do its work. If you want me to try to reproduce any other test just let me know. Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 11:48:48 Asunto: Re: S7 write test doubt And let me give you a little more context ... with the INT type in S7 you happen to know that there an INT is a 16 Bit signed integer. We wanted to abstract from that. Cause another PLC could define INT as 32 bit integer ... So you can generally just work with any numeric type and pass that in. The driver will inspect the value ranges for that particular protocol and give some sensible error messages (At least it should ;-) ). But ... I just noticed that indeed I am seeing the same problems you are seeing and that my suggestion just causes a different error ... I'll get working on fixing this right away. I'm really a bit confused about this ... but it does prove that most people just care about reading ;-) Will keep you and the others posted on any progress. Chris Am 01.07.20, 11:33 schrieb "Christofer Dutz" : Hi Iñigo, welcome to the party ... I really hope we'll be able to get you started asap ... I just had a look at the code and PlcInteger does have the constructor ... public PlcInteger(Short value) { super(value.intValue(), true); } So I'll try to reproduce the problem ... but for now ... could you just remove the cast from your items? builderWriter.addItem("mivariable-1", "%DB20:DBX6.7:BOOL", true); builderWriter.addItem("mivariable-4", "%DB20:DBW06.0:INT", 2); builderWriter.addItem("mivariable-2", "%DB20:DBB06:BYTE", 0); Cause PLC4X internally already ensures everything fits into the bounds and internally PLC4X handles the "(short) 2" as an "(int) 2" anyway ;-) Chris Am 01.07.20, 11:19 schrieb "Iñigo Angulo" : Hi, I started doing some basic tests with the S7 protocol using a Siemens S7-300, and the latest 0.7.0 release. The tests consist of reading and writing several DB variables. I was able to read different datatypes, for instance: builder.addItem("mivariable-1", "%DB20:DBX05.0:BOOL"); builder.addItem("mivariable-4", "%DB20:DBW06:INT"); However, when I try to write the same memory addresses I only manage to write BOOL values, for example builderWriter.addItem("mivariable-1", "%DB20:DBX6.7:BOOL", true); //WORKS OK builderWriter.addItem("mivariable-4", "%DB20:DBW06.0:INT", (short)2); // FAILS builderWriter.addItem("mivariable-2", "%DB20:DBB06:BYTE", (byte)0); // FAILS I am unable to write any datatype different than BOOL. I am facing the following Error message: Exception in thread "main" org.apache.plc4x.java.api.exceptions.PlcRuntimeException: Error initializing field class PlcInteger at org.apache.plc4x.java.s7.readwrite.field.S7PlcFieldHandler.internalEncodeInteger(S7PlcFieldHandler.java:394) at org.apache.plc4x.
Re: S7 write test doubt
Hi Iñigo, I will have to ask you to wait for a little while as you stumbled over a problem which goes a little deeper and is related to a major refactoring we did just before Christmas. I am pretty puzzled that no one ever noticed this, but I'll immediately start working on fixing this. I'm tracking progress here: https://issues.apache.org/jira/browse/PLC4X-206 If that's done I would like to ask you to use the 0.8.0-SNAPSHOT till we've released the next version of PLC4X. Chris Am 01.07.20, 12:00 schrieb "Iñigo Angulo" : Hi Chris, Thanks for the fast answer! I will keep your advice about not adding the cast to the values, and letting the driver do its work. If you want me to try to reproduce any other test just let me know. Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 11:48:48 Asunto: Re: S7 write test doubt And let me give you a little more context ... with the INT type in S7 you happen to know that there an INT is a 16 Bit signed integer. We wanted to abstract from that. Cause another PLC could define INT as 32 bit integer ... So you can generally just work with any numeric type and pass that in. The driver will inspect the value ranges for that particular protocol and give some sensible error messages (At least it should ;-) ). But ... I just noticed that indeed I am seeing the same problems you are seeing and that my suggestion just causes a different error ... I'll get working on fixing this right away. I'm really a bit confused about this ... but it does prove that most people just care about reading ;-) Will keep you and the others posted on any progress. Chris Am 01.07.20, 11:33 schrieb "Christofer Dutz" : Hi Iñigo, welcome to the party ... I really hope we'll be able to get you started asap ... I just had a look at the code and PlcInteger does have the constructor ... public PlcInteger(Short value) { super(value.intValue(), true); } So I'll try to reproduce the problem ... but for now ... could you just remove the cast from your items? builderWriter.addItem("mivariable-1", "%DB20:DBX6.7:BOOL", true); builderWriter.addItem("mivariable-4", "%DB20:DBW06.0:INT", 2); builderWriter.addItem("mivariable-2", "%DB20:DBB06:BYTE", 0); Cause PLC4X internally already ensures everything fits into the bounds and internally PLC4X handles the "(short) 2" as an "(int) 2" anyway ;-) Chris Am 01.07.20, 11:19 schrieb "Iñigo Angulo" : Hi, I started doing some basic tests with the S7 protocol using a Siemens S7-300, and the latest 0.7.0 release. The tests consist of reading and writing several DB variables. I was able to read different datatypes, for instance: builder.addItem("mivariable-1", "%DB20:DBX05.0:BOOL"); builder.addItem("mivariable-4", "%DB20:DBW06:INT"); However, when I try to write the same memory addresses I only manage to write BOOL values, for example builderWriter.addItem("mivariable-1", "%DB20:DBX6.7:BOOL", true); //WORKS OK builderWriter.addItem("mivariable-4", "%DB20:DBW06.0:INT", (short)2); // FAILS builderWriter.addItem("mivariable-2", "%DB20:DBB06:BYTE", (byte)0); // FAILS I am unable to write any datatype different than BOOL. I am facing the following Error message: Exception in thread "main" org.apache.plc4x.java.api.exceptions.PlcRuntimeException: Error initializing field class PlcInteger at org.apache.plc4x.java.s7.readwrite.field.S7PlcFieldHandler.internalEncodeInteger(S7PlcFieldHandler.java:394) at org.apache.plc4x.java.s7.readwrite.field.S7PlcFieldHandler.encodeShort(S7PlcFieldHandler.java:86) at org.apache.plc4x.java.spi.messages.DefaultPlcWriteRequest$Builder.lambda$build$0(DefaultPlcWriteRequest.java:270) at java.base/java.util.TreeMap.forEach(TreeMap.java:1002) at org.apache.plc4x.java.spi.messages.DefaultPlcWriteRequest$Builder.build(DefaultPlcWriteRequest.java:265) at net.zylk.plc4x.test.protocols.WriteS7.main(WriteS7.java:102) Caused by: java.lang.NoSuchM
Re: S7 write test doubt
Hi Chris, Thanks for the fast answer! I will keep your advice about not adding the cast to the values, and letting the driver do its work. If you want me to try to reproduce any other test just let me know. Iñigo - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 - - Mensaje original - De: "Christofer Dutz" Para: "dev" Enviados: Miércoles, 1 de Julio 2020 11:48:48 Asunto: Re: S7 write test doubt And let me give you a little more context ... with the INT type in S7 you happen to know that there an INT is a 16 Bit signed integer. We wanted to abstract from that. Cause another PLC could define INT as 32 bit integer ... So you can generally just work with any numeric type and pass that in. The driver will inspect the value ranges for that particular protocol and give some sensible error messages (At least it should ;-) ). But ... I just noticed that indeed I am seeing the same problems you are seeing and that my suggestion just causes a different error ... I'll get working on fixing this right away. I'm really a bit confused about this ... but it does prove that most people just care about reading ;-) Will keep you and the others posted on any progress. Chris Am 01.07.20, 11:33 schrieb "Christofer Dutz" : Hi Iñigo, welcome to the party ... I really hope we'll be able to get you started asap ... I just had a look at the code and PlcInteger does have the constructor ... public PlcInteger(Short value) { super(value.intValue(), true); } So I'll try to reproduce the problem ... but for now ... could you just remove the cast from your items? builderWriter.addItem("mivariable-1", "%DB20:DBX6.7:BOOL", true); builderWriter.addItem("mivariable-4", "%DB20:DBW06.0:INT", 2); builderWriter.addItem("mivariable-2", "%DB20:DBB06:BYTE", 0); Cause PLC4X internally already ensures everything fits into the bounds and internally PLC4X handles the "(short) 2" as an "(int) 2" anyway ;-) Chris Am 01.07.20, 11:19 schrieb "Iñigo Angulo" : Hi, I started doing some basic tests with the S7 protocol using a Siemens S7-300, and the latest 0.7.0 release. The tests consist of reading and writing several DB variables. I was able to read different datatypes, for instance: builder.addItem("mivariable-1", "%DB20:DBX05.0:BOOL"); builder.addItem("mivariable-4", "%DB20:DBW06:INT"); However, when I try to write the same memory addresses I only manage to write BOOL values, for example builderWriter.addItem("mivariable-1", "%DB20:DBX6.7:BOOL", true); //WORKS OK builderWriter.addItem("mivariable-4", "%DB20:DBW06.0:INT", (short)2); // FAILS builderWriter.addItem("mivariable-2", "%DB20:DBB06:BYTE", (byte)0); // FAILS I am unable to write any datatype different than BOOL. I am facing the following Error message: Exception in thread "main" org.apache.plc4x.java.api.exceptions.PlcRuntimeException: Error initializing field class PlcInteger at org.apache.plc4x.java.s7.readwrite.field.S7PlcFieldHandler.internalEncodeInteger(S7PlcFieldHandler.java:394) at org.apache.plc4x.java.s7.readwrite.field.S7PlcFieldHandler.encodeShort(S7PlcFieldHandler.java:86) at org.apache.plc4x.java.spi.messages.DefaultPlcWriteRequest$Builder.lambda$build$0(DefaultPlcWriteRequest.java:270) at java.base/java.util.TreeMap.forEach(TreeMap.java:1002) at org.apache.plc4x.java.spi.messages.DefaultPlcWriteRequest$Builder.build(DefaultPlcWriteRequest.java:265) at net.zylk.plc4x.test.protocols.WriteS7.main(WriteS7.java:102) Caused by: java.lang.NoSuchMethodException: org.apache.plc4x.java.api.value.PlcInteger.([Ljava.lang.Short;) at java.base/java.lang.Class.getConstructor0(Class.java:3349) at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2553) at org.apache.plc4x.java.s7.readwrite.field.S7PlcFieldHandler.internalEncodeInteger(S7PlcFieldHandler.java:392) ... 5 more Maybe I am misunderstanding the sintax and how the values should be written? --- To try to offer some more information about this error: Digging into that class (S7PlcFieldHandler) I saw that there are some fields that are initialized based on the value of the datatype case INT: minValue = BigInteger.valueOf(Short.MIN_VALUE); maxValue = BigInteger.valueOf(Short.MAX_VALUE); fieldT
Re: S7 write test doubt
And let me give you a little more context ... with the INT type in S7 you happen to know that there an INT is a 16 Bit signed integer. We wanted to abstract from that. Cause another PLC could define INT as 32 bit integer ... So you can generally just work with any numeric type and pass that in. The driver will inspect the value ranges for that particular protocol and give some sensible error messages (At least it should ;-) ). But ... I just noticed that indeed I am seeing the same problems you are seeing and that my suggestion just causes a different error ... I'll get working on fixing this right away. I'm really a bit confused about this ... but it does prove that most people just care about reading ;-) Will keep you and the others posted on any progress. Chris Am 01.07.20, 11:33 schrieb "Christofer Dutz" : Hi Iñigo, welcome to the party ... I really hope we'll be able to get you started asap ... I just had a look at the code and PlcInteger does have the constructor ... public PlcInteger(Short value) { super(value.intValue(), true); } So I'll try to reproduce the problem ... but for now ... could you just remove the cast from your items? builderWriter.addItem("mivariable-1", "%DB20:DBX6.7:BOOL", true); builderWriter.addItem("mivariable-4", "%DB20:DBW06.0:INT", 2); builderWriter.addItem("mivariable-2", "%DB20:DBB06:BYTE", 0); Cause PLC4X internally already ensures everything fits into the bounds and internally PLC4X handles the "(short) 2" as an "(int) 2" anyway ;-) Chris Am 01.07.20, 11:19 schrieb "Iñigo Angulo" : Hi, I started doing some basic tests with the S7 protocol using a Siemens S7-300, and the latest 0.7.0 release. The tests consist of reading and writing several DB variables. I was able to read different datatypes, for instance: builder.addItem("mivariable-1", "%DB20:DBX05.0:BOOL"); builder.addItem("mivariable-4", "%DB20:DBW06:INT"); However, when I try to write the same memory addresses I only manage to write BOOL values, for example builderWriter.addItem("mivariable-1", "%DB20:DBX6.7:BOOL", true); //WORKS OK builderWriter.addItem("mivariable-4", "%DB20:DBW06.0:INT", (short)2); // FAILS builderWriter.addItem("mivariable-2", "%DB20:DBB06:BYTE", (byte)0); // FAILS I am unable to write any datatype different than BOOL. I am facing the following Error message: Exception in thread "main" org.apache.plc4x.java.api.exceptions.PlcRuntimeException: Error initializing field class PlcInteger at org.apache.plc4x.java.s7.readwrite.field.S7PlcFieldHandler.internalEncodeInteger(S7PlcFieldHandler.java:394) at org.apache.plc4x.java.s7.readwrite.field.S7PlcFieldHandler.encodeShort(S7PlcFieldHandler.java:86) at org.apache.plc4x.java.spi.messages.DefaultPlcWriteRequest$Builder.lambda$build$0(DefaultPlcWriteRequest.java:270) at java.base/java.util.TreeMap.forEach(TreeMap.java:1002) at org.apache.plc4x.java.spi.messages.DefaultPlcWriteRequest$Builder.build(DefaultPlcWriteRequest.java:265) at net.zylk.plc4x.test.protocols.WriteS7.main(WriteS7.java:102) Caused by: java.lang.NoSuchMethodException: org.apache.plc4x.java.api.value.PlcInteger.([Ljava.lang.Short;) at java.base/java.lang.Class.getConstructor0(Class.java:3349) at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2553) at org.apache.plc4x.java.s7.readwrite.field.S7PlcFieldHandler.internalEncodeInteger(S7PlcFieldHandler.java:392) ... 5 more Maybe I am misunderstanding the sintax and how the values should be written? --- To try to offer some more information about this error: Digging into that class (S7PlcFieldHandler) I saw that there are some fields that are initialized based on the value of the datatype case INT: minValue = BigInteger.valueOf(Short.MIN_VALUE); maxValue = BigInteger.valueOf(Short.MAX_VALUE); fieldType = PlcInteger.class; valueType = Short[].class; castedValues = new Short[values.length]; break; Then, the line that throws the Exception seems to be trying to inferr a PlcInteger class constructor based on the datatype // Create the field item. try { return fieldType.getDeclaredConstructor(valueType).newInstance(castedValues); } catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { throw new PlcRuntimeException("Error initializing field class " + fieldType.getSimpleName(), e); } However there appears to be a "mismatch" between the valueType (Short[]) and the constructor (Short) in the PlcInteger class, which leads me to think i am missing something on the write valu
Re: S7 write test doubt
Hi Iñigo, welcome to the party ... I really hope we'll be able to get you started asap ... I just had a look at the code and PlcInteger does have the constructor ... public PlcInteger(Short value) { super(value.intValue(), true); } So I'll try to reproduce the problem ... but for now ... could you just remove the cast from your items? builderWriter.addItem("mivariable-1", "%DB20:DBX6.7:BOOL", true); builderWriter.addItem("mivariable-4", "%DB20:DBW06.0:INT", 2); builderWriter.addItem("mivariable-2", "%DB20:DBB06:BYTE", 0); Cause PLC4X internally already ensures everything fits into the bounds and internally PLC4X handles the "(short) 2" as an "(int) 2" anyway ;-) Chris Am 01.07.20, 11:19 schrieb "Iñigo Angulo" : Hi, I started doing some basic tests with the S7 protocol using a Siemens S7-300, and the latest 0.7.0 release. The tests consist of reading and writing several DB variables. I was able to read different datatypes, for instance: builder.addItem("mivariable-1", "%DB20:DBX05.0:BOOL"); builder.addItem("mivariable-4", "%DB20:DBW06:INT"); However, when I try to write the same memory addresses I only manage to write BOOL values, for example builderWriter.addItem("mivariable-1", "%DB20:DBX6.7:BOOL", true); //WORKS OK builderWriter.addItem("mivariable-4", "%DB20:DBW06.0:INT", (short)2); // FAILS builderWriter.addItem("mivariable-2", "%DB20:DBB06:BYTE", (byte)0); // FAILS I am unable to write any datatype different than BOOL. I am facing the following Error message: Exception in thread "main" org.apache.plc4x.java.api.exceptions.PlcRuntimeException: Error initializing field class PlcInteger at org.apache.plc4x.java.s7.readwrite.field.S7PlcFieldHandler.internalEncodeInteger(S7PlcFieldHandler.java:394) at org.apache.plc4x.java.s7.readwrite.field.S7PlcFieldHandler.encodeShort(S7PlcFieldHandler.java:86) at org.apache.plc4x.java.spi.messages.DefaultPlcWriteRequest$Builder.lambda$build$0(DefaultPlcWriteRequest.java:270) at java.base/java.util.TreeMap.forEach(TreeMap.java:1002) at org.apache.plc4x.java.spi.messages.DefaultPlcWriteRequest$Builder.build(DefaultPlcWriteRequest.java:265) at net.zylk.plc4x.test.protocols.WriteS7.main(WriteS7.java:102) Caused by: java.lang.NoSuchMethodException: org.apache.plc4x.java.api.value.PlcInteger.([Ljava.lang.Short;) at java.base/java.lang.Class.getConstructor0(Class.java:3349) at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2553) at org.apache.plc4x.java.s7.readwrite.field.S7PlcFieldHandler.internalEncodeInteger(S7PlcFieldHandler.java:392) ... 5 more Maybe I am misunderstanding the sintax and how the values should be written? --- To try to offer some more information about this error: Digging into that class (S7PlcFieldHandler) I saw that there are some fields that are initialized based on the value of the datatype case INT: minValue = BigInteger.valueOf(Short.MIN_VALUE); maxValue = BigInteger.valueOf(Short.MAX_VALUE); fieldType = PlcInteger.class; valueType = Short[].class; castedValues = new Short[values.length]; break; Then, the line that throws the Exception seems to be trying to inferr a PlcInteger class constructor based on the datatype // Create the field item. try { return fieldType.getDeclaredConstructor(valueType).newInstance(castedValues); } catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { throw new PlcRuntimeException("Error initializing field class " + fieldType.getSimpleName(), e); } However there appears to be a "mismatch" between the valueType (Short[]) and the constructor (Short) in the PlcInteger class, which leads me to think i am missing something on the write value sintax? Thank you in advance, any help will be welcome. Iñigo - the test class code: public class WriteS7 { private static final Logger _log = LoggerFactory.getLogger(WriteS7.class); public static void main(String[] args) throws PlcConnectionException { String connectionString = "s7://10.105.143.1:102?remote-rack=0&remote-slot=0&controller-type=S7_300"; _log.info(String.format("Establishing connection to %s", connectionString));; try (PlcConnection plcConnection = new PlcDriverManager().getConnection(connectionString)) { _log.info("Conecting... " + connectionString); if (!plcConnection.getMetadata().canWrite()) { _log.error(String.format("Connection %s doesn't support writing.", connectionString)); return; } PlcWriteRequest.Builder builderWriter = null; builderWriter = plcConnection.writeRequestBuilder(); // builderWriter.addItem("mivariable-26", "%DB20:DBX6.7:BOOL", false); //OK builderWriter.addItem("mivariable-2", "%DB20:
S7 write test doubt
Hi, I started doing some basic tests with the S7 protocol using a Siemens S7-300, and the latest 0.7.0 release. The tests consist of reading and writing several DB variables. I was able to read different datatypes, for instance: builder.addItem("mivariable-1", "%DB20:DBX05.0:BOOL"); builder.addItem("mivariable-4", "%DB20:DBW06:INT"); However, when I try to write the same memory addresses I only manage to write BOOL values, for example builderWriter.addItem("mivariable-1", "%DB20:DBX6.7:BOOL", true); //WORKS OK builderWriter.addItem("mivariable-4", "%DB20:DBW06.0:INT", (short)2); // FAILS builderWriter.addItem("mivariable-2", "%DB20:DBB06:BYTE", (byte)0); // FAILS I am unable to write any datatype different than BOOL. I am facing the following Error message: Exception in thread "main" org.apache.plc4x.java.api.exceptions.PlcRuntimeException: Error initializing field class PlcInteger at org.apache.plc4x.java.s7.readwrite.field.S7PlcFieldHandler.internalEncodeInteger(S7PlcFieldHandler.java:394) at org.apache.plc4x.java.s7.readwrite.field.S7PlcFieldHandler.encodeShort(S7PlcFieldHandler.java:86) at org.apache.plc4x.java.spi.messages.DefaultPlcWriteRequest$Builder.lambda$build$0(DefaultPlcWriteRequest.java:270) at java.base/java.util.TreeMap.forEach(TreeMap.java:1002) at org.apache.plc4x.java.spi.messages.DefaultPlcWriteRequest$Builder.build(DefaultPlcWriteRequest.java:265) at net.zylk.plc4x.test.protocols.WriteS7.main(WriteS7.java:102) Caused by: java.lang.NoSuchMethodException: org.apache.plc4x.java.api.value.PlcInteger.([Ljava.lang.Short;) at java.base/java.lang.Class.getConstructor0(Class.java:3349) at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2553) at org.apache.plc4x.java.s7.readwrite.field.S7PlcFieldHandler.internalEncodeInteger(S7PlcFieldHandler.java:392) ... 5 more Maybe I am misunderstanding the sintax and how the values should be written? --- To try to offer some more information about this error: Digging into that class (S7PlcFieldHandler) I saw that there are some fields that are initialized based on the value of the datatype case INT: minValue = BigInteger.valueOf(Short.MIN_VALUE); maxValue = BigInteger.valueOf(Short.MAX_VALUE); fieldType = PlcInteger.class; valueType = Short[].class; castedValues = new Short[values.length]; break; Then, the line that throws the Exception seems to be trying to inferr a PlcInteger class constructor based on the datatype // Create the field item. try { return fieldType.getDeclaredConstructor(valueType).newInstance(castedValues); } catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { throw new PlcRuntimeException("Error initializing field class " + fieldType.getSimpleName(), e); } However there appears to be a "mismatch" between the valueType (Short[]) and the constructor (Short) in the PlcInteger class, which leads me to think i am missing something on the write value sintax? Thank you in advance, any help will be welcome. Iñigo - the test class code: public class WriteS7 { private static final Logger _log = LoggerFactory.getLogger(WriteS7.class); public static void main(String[] args) throws PlcConnectionException { String connectionString = "s7://10.105.143.1:102?remote-rack=0&remote-slot=0&controller-type=S7_300"; _log.info(String.format("Establishing connection to %s", connectionString));; try (PlcConnection plcConnection = new PlcDriverManager().getConnection(connectionString)) { _log.info("Conecting... " + connectionString); if (!plcConnection.getMetadata().canWrite()) { _log.error(String.format("Connection %s doesn't support writing.", connectionString)); return; } PlcWriteRequest.Builder builderWriter = null; builderWriter = plcConnection.writeRequestBuilder(); // builderWriter.addItem("mivariable-26", "%DB20:DBX6.7:BOOL", false); //OK builderWriter.addItem("mivariable-2", "%DB20:DBB06:BYTE", (byte)0); //FAILS // builderWriter.addItem("mivariable-4", "%DB20:DBW06.0:INT", (short)2); //FAILS PlcWriteRequest writeRequest = builderWriter.build(); PlcWriteResponse writeResponse = writeRequest.execute().get(); GeneralFunctions.printPlc4XWriteReponse(writeResponse); //print response } } } - Iñigo Angulo ZYLK.net :: consultoría.openSource Ribera de Axpe, 11 Edificio A, modulo 201-203 48950 Erandio (Bizkaia) +34 944272119 -