Configuring an S7-1200/S7-1500 to communicate with Microsoft SQL Database using Tabular Data Stream

  Рет қаралды 16,613

AutomationStation

AutomationStation

Күн бұрын

Пікірлер: 90
@piterNovy
@piterNovy 4 жыл бұрын
Great video!! A few weeks ago I set up a 1500 PLC as a FTP client sending about 1500 real values every 5 minutes to a .csv log file located in a simatic ipc!
@AutomationStation
@AutomationStation 4 жыл бұрын
Nice work!
@Сергей-ц1в4щ
@Сергей-ц1в4щ 3 жыл бұрын
Guys, everyone who has error 8602 - see the connection settings (SqlConfig DB). Recheck IP settings, InterfaceID, port number carefully . Also check the settings on the SQL side I had this same error. The problem turned out to be in the InterfaceID number. I put up the number 64, although I did not have it in the system constants (there were only 65 and 66 for each port) and it all worked Everything worked fine with the PLCSIM Advanced v3 upd1 (through PLCSIM Virtual Eth. Adapter) and latest for this moment MS SQL Now I am suffering with receiving a large amount of data from the database. Until I won (
@sagamoreful
@sagamoreful 5 ай бұрын
I completely stuck there I don't know what else I can do
@utkarshsingh175
@utkarshsingh175 4 жыл бұрын
Wow.. this is a very nice demo... Is this feature supported by PLC Sim Advance 3.0 ??
@AutomationStation
@AutomationStation 4 жыл бұрын
Even better - it works with PLCSim Advanced V2 as FW V2.6 is perfectly fine. Just tested it just to be on the safe side ;) Fun fact? It didn't work! Why? Because I turned off my SQL server ... With the server on it works perfectly fine! Thanks for watching
@yaroslavlyulko2298
@yaroslavlyulko2298 3 жыл бұрын
Have you any idea how to check result of sql query? For example if i execute command with query 'bla-bla-bla' - I will not see that this query not executed on SQL Server side.
@chrissibrandner
@chrissibrandner 4 жыл бұрын
Thank you for the interesting video. Is it also possible to send sensor values instead of those predefined values?
@AutomationStation
@AutomationStation 4 жыл бұрын
Yes, absolutely. This was just a mere example to prove that it works, what you send is up to you and you can even read data back!
@mafrafree
@mafrafree Жыл бұрын
Hello, in the Siemens link there is no longer the project for TIA V.16, Where i can find it ?
@lcart1064
@lcart1064 3 жыл бұрын
Thanks for the informative video! I'm getting error 8605 - "Error when calling TRCV". Haven't been able to find much online about how to fix this... any ideas would be appreciated.
@bassistemre
@bassistemre 4 жыл бұрын
Good video, first of all thank you! But I have a question. How can I run this project with S7-1200? I tried to copy paste the material from existing project to blank S7-1200 project and an error occured which says: Drop/Insert(0026:000071) A test cannot be copied. Only one test instance of type version Lsql_Microsoft V0.0.8 is permitted. Only released type instances can be copied. Please! What should I do?
@AutomationStation
@AutomationStation 4 жыл бұрын
Check the types folder in you project library - this message is indicating you have put one of the types (Lsql_Microsoft) in edit mode. Right click it and select “discard changes” to restore back to a released version.
@shanehodgson4290
@shanehodgson4290 2 жыл бұрын
HI, I'm trying to use V2.1 of this block in an S71200 and keep getting an area length error. This version doesn't require line 386 to be commented out as the manual states that the block will work with an S7-1200 from firmware V4.4 or higher (I am using V4.5) it does however state that the parameter "data" must be interconnected with an "Array of Byte" when using a S7-1200. A Structure is not permitted. Does it just mean i need to change the "data" datatype to be an array of bytes rather than the structure? Any help would be much appreciated.
@tranngoctam8419
@tranngoctam8419 2 жыл бұрын
Good video! I ask you to guide how to connect PLC S7-1200 with SQL server using domain name, Thanks
@richardstatie5392
@richardstatie5392 4 жыл бұрын
Thank you for sharing this. Great tutorial. I did follow all the steps, but I'm at the end when I'm trying to start the communication from the S7-1200 with my PC, I'm getting the fault message: 8602. In the subfunctionstatus: 80C6. I don't know what I'm missing here. The fault message comes up even before I try to send a message. It looks like the communication is not working between the PLC and the PC. Do you have any suggestions?
@AutomationStation
@AutomationStation 4 жыл бұрын
I'd suggest checking our other video that shows you how to set SQL Express from scratch: kzbin.info/www/bejne/gKbPlqecj7SDY68 Once you go through this I'd confirm that you can access your database using Server Management Studio. If this doesn't work, you won't be able to connect from your PLC either and it means that you have either not configured your Microsoft SQL database correctly or something like a firewall or your specific network topology is causing issues
@LuisCardoso-uj5co
@LuisCardoso-uj5co 3 жыл бұрын
Hello, i'm having a problem on an S7-1200, I'm getting the Status 8605 and the SubfunctionStatus 8088. What am I missing here? Thanks in advance.
@Plcwhiz
@Plcwhiz 2 жыл бұрын
Hi how do i send Timestamps from The S&-1200 to SQL. I have concatenated the time stamp data but it is not appearing in SQL
@egors9279
@egors9279 4 жыл бұрын
Thanks for the excellent demonstration of a really useful feature. Is it possible to read data back from the SQL database in the same way?
@AutomationStation
@AutomationStation 4 жыл бұрын
Sure! That's when you'd use the enableArchive, db and dbmax pins on the Lsql_Microsoft block.
@garyharrison9146
@garyharrison9146 4 жыл бұрын
@@AutomationStation but how do you read back in 1200 without the archive?
@AutomationStation
@AutomationStation 4 жыл бұрын
Hi Garry, yeah I'm afraid that's only possible with the S7-1500
@garyharrison9146
@garyharrison9146 4 жыл бұрын
@@AutomationStation you can actually do it. I managed to get it to read back in a 1200 . Also noticed the block isn't developed far enough for example it doesn't handle useful production db scenarios i.e. long insert or query commands. Had to modify that. Good concept but not good for memory space on plc or production ready for tracking parts etc.
@PelleTampio
@PelleTampio 4 жыл бұрын
@@garyharrison9146 Hi, we have a demo with the siemens "stock" example and we find the sqlcommand limited with string only. I can fit 6 analog measurements + column names with string [255]. Any tips how to change this before i hit siemens with support request? Requirement for us is max data length from plc - > sql to avoid manual splicing and time sync of the data to be send. Pdf Manual says 65kbyte send and receive limit so there should be a trick to use something else than string 255 for send. Also the datablocks have quite a lot of room for more than a string. Annoying siemens did not straight away give notes how to extend the example limits.
@leminhhieu0912
@leminhhieu0912 4 жыл бұрын
Thanks for your great video, and i have a question for you. Now, i dont have CPU S7-1500, maybe, can i use PLCSim to do it ? when i use PLC sim Advance to simulate S7-1511. Using example project of Siemens, when enableLsql =1 , Status = 16#8602, SubfunctionStatus = 80C5.
@AutomationStation
@AutomationStation 4 жыл бұрын
I tested it for another viewer and works perfectly fine with PLCSim Advanced. If you open the block itself you can check what these codes mean, hopefully they'll point you in the right direction. Also, did you check whether you can connect to the database using something like the Management Studio?
@leminhhieu0912
@leminhhieu0912 4 жыл бұрын
@@AutomationStation In my PC, i am using SQL server 2014. in this video, you use SQL server 2017, can SQL server 2014 connect ?
@utkarshsingh175
@utkarshsingh175 4 жыл бұрын
I am also getting the same Error, 16#8602 & 16#80C5 using PLCSImAdvance 3.0 & Example project of Siemens.
@AutomationStation
@AutomationStation 4 жыл бұрын
Well I haven't tested with V3 but works perfectly fine with V2
@hectorhirammirandaflores661
@hectorhirammirandaflores661 3 жыл бұрын
I have the same error and still can´t figure out what is the problem
@MrChantid
@MrChantid 8 ай бұрын
Able to write data in to MySQL or not?
@cptchaos8
@cptchaos8 4 жыл бұрын
Hi. What do I need that I can setup a permanent communication for data exchange between s7-300 plc and SQL Server? Is there a service necessary or do I have to stay online in Tia portal all the time?? I just wanna write data from plc every 10-20 seconds into sql server database. Else I have to use OPC UA and there you use a service that runs...
@AutomationStation
@AutomationStation 3 жыл бұрын
I don't think there's any library available for S7-300 so you might be best off having an intermediate IPC that will talk to your S7-300 and then access the SQL server. Or move to a S7-1500 ;)
@muhammadzafariqbal9822
@muhammadzafariqbal9822 3 жыл бұрын
hi nice video but how to transfer character data from tia portal string to sql DB like (apple mango) 1234 easy transfer but character not going can you explain thanks
@曾亮中
@曾亮中 4 жыл бұрын
If you need to read the SQL DATA , how to use it.
@lamsonlemai6516
@lamsonlemai6516 4 жыл бұрын
Thanks for your video, but can I use this method for MySQL, ? I have seen a topic of MySQL of siemens forum but it’s so difficult to understand totally
@AutomationStation
@AutomationStation 4 жыл бұрын
I'm afraid this would only work with Microsoft SQL
@lamsonlemai6516
@lamsonlemai6516 4 жыл бұрын
When I use this example for S7-1200. An error occurs because FC Write to array is not supported. :(
@AutomationStation
@AutomationStation 4 жыл бұрын
@@lamsonlemai6516 ​ There are restriction on what S7-1200 can do which I mention in the video and are also listed in the documentation. For it to work with S7-1200 you need to comment few lines. Check 12:10
@lamsonlemai6516
@lamsonlemai6516 4 жыл бұрын
@@AutomationStation thank you very much.
@manjunathnagaling4872
@manjunathnagaling4872 3 жыл бұрын
Hiiii....what are the preconditions to configure SQL data to siemens scada system.?
@AutomationStation
@AutomationStation 3 жыл бұрын
Not sure I get your question. If you talk about setting up SQL for WinCC I'd advise checking the WinCC manual, should have all the preconditions
@alexisneculpan3932
@alexisneculpan3932 2 жыл бұрын
hi .....how many values ​​can you send from a 1200 to a database??
@AutomationStation
@AutomationStation 2 жыл бұрын
Good question, I have not seen any performance values. I would suggest monitoring communication load of the PLC
@davidgemelli
@davidgemelli 3 жыл бұрын
Hello, this work on tia portal V15?
@YogeshPatil-wv8zj
@YogeshPatil-wv8zj 3 жыл бұрын
It is very good video. Can you provide same program in V15 version
@AutomationStation
@AutomationStation 3 жыл бұрын
Sorry I'm afraid I don't even have V15 installed and don't think the blocks support V15... You could get yourself a trial of V16 though and see if you can migrate the blocks to V15
@曾亮中
@曾亮中 4 жыл бұрын
Archiving received data (enableArchive, db, dbmax)----------->How to use?
@kaleshnarayan2010
@kaleshnarayan2010 4 жыл бұрын
Hi dear thank you for the video ,,please tell me how can i connect sql with plc sim advance , Is it possible? please let me know
@AutomationStation
@AutomationStation 4 жыл бұрын
Well I tested it with PLCSim Advanced V2 as FW V2.6 and it works perfectly fine so should also work with V3 FW V2.8
@曾亮中
@曾亮中 4 жыл бұрын
I run a select query I don't know how to retrieve data and read the values.
@AutomationStation
@AutomationStation 3 жыл бұрын
There's a new version of the block available on the Siemens support site that supports SELECT, make sure to use this one and check the documentation for more info on how to do it
@williamvidorette3797
@williamvidorette3797 2 жыл бұрын
Hi, do you have de example in TIA PORTAL V16 to share? On the siemens page is in TIA V17.
@AutomationStation
@AutomationStation 2 жыл бұрын
I dont think I do, sorry. You could try opening the v17 blocks in a trial version and copying them to v16 maybe
@williamvidorette3797
@williamvidorette3797 2 жыл бұрын
@@AutomationStation Hello friend, thanks for the reply, I got the v16 version
@mafrafree
@mafrafree Жыл бұрын
@@williamvidorette3797 Where did you find ?
@williamvidorette3797
@williamvidorette3797 Жыл бұрын
@@mafrafree Hello friend, I got it from the person who posted another video, if you want, give me your email, I'll try to send it to you
@ashiqmumtaz8726
@ashiqmumtaz8726 3 жыл бұрын
HI, Is it possible to connect S7-1200/1500 to Azure Database?
@AutomationStation
@AutomationStation 3 жыл бұрын
Not this way. For Azure check our MQTT video. Most cloud services like Azure or AWS use MQTT brokers so you need to have an MQTT client on your PLC to connect and send data to it. An alternative would be a hardware solution like the Cloudconnect 7 for example.
@曾亮中
@曾亮中 4 жыл бұрын
Archive len = 67174534 , Is it normal?
@曾亮中
@曾亮中 4 жыл бұрын
How to use the select command? to s7-1500
@AutomationStation
@AutomationStation 3 жыл бұрын
There's a new version of the block available on the Siemens support site that supports SELECT, make sure to use this one and check the documentation for more info on how to do it
@曾亮中
@曾亮中 4 жыл бұрын
S7-1500 Example 'insert into PLCDATA values (5,6,7)' If it's in the s7-1500 DB way, how to write
@AutomationStation
@AutomationStation 4 жыл бұрын
Hello again! If what you're after is writing some dynamic data rather than predefined values to your SQL Database, that's pretty easy. If you look at the command at 11:26 you just need to build the command yourself by concatenating some strings. I'd make another function which would take my values as the input, and the table name as another input, concatenate these into an SQL command and then spit out the command and then I'd use this command as the actual parameter for my sqlCommand input. I was actually going to do it but didn't want to add extra blocks and confuse people ;)
@曾亮中
@曾亮中 4 жыл бұрын
@@AutomationStation Wait for your example, thank you.
@曾亮中
@曾亮中 4 жыл бұрын
I can read and write To salsy Microsoft SQL Server?
@AutomationStation
@AutomationStation 4 жыл бұрын
@@曾亮中 Not sure what you mean by salsy, but it's possible to both read and write data from and to the SQL Server
@曾亮中
@曾亮中 4 жыл бұрын
@@AutomationStation Archiving received data (enableArchive, db, dbmax)----------->How to use?
@binor2286
@binor2286 Жыл бұрын
Guys I got an interesting error , so when I enable the SQL. The code turn to 7002 which is completely normal but after 17s (yes I'd count and each time it's 17sec) it turns to the error code 8602, sub function status 80C6 in state 3 . Does anyone had an idea on how to fix this problem ?
@sagamoreful
@sagamoreful 5 ай бұрын
Did you solve it?
@binor2286
@binor2286 5 ай бұрын
@@sagamoreful no I never found a solution even on Siemens forums
@ag7258
@ag7258 3 жыл бұрын
Sir how I get lsql microsoft function block
@AutomationStation
@AutomationStation 3 жыл бұрын
Check the video description
@ag7258
@ag7258 3 жыл бұрын
@@AutomationStation got link but how I download Plz help
@ag7258
@ag7258 3 жыл бұрын
Can it work for tia 15
@曾亮中
@曾亮中 4 жыл бұрын
If you need to read the SQL DATA , how to use it.
@曾亮中
@曾亮中 4 жыл бұрын
I run a select query I don't know how to retrieve data and read the values.
@AutomationStation
@AutomationStation 4 жыл бұрын
I'm afraid that SELECT might not be implemented in the block yet. Feel free to try to do it yourself though
@lehel121
@lehel121 3 жыл бұрын
did you implementet. or it was to hard?
COM13c. [3/5]Sending INT and Real from S7-1200 to an SQL Database [Programming Section]
39:41
Which One Is The Best - From Small To Giant #katebrush #shorts
00:17
🍉😋 #shorts
00:24
Денис Кукояка
Рет қаралды 3,9 МЛН
Как подписать? 😂 #shorts
00:10
Денис Кукояка
Рет қаралды 8 МЛН
Logging Sensor Data From Siemens S7 PLC To MariaDB SQL Database
25:25
SQL4automation
Рет қаралды 24 М.
TIA Portal: S7-1500 to an SQL Database - LMicrosoft_SQL v1.0 Example
15:55
How are holograms possible?
46:24
3Blue1Brown
Рет қаралды 563 М.
COM13a. [1/5]Connecting a Siemens PLC(S7-1200/S7-1500) to an SQL Database [SQL Section]
31:43
Electrical Automation Hands-On
Рет қаралды 36 М.
Siemens PLC S7-1200 MySQL DB interfacing
53:33
codingpc automation
Рет қаралды 4,3 М.
COM03. OPC UA - Microsoft Excel (OPC UA Client) and PLC (OPC UA Server)
18:38
Electrical Automation Hands-On
Рет қаралды 37 М.