Siemens released V21 on Feb.21, 2021, which likely solved the problem of the programming for S7-1200 . "The parameter "data" must be interconnected with an "Array of Byte" when using a S7-1200. A structure is not permitted. " This is talking about the "SqlReceive".data at the interface of the “LSql_Microsift” FB
Actually i need help on this issue of sql server using example from siemens i have downloaded a example with v3.1 or v31 it has many files compared to yours i dont know where i can start to learn this issue
I would recommend review my videos COM13 a,b,c,d,e Then you will have much better understanding when you come back to use V31. V20- V31 are quite similar, but Siemens just solve some bugs and added features. Key ideas are the same.
hi i have a S71200 PLC I insert value (both int and real) to sql that is oke but when i update value that is fail, it don't change value on sql. Can you help me to solve this problem. Thanks !
Hi, I'm getting an 8602 erro when using the lsql block, that means it is a tcon error, which is 80C6. I already configured everything, opened port 1433 on the server and added an inbound rule in the firewll, do you know what else i can do to troubleshoot my problem?
@@electricalautomation I did the following instruction but i get the 8602 error (for version 3.1 Tia V17). What is the reason for this? And if I use hardware s7 1200 for the test, are there any different steps compared to the steps above? Thanks!
Hello! first of all, thank for your videos, they really helped a lot! I am having a problem with receiving data. I use the version 21 of the code in Tia Portal V16, and I have s7 1200. In the LSqlMicrosoft function code I modified so the received data is an array (data.bytes) I can sucessfully send the insert comands and observe results in my SQL Database. What I cannot do is read the received data in tia . I can see the response using Wireshark though, watching the tds protocol but no data appears in tia and dataReceived is never true. I tried to modify the data type typeUseCaseSpecificData so the tokenColumnMetaData´s size matches the bytes I see in wireshark (as described in simenes manual). Do you have an idea, what could be a problem? I see in the video that you receive data without any modifications to the code V20 and it happens after sending every command.
Hello, I think s7-1200 still has issue on implementing this. In the video I used S7-1500 configuration and PLCSimAdv. According the the document of the V21, S7-1200 does not support the structure in its receive buffer and its length is 8K (S7-1500 64K). As you said, you modified the received data as the bytes of the array, but still can not get successfully, so probably try a simple data and table in the SQL to decrease the data telegram length. From my personal view, there would be something out of the S7-1200 abilities which cause us cannot make it successfully. If this is a test for you, then use S7-1500 or PLCSim Adv, as shown in the video, they are no problems. As Siemens did before, every couple of months, this example got upgrade and got problems solved. Maybe Siemens will update or upgrade this example to solve the glitches soon.
@@electricalautomation I investigated a little bit and I have realised that the response can be seen in tia but only in SqlReceive.data.bytes which is difficult to read. I suppose the program has got some part that takes care of this data and puts it to accordingly into header, tokenColumnMetaData and tokenRows so it is easier to read. Do you know where exactly does that happen so I can investigate and maybe fix my problem? I have written some code that writes the data in more approachable form into new data block but the problem is it must be modified depending on the length of the response (depends on token ColumnMetaData).
@@monikawisniewska1588 You could try to use a new created DB, set it as the received data and as bytes of the array. Then use this array as the RECV Buffer. Then transfer this buffer DB data to the receive buffer DB from the example program.
As long as TIA Portal compatible with SQLExpress. But if you are using PLCSim to simulate PLC for this test, it won't work, because it is using TCP/IP.
@@electricalautomation I mean, I have a datablock DB at TIA portal that I want to put it at SQL command. how can we write that using "insert"?. let say "insert into PLCDB values (5,6). I want to to change values 5 and 6 with datablock values.
@@faridviko Please watch carefully about the videos on this topic COM13a. [1/5]Connecting a Siemens PLC(S7-1200/S7-1500) to an SQL Database [SQL Section] th-cam.com/video/fRKTqoNKcXU/w-d-xo.html COM13b. [2/5]V11 Connecting a Siemens PLC(S7-1200/S7-1500) to an SQL Database [PLC Section] th-cam.com/video/2wpFREYnJPY/w-d-xo.html COM13c. [3/5]Sending INT and Real from S7-1200 to an SQL Database [Programming Section] th-cam.com/video/Y0bLIpnuTQM/w-d-xo.html COM13d. [4/5]V20 Connecting a Siemens PLC S7-1500 to an SQL Database [PLC Section] th-cam.com/video/jDf2kF2gDug/w-d-xo.html COM13e. [5/5]V20 Connecting a Siemens PLC S7-1500 to an SQL Database [SELECT WHERE] (Wireshark)th-cam.com/video/Z8etx2h_pYw/w-d-xo.html
I really like yours tutorial. But can you show also how to insert different data to two or more different tables in SQL database at the same time. I was trying to that but failed. I will be glad :) Thanks
I don't think using one command can send to different tables by using this example. But you can switch different command via [index number]. The protocol is TDS and and Send/Receive function blocks are based on the TCP/IP, the current version V20 cannot operating different tables within one command.
Hi , Firslty thanks for your videos and I really like yours videos.I want to ask something you. I have a problem on V20. When I modify "SqlConfig".enableLSql =True, directly diagnostics.status give a error 16#8605. "InstLSql_Microsoft".diagnostics.status Hex 16#8605 "InstLSql_Microsoft".diagnostics.subfunctionStatus Hex 16#8088 "InstLSql_Microsoft".diagnostics.stateNumber DEC+/- 7 How can i solve this problem? Can you help me on this topic? Thanks in advance.
Please check the COM13.b th-cam.com/video/2wpFREYnJPY/w-d-xo.html, I discussed #8088. You'd better use S7-1500. Likely this example does not fully compatible with S7-1200 evenif you are using V4.4.
Siemens released V21 on Feb.21, 2021, which likely solved the problem of the programming for S7-1200 . "The parameter "data" must be interconnected with an "Array of Byte" when using a S7-1200. A structure is not permitted. " This is talking about the "SqlReceive".data at the interface of the “LSql_Microsift” FB
THANKS MR . YOU ARE THE BEST
THANKS BRO!
Please share video on Updated code by Siemens.
Please find the download link below the video
Has anyone solved the problem of receiving data from version 2.1? i have a s7-1200 plc and i can't execute commands like update or select.
Actually i need help on this issue of sql server using example from siemens i have downloaded a example with v3.1 or v31 it has many files compared to yours i dont know where i can start to learn this issue
I would recommend review my videos COM13 a,b,c,d,e Then you will have much better understanding when you come back to use V31. V20- V31 are quite similar, but Siemens just solve some bugs and added features. Key ideas are the same.
hi
i have a S71200 PLC
I insert value (both int and real) to sql that is oke but when i update value that is fail, it don't change value on sql.
Can you help me to solve this problem. Thanks !
Sorry, I am on a business trip these weeks and I am not available to check the details because the laptop is not the workstation I use for youtube.
Hi, I'm getting an 8602 erro when using the lsql block, that means it is a tcon error, which is 80C6. I already configured everything, opened port 1433 on the server and added an inbound rule in the firewll, do you know what else i can do to troubleshoot my problem?
Use hardware PLC and a PC installed SQL for the test. Also check the PC firewall
Have you solved the problem yet? I am using plcsim advance to simulate and get the same error. If you solved this error, can you help me? Thank!
@@electricalautomation I did the following instruction but i get the 8602 error (for version 3.1 Tia V17). What is the reason for this? And if I use hardware s7 1200 for the test, are there any different steps compared to the steps above? Thanks!
Hello! first of all, thank for your videos, they really helped a lot!
I am having a problem with receiving data.
I use the version 21 of the code in Tia Portal V16, and I have s7 1200. In the LSqlMicrosoft function code I modified so the received data is an array (data.bytes) I can sucessfully send the insert comands and observe results in my SQL Database.
What I cannot do is read the received data in tia . I can see the response using Wireshark though, watching the tds protocol but no data appears in tia and dataReceived is never true. I tried to modify the data type typeUseCaseSpecificData so the tokenColumnMetaData´s size matches the bytes I see in wireshark (as described in simenes manual).
Do you have an idea, what could be a problem? I see in the video that you receive data without any modifications to the code V20 and it happens after sending every command.
Hello, I think s7-1200 still has issue on implementing this. In the video I used S7-1500 configuration and PLCSimAdv. According the the document of the V21, S7-1200 does not support the structure in its receive buffer and its length is 8K (S7-1500 64K). As you said, you modified the received data as the bytes of the array, but still can not get successfully, so probably try a simple data and table in the SQL to decrease the data telegram length. From my personal view, there would be something out of the S7-1200 abilities which cause us cannot make it successfully. If this is a test for you, then use S7-1500 or PLCSim Adv, as shown in the video, they are no problems. As Siemens did before, every couple of months, this example got upgrade and got problems solved. Maybe Siemens will update or upgrade this example to solve the glitches soon.
@@electricalautomation I investigated a little bit and I have realised that the response can be seen in tia but only in SqlReceive.data.bytes which is difficult to read. I suppose the program has got some part that takes care of this data and puts it to accordingly into header, tokenColumnMetaData and tokenRows so it is easier to read. Do you know where exactly does that happen so I can investigate and maybe fix my problem?
I have written some code that writes the data in more approachable form into new data block but the problem is it must be modified depending on the length of the response (depends on token ColumnMetaData).
@@monikawisniewska1588 You could try to use a new created DB, set it as the received data and as bytes of the array. Then use this array as the RECV Buffer. Then transfer this buffer DB data to the receive buffer DB from the example program.
hi
is that possible to use one laptop for SQExpress and TIA Portal?
so there are 1 laptop has sqlexpress and tia portal in it and 1 s7-1200 PLC
As long as TIA Portal compatible with SQLExpress. But if you are using PLCSim to simulate PLC for this test, it won't work, because it is using TCP/IP.
@@electricalautomation hi thank you for your explanation. I got another question, how do log data from DB to ms SQL using insert command?
@@faridviko Sorry, not quite understand your question. As you can see at 12:00 in the video, the command is using ""Insert"
@@electricalautomation I mean, I have a datablock DB at TIA portal that I want to put it at SQL command. how can we write that using "insert"?. let say "insert into PLCDB values (5,6). I want to to change values 5 and 6 with datablock values.
@@faridviko Please watch carefully about the videos on this topic COM13a. [1/5]Connecting a Siemens PLC(S7-1200/S7-1500) to an SQL Database [SQL Section]
th-cam.com/video/fRKTqoNKcXU/w-d-xo.html
COM13b. [2/5]V11 Connecting a Siemens PLC(S7-1200/S7-1500) to an SQL Database [PLC Section]
th-cam.com/video/2wpFREYnJPY/w-d-xo.html
COM13c. [3/5]Sending INT and Real from S7-1200 to an SQL Database [Programming Section]
th-cam.com/video/Y0bLIpnuTQM/w-d-xo.html
COM13d. [4/5]V20 Connecting a Siemens PLC S7-1500 to an SQL Database [PLC Section]
th-cam.com/video/jDf2kF2gDug/w-d-xo.html
COM13e. [5/5]V20 Connecting a Siemens PLC S7-1500 to an SQL Database [SELECT WHERE] (Wireshark)th-cam.com/video/Z8etx2h_pYw/w-d-xo.html
I really like yours tutorial. But can you show also how to insert different data to two or more different tables in SQL database at the same time. I was trying to that but failed. I will be glad :) Thanks
I don't think using one command can send to different tables by using this example. But you can switch different command via [index number]. The protocol is TDS and and Send/Receive function blocks are based on the TCP/IP, the current version V20 cannot operating different tables within one command.
Hi ,
Firslty thanks for your videos and I really like yours videos.I want to ask something you. I have a problem on V20. When I modify "SqlConfig".enableLSql
=True, directly diagnostics.status
give a error 16#8605.
"InstLSql_Microsoft".diagnostics.status Hex 16#8605
"InstLSql_Microsoft".diagnostics.subfunctionStatus Hex 16#8088
"InstLSql_Microsoft".diagnostics.stateNumber DEC+/- 7
How can i solve this problem? Can you help me on this topic?
Thanks in advance.
Please check the COM13.b th-cam.com/video/2wpFREYnJPY/w-d-xo.html, I discussed #8088. You'd better use S7-1500. Likely this example does not fully compatible with S7-1200 evenif you are using V4.4.