LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the purpose of open/close connection data socket?

Hello everyone,

 

I am writing and reading values in OPC Server through data socket. What is the purpose of open/close connection data socket when writing /reading a value?  Without the open/close connection element, it still work correctly. I am writing values in the server thru event stucture.I do not need any buffered reading or writing. What will happen if I didnt not use the open/close connection? Maybe it may cause some problems in my program which i didnt realise? 

 

 

And I have attached an example of my program. Thanks

 

Yehchia

0 Kudos
Message 1 of 5
(2,926 Views)

Hi Yehchia,

 

That's right, if you read/write a single value it makes no difference.

But when reading/writing thousands of them it's better to open the connection before and close it afterwords.

 

 

Christian

0 Kudos
Message 2 of 5
(2,902 Views)

Hello,

 

I am writing and reading multiple of signals. And I am using the open /close function. I would like to know what will happen if i didnt have it? 

Thank You

 

YehChia

0 Kudos
Message 3 of 5
(2,898 Views)

Hi YehChia,

 

I was talking about something like that:

 

17437i02572B6B48E36C4A

 

 

1. Not good. since with every iteration the DS connection needs to be opened and closed.

2. Good. Since you open the connection only once then do the reads and close it afterwords.

 

 

Christian

 

Message 4 of 5
(2,891 Views)

I see.. Thanks a lot for your information

0 Kudos
Message 5 of 5
(2,884 Views)