如何配置VISA串口传输某一字符时不会终止呢?
主要软件: Driver Software>>NI-VXI/VISA
主要软件版本: 1.0
主要软件修正版本:
次要软件:
问题: 我在通过VISA实现串口通信,并没有使用终止字符。我该怎样配置VISA才能使串口传输某一特定字符的时候并不会终止传输呢?
解答: 串口通常没有END指示符,为了和其它接口保持一致才规定了一个。要关闭这个功能需要设置两个VISA属性。Temination Character Enable 属性指定了接收到终止字符时读操作会不会终止。Serial End Mode for Reads 属性指定了终止读操作的模式。
在CVI中,使用 viSetAttribute 函数来设置这两个属性。
要设置的VISA 属性 | 函数中的属性名 | 函数中的属性值 |
Termination Character Enable | VI_ATTR_TERMCHAR_EN | VI_FALSE |
Serial End Mode for Reads | VI_ATTR_ASRL_END_IN | VI_ASRL_END_NONE |
LabVIEW 中,使用VISA property node来设置这两个属性。
要设置的VISA属性 | VISA Property | 属性节点值 |
Termination Character Enable | Message Based Settings>> Termination Character Enable | False |
Serial End Mode for Reads | Serial Settings>> Serial End Mode for Reads | 0 |
相关链接:
附件:
报告日期: 07/17/1997
最近更新: 11/30/2004
文档编号: 0ZGGD67N
Other Support Options
Ask the NI Community
Collaborate with other users in our discussion forums
Request Support from an Engineer
A valid service agreement may be required, and support options vary by country.