我正在尝试使用 s7.net plus 库从 S7-1200 PLC 读取值。当我尝试从数据块中读取数据时,它会返回"WrongVarFormat"
消息。我的代码是:
using (var plc = new Plc(CpuType.S71200, "192.168.1.17", 0, 0))
{
//IP is responding
if (plc.IsAvailable)
{
ErrorCode connectionResult = plc.Open();
//Connection successful
if (connectionResult.Equals(ErrorCode.NoError))
{
//Get data
object b2 = plc.Read("DB1.DBD38");//This part always return "WrongVarFormat"
}
}
此外,我设置了 plc 设置,并将数据块和值声明为: S7-1200 DB1