下载 .NET 6.0 (Linux、macOS 和 Windows)

安装后 在这里

The command could not be loaded, possibly because:
  * You intended to execute a .NET application:
      The application 'restore' does not exist.
  * You intended to execute a .NET SDK command:
      No .NET SDKs were found.

Download a .NET SDK:
https://aka.ms/dotnet/download

Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found

dotnet restore

dotnet build

C:\Users\Administrator\Desktop\SoftPlc-master\SoftPlc-master\SoftPlc

copy native\win\snap7.dll bin\Debug\net6.0\

set COREHOST_TRACE=1

cd D:\SoftPlc

dotnet bin\Debug\net6.0\SoftPlc.dll -e  DATA_PATH=D:\softpc\demodata\datablocks.json --plcPort=102 --urls="http://localhost:8080/"

例子数据内容: https://github.com/fbarresi/SoftPlc/blob/master/SoftPlc/demodata/README.md

All mentioned byte indices are 0-based!

The first 16 bytes are a ASCII encoded String Hello, S7! with trailing spaces.
byte 16/17 are the max/min value of a signed byte (127/-128)
bytes 32-33/34-35 are the max/min value of a signed short
bytes 48-51/52-55 are the max/min value of a signed integer
bytes 64-71/72-79 are the max/min value of a signed long
bytes 80-83/84-87 are the max/min value of a float
bytes 96-103/104-111 are the max/min value of a double
bytes 1024-2048 are just bytes starting from 0 continousely incremented
 

仿真PLC:  DB1的   地址段 2048 Byte

2048个byte: DBB0 -- DBB2047 ( 后面的数字是十进制表示)

1 读写 前两个byte: DBW0  (word 16位, 两个byte)
                                         DBB0 - DBB1的两个byte
2 读写 前两个byte:DBW2  - 2是起始地址 DBB2
                      DBB2 - DBB3
3 读写 前两个byte:DBW4  - 4是起始地址 DBB4
                      DBB4 - DBB5
4 读写 4个byte   :DBD6  - 6是起始地址 DBB6
                      DBB6 - DBB9

B: Byte
W: word (wbyte)
X: DBX8.1(第8个byte的第一位)
Sting: DB1.DBX20

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐