2/25/2018 9:08 AM | |
Posts: 19 Rating:
|
Read bytes / Write bytes The library offers several methods to read variables. The basic one and the most used is ReadBytes. public byte[] ReadBytes(DataType dataType, int db, int startByteAdr, int count) public ErrorCode WriteBytes(DataType dataType, int db, int startByteAdr, byte[] value) This reads up to 200 bytes (actual limit of the protocol) from a memory location that you determine. dataType: you have to specify the memory location with the enum DataType
db: this is the address of the dataType, for example if you want to read DB1, this field is “1”; if you want to read T45, this field is 45. startByteAdr: this is the address of the first byte that you want to read, for example if you want to read DB1.DBW200, this is 200. count: this contains how many bytes you want to read. It’s limited to 200 bytes and if you need more, you must use recursion. Value[]: array of bytes to be written to the plc. What is S7.Net? S7.Net is a plc driver that works only with Siemens PLC and only with Ethernet connection. This means that your plc must have a Profinet CPU or a profinet external card (CPxxx card). S7.Net is written entirely in C#, so you can debug it easily without having to go through native dlls. Supported PLC S7.Net is compatible with S7-200, S7-300, S7-400, S7-1200, S7-1500. 1. Example: --Deleted link-- 2. Password: like share and subscribe video AttachmentS7.Net Tutorial.rar.zip (485 Downloads) |
Last edited by: Jen_Moderator at: 2/26/2018 9:59:26 AMDeleted link and added file as an attachment. |
|
This contribution was helpful to
1 thankful Users |
9/19/2020 10:32 PM | |
Joined: 3/17/2015 Last visit: 11/6/2024 Posts: 1 Rating:
|
Perfect sharing thank you. |
9/20/2020 3:36 PM | |
Joined: 10/25/2019 Last visit: 12/11/2024 Posts: 278 Rating:
|
The basic is ReadClass. BR |
Follow us on