点击或拖拽改变大小

SiemensS7NetWrite 方法 (String, String)

向设备中写入字符串,编码格式为ASCII,格式遵循西门子自身的地址格式
Write strings to the device, encoded as ASCII, following Siemens' own address format

命名空间:  HslCommunication.Profinet.Siemens
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:9.6.2.0 (9.6.2.0)
语法
public override OperateResult Write(
	string address,
	string value
)

参数

address
类型:SystemString
数据地址
value
类型:SystemString
字符串数据

返回值

类型:OperateResult
是否写入成功的结果对象

实现

IReadWriteNetWrite(String, String)
示例
以下为三菱的连接对象示例,其他的设备读写情况参照下面的代码:
String类型示例
MelsecMcNet melsec_net = new MelsecMcNet( "192.168.0.100", 6000 );

// 简单的写入
melsec_net.Write( "D100", "ABCDEFGH" );

// 如果想要判断是否写入成功
OperateResult write = melsec_net.Write( "D100", "ABCDEFGH" );
if (write.IsSuccess)
{
    // success
}
else
{
    // failed
}
参见