使用LabVIEW打开和关闭COM端口
我正在使用 LabVIEW 打开一个 com 端口并获取一些数据。之后,我关闭界面。但是当我想再次开始该过程时,会生成错误。我觉得我必须完全关闭端口才能再次打开它,但该怎么做呢?
I am using LabVIEW to open a com port and get some data. afterwards, I close the interface. but when I want to begin the process again, there is an error being generated. I feel I have to close the port completely before i open it again, but how to do so?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案就在问题中:您只需在最后关闭 VISA 会话即可。原因是,当您第二次打开它时,它仍然是第一次尝试打开的,这会导致错误(您看到的错误)。
The answer is in the question: you just have to close the VISA session at the end. The reason is that when you open it a second time, it is still openned by the first try which results in an error (the one you see).