Exactly what I've been looking for last few weeks! Thank you!
@shuvendudas28074 жыл бұрын
Hello Mesta Thanks for your video.Can you please tell me that how I can connect to "S7 200 smart" plc? Will it require tsap and what is the configuration for PLC?
@JustoDisla4 жыл бұрын
Can s7 be used in real time production environment with Siemens controllers?
@rigoltee2 жыл бұрын
Hi, Thanks for the useful video, what software would you recommend to simulate the PLC device if we have no PLC to connect to?
@Mesta-automation2 жыл бұрын
I think the simulator of TIA Portal works. Or eventually just mock the driver altogheter. There is an example on "HMI with WPF part 3" where I use a DummyPlcService.
@zaweerzulkivly44058 жыл бұрын
hi there, this is a very useful video for me. Currently I am doing TIA Openness, do you have any idea on it? The concept is still the same using Visual Studio and TIA Openness. I really hope i can contact you
@LorridoWelcome8 жыл бұрын
Thanks for this tutorial, but when it comes to LReal and LInt how do you convert them to get the right value in c#?
@massiv0n3 жыл бұрын
Hey Buddy! can you help me? I'm trying to write and get the value to this address DB14.STRING6.20 and I can't do it. Is giving me the error WrongVariableFormat or something like that. Do you know KEPServer tool ? I can access, write and read to this address without problems. Do you know how I can make it ? Sometimes, the factory line production is giving me the batch number or another important stuff and this is important for me. Thanks!
@draqos4 жыл бұрын
Hey man, do you know any possibility for a PLC like S7-1200 to work as a TCP socket listener so any random IPs from the same subnet could connect at it ? (I am not thinking to MODBUS, just TCP only) - thanks!
@mohamedabdel-raouf34766 жыл бұрын
Hello , Can you guild me to what i should do to read data continuously from PLC ?
@eduardoescobar5786 Жыл бұрын
How do I assign the offset ?, e.g. 0.0, 0.1 that you have shown. It shows that I can't modify that value I am using tia 16
@rafaelbonatto91434 жыл бұрын
Thank you very much for the video. Is it possible to place NetTOPLCSIM inside the C # library?
@maxencecharbonnier7085 жыл бұрын
Hello Thao, Do you remember what was your firmware? I can easily connect to my plc, but i can't read anything :( while i desactivitez optimized block, and all protections. Thank you
@nada26684 жыл бұрын
Thank you for watching the example I'm testing it now When using S7.Net, we ask if there is a license Should I buy and use it?
@manzarkazmi36585 жыл бұрын
Thank you for the tutorial. My question is can we read the values without using datablocks in TIA portal? thank you
@adamlukacovic9174 жыл бұрын
Hello, did u find an answer? Thank you
@JMMedinaDev6 жыл бұрын
Ciao Michele, Can you pls tell me if the Dll packed on Nugets is the full Dll with no dependencies to other libraries? I am trying to build this in unity Game Engine and I want to be sure it havent more dependencies than his own Dll. I dont want to go Web Server way , its not professional.
@azdasheerkhader21203 жыл бұрын
Hello i need the port can help me ?
@NathanStorniolo3 жыл бұрын
Hi, how can i connect a live chart, showing the present value?
@yasirhabibkhugiani8 жыл бұрын
thank for the video, it is helpful. I have a question, is there any way we can access the DBs dynamically from the PLC? like lets say we want to find out how many DBs are there in a PLC?
@Mesta-automation8 жыл бұрын
No, it doesn't support browsing the DB.
@PIDOtomasyon5 жыл бұрын
hi, can I syncr time of plc with c# ? Can you help me? urgent please.
@walterp71254 жыл бұрын
But must to pay for this library ?
@shaileshbangale13953 жыл бұрын
Can you provide same for Profibus driver? I want to communicate VB.net application with S7-300 with Profibus driver. Please help.
@lechklimczak39766 жыл бұрын
Thanks for this video. Function Read / Write Class is working perfectly on newest version TIA15. Regards
@earth22018 жыл бұрын
Thanks you so much! This tutorial is so useful!
@nguyenquocbao38125 жыл бұрын
I got 3 errors that I cant build Visual: CS0815 Cannot assign void to an implicitly-typed variable (LINE 17) CS1061 'Plc' does not contain a definition for 'LastErrorCode' and no extension method 'LastErrorCode' accepting a first argument of type 'Plc' could be found (LINE 20) CS1061 'Plc' does not contain a definition for 'LastErrorString' and no extension method 'LastErrorString' accepting a first argument of type 'Plc' could be found (LINE 20) Can you help ?
@fcibe13 жыл бұрын
Very interesting video, hi, I'm using this library, unfortunately I haven't found a way to use the events on datachange, can you help me? thank you
@Matt-bf4wp4 жыл бұрын
Ciao, funziona anche con s7 300 usato col vecchio simatic manager?
@jurajschmidt52546 жыл бұрын
Is it compatible with different PLC, (B&R, Mitsubishi)?
@kenhthoinontre16288 жыл бұрын
WHICH VERSION TIA PORTAL DO YOU USE IN THIS VIDEO??? I USE TIA PORTAL V13 STEP 7 PROFESSIONAL BUT CAN NOT OPEN YOUR FILE
@michelecattafesta91228 жыл бұрын
Tia V13 SP1. Unzip in a folder then on Tia portal: Project -> Open
@leonesmoura87563 жыл бұрын
It's possible conexion in C++?
@mattiapavoni66357 жыл бұрын
Hi, there is a possibility that after some time without closing the connection with the plc the read class read some strange value? Like 2.xxxE-38 instead of 170666 for a double variable. if i have a service, it's better to keep connection always open or close it and reopen after some times? Thanks.
@Mesta-automation7 жыл бұрын
It shouldn't happen. Do you check LastErrorCode and/or LastErrorString after every read, before using the values? Usually with TCP sockets it's normal to keep the socket open and check from time to time if the connection is still alive. You probably need to investigate more, if this happens only with the double or also if other values are corrupted. Also try to replace ReadClass with a ReadBytes and assign the values manually, to check if it is an issue of the ReadClass method.
@mattiapavoni66358 жыл бұрын
Hello, if i want to use the method ReadClass with a dataBlock bigger than 200 Bytes, how can i do it? I must create 2 different classes? Thanks!
@Mesta-automation8 жыл бұрын
+Mattia Pavoni it should work also for more than 200 bytes. The comment is outdated.
@mattiapavoni66358 жыл бұрын
Ok, thanks. Sorry but i have some other question. If i want to use ReadClass, i have to use the same name for the variable inside the PLC and inside the class? if i have to read a block of byte representing a string how can i do that? i try declaring an array of bytes but it doesn't work... Thank you very much!
@Mesta-automation8 жыл бұрын
Strings are not supported in ReadClass at the moment, but you can download the sources and contribute to the project. Regarding the names, it's not needed that the names in the class are the same as the names of the DB. The order and variable type in C# must be the same of the DB.
@nitinmajgaonkar30602 жыл бұрын
What is the difference between S7.net Library & Snap7 library ? Thank you in advance
@matejhlaca11524 жыл бұрын
Helo..how you convert byte (inside is data in hex) to decimal?
@TheObstkuchen16 жыл бұрын
thank you very much for this awesome tutorial.
@waqarhissam33317 жыл бұрын
Hi, I have downloaded the TIA Portal Step 7 Professional version V13 from Siemens offical website. During installation it is giving errror that file "SIMATIC_STEP_7_Professional_V13.001 is not found" even the file is existing in the same dierectory where it is looking for it. Please recommend me some solution for it.
@Mesta-automation7 жыл бұрын
I still have to convert the project...
@shelkadimka5 жыл бұрын
Thank a lot !! But in v 0.4.0 has no error processing(var result = plc.Open();), plc. Open return void and has no lasterrorcode .....
@rodtaylor65858 жыл бұрын
Brilliant video! Thank you for posting it!!
@lukaaEverything6 жыл бұрын
Hello I can not read the M1000.0 bit marker. MD1004 read well System.InvalidCastException: "The specified cast is invalid." Thank you
@HaiPham-pv5lp5 жыл бұрын
I got an error : System.InvalidCastException: 'Specified cast is not valid.' Can you help me to fix it. Thank you.!
@jalmarihuitsikko72117 жыл бұрын
I tried this code on visual studio 2017 But I keep getting "System.InvalidCastException" on a row that reads variable from plc. When I open example project it doesn't throw same exception. What could be a problem? I did get and install the .dll from nuget.
@jalmarihuitsikko72117 жыл бұрын
I'd like to add that command like IsConnected() seems to work just fine there's some kind of problem I don't understand yet with commands that read variables.
@nqaiser6 жыл бұрын
hello, Thanks For a great tuturial, Can you confirm if this library will work for PCS7 system (Siemens s7 4105h plcs) Thanks.
@captfcknut7 жыл бұрын
Can you tell me why you only use DBXX addresses instead of usong the native addresses of the PLC, such as %Q, %I, %QW, %IW? Thanks!
@Mesta-automation7 жыл бұрын
I always mapped I/O to DB.
@PsykeBr8 жыл бұрын
Hello! Nice work! Is possible to use that code with advanced HMI controls? Thx!
@Mesta-automation8 жыл бұрын
You can use them togheter. The easiest and safest way is to write the "Value" property of the HMI controls from the code. You can also implement the interface ICommComponent, that permits to assign a Tag to a control and the control gets the value by polling the plc. Personally I would go with the first approach.
@PsykeBr8 жыл бұрын
+Mesta Automation Could you provide an exemple? That would help me a lot! Thanks again!
@Mesta-automation8 жыл бұрын
I'll see if I can do that this weekend.
@pell55897 жыл бұрын
I can't read A SINGLE VARIABLE bool type of both DBx... and Qx.y. please help me...thanks so much
@KeshavKumar208 жыл бұрын
Hi, I'm not using PLCSIM. How can I read the DBs by using this program if PLC is connected directly?
@kenhthoinontre16288 жыл бұрын
HI am the same you too . if you have the anwer .please let me know. thanks. and when you connect if you not clear it yet , you can communication with me my email: hoangtung2205@gmail.com
@KeshavKumar208 жыл бұрын
Hi, I got the solution but I have not tried it yet. We should use Sharp7 library instead of S7.Net.
@kenhthoinontre16288 жыл бұрын
Keshav Kumar hi I am not understand yet .about yours talking . I have real pleasure S7-1200 .type 1212c .V3 now I want make 1 project to practice.
@kenhthoinontre16288 жыл бұрын
but I have no idea .
@KeshavKumar208 жыл бұрын
Do you want to connect your PLC using C#? Use Sharp7 library. Do not use S7.Net. www.mesta-automation.com/how-to-write-a-siemens-s7-plc-driver-with-c-and-sharp7/
@alideniz23264 жыл бұрын
thanks a lot . thank you for posting project.
@PIDOtomasyon5 жыл бұрын
hi, I cant read and write strings, can you show please.
@mustafayurtseveri8411 ай бұрын
The best tutorial. thanks
@gabrcatt4 жыл бұрын
it's appearing error: "Couldn't establish the connection to 127.0.0.1. Message: WrongNumberReceivedBytes" What is wrong?
@НиколайТорощин-е6э4 жыл бұрын
this library has an error in the file PLCAddress.cs Row 164. you need to fix VarType.Byte to VarType.Bit
@luslus..198 жыл бұрын
Very nice video, thanks for sharing. Is it easy to create an HMI on C# with Siemens Logo ?
@Mesta-automation8 жыл бұрын
I recently wrote an article on another C# driver that should be compatible with Logo: www.mesta-automation.com/how-to-write-a-siemens-s7-plc-driver-with-c-and-sharp7/ You can check that out.
@luslus..198 жыл бұрын
Hello Mestz Automation, The procedure that you did for the S7-1200 is the same for a Logo ? I am installing the package S7.Net will try it and will give you a feed back Thanks
@luslus..198 жыл бұрын
The only issue will be with write and read variables because DBs does not exists in logo you have only Input,Outputs, M and NetworkVariable !!!
@Mesta-automation8 жыл бұрын
I don't know much about logo plc. You can download the sources from Github and make it work anyway.
@hoanghuynhminh90565 жыл бұрын
Can you tell me when i use DBW, DBX, and DBD please ? Thank you so much
@reverz35 жыл бұрын
DBX is a bool, DBW a word and DBD a double word
@libnerrr7 жыл бұрын
I find ReadClass(); very unstable. Its necessary to keep class properties in order but making any action with class can affect it. According to MSDN " GetProperties(); method does not return fields in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which fields are returned, because that order varies. I consider creating an array with names and addressed of variables from plc and looping through to make many single Read();
@libnerrr7 жыл бұрын
I found a better solution. You can create two the same classes. Use ReadClass(); only with one of them and process only the copy.
@Mesta-automation7 жыл бұрын
I agree that ReadClass it's not the best implementation possible. The point of ReadClass is just to match the same exact structure of a DB in a class, so it can be filled with the data from the plc with a single instruction. Of course if you change the order of variables, in the program or in the plc, it will break. It is more fragile than indexing and convert manually all the data, but it saves you a lot of code.
@ucanhnguyen11344 жыл бұрын
in reality. We have to update data every mms, how can I do that?
@faressalah26727 жыл бұрын
can we use it withe S7-200 ??
@Mesta-automation7 жыл бұрын
+fares salah no but there is another tutorial in this channel that uses Sharp7, which will work with S7 200
@faressalah26727 жыл бұрын
can you give the link of video ? and thanks
@wuchris5242 Жыл бұрын
why readbytes function use 38 bytes?? i'm sorry not understand clearly
@vuminhtien53316 жыл бұрын
I can't connect to my real PLC (1212c dc/dc/dc), can someone help me? please
@loita61127 жыл бұрын
I can't connect to PLCSIM.Could you tell me why,please!!
@Souldk866 жыл бұрын
try checking your PG/PC interface, windows "control panel" - switch to small icon, and then "set pg/pc interface" (or similar), the s7 online has to be connected to the PLCsim, for running af simulated PLC, or the network card a real PLC is connected to, if you have one a real one
@99westi3 жыл бұрын
Great work
@loita61127 жыл бұрын
i can't fine S7.net.dll
@asphalt_therapy8 жыл бұрын
Best vid ever
@MarioCrispino3 жыл бұрын
Interesting video.
@simonedallai487 жыл бұрын
ciao michele sei italiano? avrei diverse domande da farti?
@Mesta-automation7 жыл бұрын
Ciao, si sono italiano.
@simonedallai487 жыл бұрын
Già da tempo programmo in plc e hmi siemens ma a dire il vero sono molto attratto da queste interfacce! Ora la domanda è usando visual studio come interfaccia posso andare a modificare le Db del plc? Mi consiglieresti più vstudio o visual basic da imparare? Grazie
@Mesta-automation7 жыл бұрын
Puoi leggere o scrivere sulle DB, non puoi aggiungere/rimuovere variabili, perche' ci sarebbe da compilare e trasferire il software sul plc. Visual Basic e' dal 2008 che non e' piu' mantenuto da Microsoft. La scelta sta su C# e VB.Net, entrambi in Visual Studio. Tutto lo sviluppo e le novita' di Microsoft sono in C#. VB.Net e' mantenuto solo per motivi storici e per la user-base, comunque molto ridotta, e ha valore 0 sul mercato. Il 99% dei nuovi software in .Net usano C#, come tutte le librerie open source.
@JMMedinaDev6 жыл бұрын
You can only use S7.net and Sharp 7 in C#7 or higher, I have been working around with unity for weeks by now to just notice you simply cant, till unity dont support C# 7. I hope it goes to everyone whom is trying the same. Its simply pointless, tuplas are not supported in unity C# right now and both libraries use it. I just feel I wasted my time :( Gonna turn to try to sniffer the web server from Unity and see how it goes. Give visibility to that, will safe ppl time.
@nobleparti7 жыл бұрын
can u send visual studio C # software link free ware and key? ur video is very helpfull me
@Mesta-automation7 жыл бұрын
Visual Studio 2017 Community is free. Search it on google.
@MrPowerm4 жыл бұрын
Danke für die Infos :D
@TheAdlcn Жыл бұрын
Very very well
@lexobsm4 жыл бұрын
the only command working on this package is : isconnected, isavailable, open() ..... the others no !!!! not usefull really, try to work with a real PLC !!
@caubehinhbong6 жыл бұрын
thank a lot
@imran2719818 жыл бұрын
please send your email
@Josempe13 жыл бұрын
Can I use S7.Net with STEP 7? I have a s7400.
@matejhlaca11524 жыл бұрын
Also..how to pass the string? does the program know that first byte is total lengh and second the actual lenght?
@matejhlaca11524 жыл бұрын
Already solved this...if it will help somebody string Koda = S7.Net.Types.String.FromByteArray(db4Bytes.Skip(6).Take(40).ToArray()); Koda = Koda.Replace("\0", string.Empty); //remove blank positions from stirng
@lamsonlemai65164 жыл бұрын
@@matejhlaca1152 hi matej, can you explain for details ? FromByteArray with its contructors ?