LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with DataSocket

Hi

I am using datasockets to connect to a third party program which drives a
DAQ system (Fluke DAQ with a 2680 system). That program comes with an OPC
server which publishes the measurement data. With Labview I can subscribe to
this data using datasockets, and this runs fine for most of the time.
However, I occassionally get problems where the OPC server of the third
party program seems to generate an error (it mentions it can not write data
to memory and then crashes). The Labview program which contains the
datasocket connections hereafter also crashes (If I build an application
only the application crashes, if I run it from the Labview development
environment, the complete development environment crashes).

I tried with datasocket connections v
ia the front panel as well as with
connections programmatically entered. Both seem to give the same result.
Anybody an idea from which this instability results or any suggestions which
could improve stability ? I understand that my third party program may be
the original cause of the problem, but I do not understand why Labview is
crashing as it is in fact only "listening" to the results published.

Thanks

Martien
0 Kudos
Message 1 of 6
(3,837 Views)
Hello Martien,
Thank you for your inquiry regarding LabVIEW DataSocket. I understand LabVIEW crashes when the third party OPC server generates an error. The DataSocket Read.vi in LabVIEW 6.02 does not correctly handle shutdown of the Lookout Protocol Driver (LPD) OPC Server. The DataSocket Read VI (with wait for change = false) does not indicate any errors if the Lookout Protocol Drivers OPC Server crashes or is manually shutdown. Instead, it continues to read the last good value from a previous call to DataSocket Read.vi. This causes LabVIEW to crash. If you are using LabVIEW 6.02 one possible solution is use a DataSocket Read.vi from LabVIEW 5.1 VI primitives. However, this problem shouldn�t occur on LabVIEW 7.0.

I hope these resources help. Let me know if I can
further assist you.

Shea C.
Applications Engineering
0 Kudos
Message 2 of 6
(3,836 Views)
Dear Shea,

Many thanks for your answer. I am running Labview 6.i (version 6.0) so it is
likely that my problem is caused by the reason you are describing. However,
I found on the NI website some discussion on the compatibility of DataSocket
with OPC servers, where it was mentioned that the OPC examples shipped with
Labview 6 are actually those present in earlier versions (so I assume these
are the primitives from 5.1 you are referring to, is this assumption correct
?). I have used one of these examples (NI Demo OPC Client.vi) to connect to
my third party server where I canged the server and item name to my third
party server characteristics. This runs well but also here I manage to crash
Labview completely when the Third Party Server crashes. Given this effect, I
have not yet recoded my Labview client to use these primitives which I
assume then to be located in Labview 6\vi.lib\Platform\dataskt.llb.

Reading the NI website I might have found a reason which makes my Third
Party crashing anyway, which could be due to Labview (though right now I am
already blaiming my third party software supplier). As I use the 6.i
Datasocket primitives, it says that for every read instruction in my client
program it opens, reads and closes the connection. This repeatedly opening
and closing may overload the OPC server (which indeed crashes during my
tests while giving a message that it has found a problem to wrtie something
to memory). I am not sure yet, but I am now testing my Labview client at a
higher speed which generates more data reads to see if my third party server
crashes now more frequently (up to now it crashed every couple of hours
while I am reading about 60 data items every second so I am now testing at a
10 times higher speed).

Any further suggestions,

Martien




"Shea C" wrote in message
news:5065000000050000003A5F0100-1077587809000@exchange.ni.com...
Hello Martien,
Thank you for your inquiry regarding LabVIEW DataSocket. I understand
LabVIEW crashes when the third party OPC server generates an error.
The DataSocket Read.vi in LabVIEW 6.02 does not correctly handle
shutdown of the Lookout Protocol Driver (LPD) OPC Server. The
DataSocket Read VI (with wait for change = false) does not indicate
any errors if the Lookout Protocol Drivers OPC Server crashes or is
manually shutdown. Instead, it continues to read the last good value
from a previous call to DataSocket Read.vi. This causes LabVIEW to
crash. If you are using LabVIEW 6.02 one possible solution is use a
DataSocket Read.vi from LabVIEW 5.1 VI primitives. However, this
problem shouldn't occur on LabVIEW 7.0.

I hope these resources help. Let me know if I can further assist you.

Shea C.
Applications Engineering
0 Kudos
Message 3 of 6
(3,836 Views)
Martien,

I wasn't aware that the DataSocket functions in 6.x had the Open and Close function built into the Read and Write VIs. LabVIEW 7.0 allows you the functionality of opening the DataSocket session and then reading or writing in a loop before closing the session. In your application, I assume that you are reading from the server in a loop. Do you have a delay built into the loop or is it making calcuations as fast as it can? It is always good to have a delay built into any while loop. One solution may be to increase the delay. Give these things a try and let me know what you get after running a a higher speed too. Hope this helps.


Shea C.
Applications Engineering
0 Kudos
Message 4 of 6
(3,836 Views)
Dear Shea,

Thanks for your reaction. I have indeed always programmed a delay in all the
loops. With the version 6.x data sockets I can indeed make my third party
OPC server to crash after some time. In my application it maybe happens only
once a week (the application is "slow" as it requires only a measurement
every 20 seconds, it must however be robust, since I am controlling some
climate rooms with the data measured). By increasing the data socket reading
frequency (say to 10 times per second), I could indeed make the OPC server
crash after some hours.

I am now using the version 5.x data sockets with an open and close function
outside the loop. Since then, I have not been able to crash the OPC server,
even at high reading frequen
cy. I am obviously not happy having to use
primitives of earlier versions of Labview. I understand that within 7 this
issue has been solved, but it has not been possible yet for me to migrate.

Thanks for your help.

Kindest regards,

Martien


"Shea C" wrote in message
news:506500000005000000D6600100-1077587809000@exchange.ni.com...
> Martien,
>
> I wasn't aware that the DataSocket functions in 6.x had the Open and
> Close function built into the Read and Write VIs. LabVIEW 7.0 allows
> you the functionality of opening the DataSocket session and then
> reading or writing in a loop before closing the session. In your
> application, I assume that you are reading from the server in a loop.
> Do you have a delay built into the loop or is it making calcuations as
> fast as it can? It is always good to have a delay built into any while
> loop. One solution may be to increase the delay. Give these things a
> try and let me know what you get after running a a higher speed too.
>
Hope this helps.
>
>
> Shea C.
> Applications Engineering
0 Kudos
Message 5 of 6
(3,836 Views)
Martien,

I wish that I had another solution for you. Seems hard to troubleshoot when it only happens once a week. But for robust applications this is too much! I'm gald that you've resolved the problem to a degree and you should get your hands on a copy of LV 7 when you have the opportunity.

Shea C
Applications Engineering
0 Kudos
Message 6 of 6
(3,836 Views)