使用搜索功能查看 Kepware 的信息库,其中包含 500 多篇知识库文章。缩小搜索结果范围,或在下面的搜索字段中输入您的查询。

或者,如果您无法找到解决方案,我们还有另一个资源:我们的 PTC eSupport Portal。 如果系统提示您登录 eSupport Portal,您可以使用“我的 Kepware”凭据。需要一个“我的 Kepware”帐户吗?在此处创建

搜索解决方案结果:
View All Solutions

Kepware Knowledge Base: Solution


Sending an On Followed by an Off when Receiving Data from Device


Last Update: 2018/11/7

This action is ideally done with a client application for a write. The following example code displays a read transaction in which "on" and "off" are sent to a device as a result of a value that was read from it.

Step, Command, Value/Format, Description
1, Write Character, 2 0x02 STX, Start Byte
2, Write Device ID, 8 Bit Intel Hi, Device ID
3, Write Character, 42 0x2A *, Request Data command
4, Write Character, 3 0x03 ETX, End Byte
5, Transmit
6, Read Response, Wait For Character, 3 0x03 ETX
7, Test Character, 9 0x09 HT, Test Response Data Source, Read Buffer, , 4 True Action, GoTo, Toggle False Action, End,
8, Toggle, N/A, Action for "True" test result
9, Write Character, 2 0x02 STX, Start Byte
10, Write Device ID, 8 Bit Intel Hi, Device ID
11, Write Character, 42 0x2C ,, Toggle Trigger
12, Write Character, 1 0x01 SOH, Write On
13, Write Character, 3 0x03 ETX, End Byte
14, Transmit
15, Pause, 30msec, Wait 30msec for device before sending next data (optional)
16, Write Character, 2 0x02 STX, Start Byte
17, Write Device ID, 8 Bit Intel Hi, Device ID
18, Write Character, 42 0x2C ,, Toggle Trigger
19, Write Character, 0 0x00 Null, Write Off
20, Write Character, 3 0x03 ETX, End Byte
21, Transmit
22, End, N/A


Note:
The optional Pause Transaction command allows the device to rest in between writes.