LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

datasocket data retention

I am using datasocket read and write example.....examples are working fine....but one thing I want to improve is that last value of data read by dsread should stay when dswrite is stopped....

I mean currently when you start dswrite and dsread , dsread reads the data sent by dswrite.....then if you stop dswrite then dsread reads zero....what I want is when dswrite stops it variable at dsread should hold the last value instead of zero....

how to know that dswrite is stopped?

0 Kudos
Message 1 of 10
(2,999 Views)

Hi MSD;

 

have you read the context help for DSRead carefully? Have you read the explanations for all outputs?

Ever thought on using the "time out?" indication, that is provided by most data receiving functions?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(2,993 Views)

Thank you GerdW, I had seen the datasocket read context help and after your post I have seen it again, but I am afraid I am not able to make it out....can you tell me what I have to look at??? I have use time out also but not helping......

0 Kudos
Message 3 of 10
(2,979 Views)

I have solved the issue with using condition that each data beomes zero when either of vi stops....so I put one flag which goes zero in that case and I can retain data ......

 

Now but I have some new problem..............my datasocket vi works on "localhost" only ...when I try to use it on two different pc giving  source and target proper ip address respectively.......it gives error that operation timed out.....is there something more I have to do when I want to use it on different pc........

 

Help..... 

0 Kudos
Message 4 of 10
(2,966 Views)

Yup, there is some work that needs to be different.

 

If you're not on the localhost then you need to specify the remote host for the server rather than just the name - so you need to alter the datasocket addresses appropriatly to look remotely.

 

I think there are some settings you need to allow the communction as well on the server, but I can't remember what it is exactly - but it is in the help files of the server itself.

0 Kudos
Message 5 of 10
(2,960 Views)

I have altered some settings from server manager such as creators, readers ,writers, admins., changed to "Everyhost"..............apart from this what others I don't know yet........

0 Kudos
Message 6 of 10
(2,954 Views)

The other thing to make sure of is your datasocket 'addresses' then - are the client ones listed as dstp:\\localhost\datasocketvariable or as dstp:\\remotehost\datasocketvariable

 

If the client is looking on a local host for something that isn't being served there this will never work.

 

Not being sure how you're managing your datasocket connections (are they bound, are you using VIs and doing this programmatically) I can't tell you where to look for that path, but if you make sure that this is also going across computers it should help.

0 Kudos
Message 7 of 10
(2,946 Views)

Let me disect it further........

let say two pc are there in one network....let say PC1 & PC2...

Now PC1 runs DS writer and PC2 runs DS reader.....

 

Now address for PC1 is -  "dstp://PC1/wave"  written in Target variable of vi...

Now for PC2 the source variable would be - "dstp://PC1/wave" or something else?????? I have tried "dstp://PC2/wave" also but not working...

 

both pc can ping eachother.......

0 Kudos
Message 8 of 10
(2,939 Views)

It should be "dstp:\\PC1\wave" on PC2, and "dstp:\\localhost\wave" on PC1 - although that should still work with PC1 rather than loclalhost, with an appropriate access type at each end. Again, the method of coding the datasocket connection makes a difference to the advice that can be given - any chance you could post a couple of screen shots? I've got some that are bound, some that are communicated with via subVIs, so there are multiple options to sort this out. Give us a little more practical information and we can provide more help.

0 Kudos
Message 9 of 10
(2,931 Views)

Hey KathrynB!! Thanks a lot for replying....

 

As I said I tried suggested option on the DS writer and Ds reader vis given in Labview examples......its gives error that " network operation timeout".....

 

However, in those vis, there is a subvi called "Launch DS Server if Local URL.vi".......I was doubting if this vi should be included on reader side where address is refering to "PC1"....not localhost.....?

 

My first step is to work DS writer and DS reader run on two different pc in a same network......pc can ping and I changed settings of server manager mentioned in previous posts......

0 Kudos
Message 10 of 10
(2,924 Views)