7/20/2024 6:48 AM | |
Joined: 4/5/2021 Last visit: 10/12/2024 Posts: 6 Rating: (0) |
Hi! I am using a CPU 1212C and TIA Portal V17 to connect to my MS SQL database by using Lsql library which is found in the following topic: Connecting a S7-1200 PLC / S7-1500 PLC to a SQL Database, Entry ID: 109779336
The library comes with 3 functions blocks LSql_Microsoft, AnalyzeTokens and DeserializeRows. By now my PLC is running only the LSql_Microsoft function block at OB1. At the instance data block I set the following interfaceSettings (the usual TCON settings): InterfaceId: 64 ID:16#10 ConnectionType: 16#0B = TCP/IP (default) ActiveEstablished: true Remote address: 192.168.1.100 (my PC address) RemotePort: 1433 LocalPort: 0 User name, password, server name and database name has been set as well, accordingly with what has been set on the server by using Microsoft SQL Server Management Studio. By now I am just trying to keep a connection with the server by using FB LSql_Microsoft, that is, just set block enable input without trying to send any SQL command yet. If I stop the server by using SQL server configuration manager, FB returns error 16#8602 and if I start the server, FB returns error 16#8605. Which at least tells me that PC acknowledge the PLC through the FB, but I am still messing up with something... Accordingly to Connection of a SIMATIC S7-1x00 to a SQL Database manual: ERR_CONNECT ERR_TRCV At SQL Server configuration manager, TCP/IP is enabled for SQLEXPRESS SQL Server service and is set to listen all incoming IPs as well. Additionally I set IP3 and IP4 with 192.168.1.100 (PC ethernet port address) and TCP Port 1433, and in the IPAll parameters, TCP Dynamic Ports is set to 0 and TCP Port is set with 1433. At my PC firewall settings, I created inbound and outbound rules for TCP port 1433 as specific permit port for both local and remote port. Just to check that is not a firewall issue, I turn it off but got the same error at the FB. I will be grateful if you share any advice. Thanks for reading! |
Last edited by: EstebanTP at: 07/20/2024 06:59:30 |
|
Follow us on