NI產品與技術 討論區

取消
顯示結果 
搜尋替代 
您的意思是: 

DataSocket的OPC Client應用

大家好,我目前使用LabVIEW2013版,在撰寫OPC Client時,使用DataSocket 並附上OPC的URL,寫法如附圖所示

[+]放大圖片

 

 

但我發現如果沒有加上DataSocket Open 和 DataSocket Close,程式依然可以執行,且也可以讀的到值,如下圖所示

[+]放大圖片

 

 

 

這是什麼原因,不加Open和Close的話會有什麼問題嗎?  此外,DataSocket Write也是同樣的情形,可有版上前輩知道原因。

0 積分
1 條訊息(共 2 條)
5,128 檢視

這邊有一些關於DataSocket在使用上的討論,提供給你參考囉~

http://forums.ni.com/t5/LabVIEW/DataSocket-memory-leak-problem-2VO0SF00-more-info/td-p/615730

 

關於你提到的問題,在討論串中也有提到~

When you place a DS Read or Write VI on your block diagram with no DS Open or DS Close VI, it is going to open and close that reference everytime that Read or Write VI is called.  Therefore, it is basically the same as putting the DS Open and DS Close VI inside the loop, which will cause memory leaks.  This should be avoided.

0 積分
2 條訊息(共 2 條)
5,111 檢視