LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Which is better: Polling DataSockets(UpdatedData) or Polling through VI Server

I need a C++ program to monitor controls in a local instance of LabView. From my research, I have found two ways:
-I can use CWDataSocket ActiveX controls and poll the UpdatedData property for each control.
-Or I can Use the VI Server ActiveX Control and poll using GetControlValue().

I am wondering which is the better way. Is there a performance difference?
Any thoughts on this matter would be greatly appreciated.

-Clayton T.

P.S. I like that polling through VI Server decouples the VI control from my polling program. (Using datasockets, you have to explicitly setup each control to a datasocket. With VI Server, you just use the already available control name.)
0 Kudos
Message 1 of 6
(2,954 Views)
Hi Clayton,

Better? Can't say.

I generally prefer the VI Server approach. No only for the reason you mentioned but for timing purposes.

When I do the rad using VIServer, I know the value was valid sometime between when the VI Server operation is started and when it finishes.

The Datasocket data can be quite stale if you do not bend over backwards.

I am interested in how other feel about your quesion.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 6
(2,954 Views)
Thank you Ben. I wish there was a way I could get more people to discuss this topic. I have been wrestling with talking to this C++ program for over a week. I think I will stick with the VI Server approach for now.

-Clay
0 Kudos
Message 3 of 6
(2,954 Views)
"C++" is not the most appealing topic for many LV types.

The only reason I respond is because I used to do C ( but "I got better"). If you are willing to address the heavy hitters on this subject, try post to Info-LabVIEW. You may get a reply from Rolf, Greg, Jean-Pierre, or Uwe with this question.

I will keep my eyes open for your post.

In the event you do not know how to use info-LabVIEW, I have included the contents of a recent message that will get you started.

Ben

Quote:

This is the weekly admin reminder for readers of the Info-LabVIEW mailing
list and mail digest. (19oct01)

o Administrative issues such as SUBSCRIPTION and DELETION REQUESTS
MUST be addressed to the admin address, which is
mil>.

o To post to the list, mail to . DO NOT
send subscription and deletion requests to .

o This is a user list, run by and for LabVIEW users. If you have a
commercially available item to announce, please make the announcement
brief.

o It is not, ever, acceptable to post "virus warnings" to this list. For
any reason.

A set of Frequently Asked Questions (FAQs) for LabVIEW are available from
our web server at <>.

Tom Coradeschi, Info-LabVIEW List Maintainer

http://www.info-labview.org/

Un-quote
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 6
(2,954 Views)
Thank you very much Ben!
I shall try posting on info-LabVIEW soon.
On the "C++" issue, this is really a question on communicating 'real-time' LabView data with programs written in another language. The system I am integrating is a legacy system, but we want to add some new functionality in LabView, let it work, but see LabViews variables in our system.


Thanks again,
-Clay
0 Kudos
Message 5 of 6
(2,954 Views)
> The only reason I respond is because I used to do C ( but "I got
> better"). If you are willing to address the heavy hitters on this
> subject, try post to Info-LabVIEW. You may get a reply from Rolf,
> Greg, Jean-Pierre, or Uwe with this question.
>


You can post to info-labview if you like, but I follow both lists.

The short answer is that both of these will work. From the LV
programming angle, you will have just a little work to do with the
Datasocket implementation -- publish the control/indicator via
Datasocket or write to a diagram datasocket node.

The VI Server solution is less work -- make sure that the VI Server is
on, make sure the machine access is correct, and make sure the VI access
is correct.

From the C++
programming angle, both of these are going to be accessed
using ActiveX. One uses the automation interface for Datasocket, the
other for VI Server. The VI Server requires you to go through a few
more intermediate classes, but knowing what the VI name is, it shouldn't
be that difficult.

Greg McKaskle
0 Kudos
Message 6 of 6
(2,954 Views)