LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Datasocket Write error 1180 Pending operation in progress

Hello everyone!

 

This issue has been discussed several times in the past, since 2002 till 2006/2007 (as the latest posts indicate), however very few are with solutions marked or the Author indicating "final relief" in the question thread.

 

Hence posting again.

 

The problem is, while multiple DataSocket Write operations occur, in two parallel loops, either of the DataSocket Write function throws error 1180, description "Pending operation in progress."

 

My original application is quite big, so I didn't figure out the problem source in the beginning. Because, running the program with execution highlighted produced no error and everything worked as desired. Running the same program in the real-time mode prompted the error, meaning something was about the parallel processes being handled at the same time. I suspected the wired functions are not being handled properly, when the same type of "sources" were in operation. Even thought of using Semaphores. But it doesn't look a good solution. The whole program will become badly worked.

 

The attached programs, one (MultipleDS-Write.vi) with DS write operation and the other (MultipleDS-Read.vi) with DS read operation, are just to highlight the problem. If you run the "Writer" program in highlighted mode, you will have no error, but if you run it without highlighting execution, you will have an error message from one of the loops.

 

As for the solutions suggested in all past threads -

  1. I have selected "everyhost" in DefaultReaders and DefaultWriters in DataSocket Server Manager (DSM).
  2. I have added a new item, and called it "msgA" in DSM (Predefined Data Items), and checked "Allow Multiple Writers".

My questions finally -

  1. What should I do now for multiple Datasocket functions to do write operation on the same item? Logically, one of the functions should wait for the write access until timeout (10 seconds in the given examples), before giving an error. But, it doesn't happen.
  2. Regarding the 2nd point above, how should one define an Array in the Predefined Data Items, for it to be allowed for multiple writers? After searching unsuccessfully, I finally created an item, named it as my datasocket item, and selected String (for a String Array datatype). Is this the correct method?

 

Would highly appreciate a concrete answer (and not just reading some material, which "might" help). (sorry for being "blunt" but this issue has been very much ignored in several past threads.)

 

I am working with LabVIEW 8.6.

 

Thanks ahead!

Download All
0 Kudos
Message 1 of 9
(5,039 Views)

No responses yet!?!! Smiley Sad

0 Kudos
Message 2 of 9
(5,016 Views)

Hi LASAP,

 

In your write VI, you're using a single reference for both DS Write VIs.  Can you try created two separate connections to the datasocket?  This may be the problem you're seeing.

Jared S.
Applications Engineering
National Instruments
0 Kudos
Message 3 of 9
(4,972 Views)

Hi Jared,

Thank you for the reply.

 

I have used the single reference in the both write operations because this particular reference is for one particular type of message (intended for specific users from a certain category).

 

In my original system, I have 4 types of users, call them A, B, C, D. So I have created 4 different DataSocket references (in fact more than that, many being dynamically created during system run-time).

So, the system (or any user) would write to DS reference A only those messages intended to users of type A (which may include 50 different users). This was just to avoid cluttering a lot of data into a single DS item. All the users of type A would just keep reading DS reference A continuously.

So, this is very much esential that multiple write operations happen on single item.

 

Or perhaps you may suggest some other way to do so. If different applications write messages on different DS items/references, how would any user application read all these data at once, and how would he know if the message is for him or for another user of the same name, but of different category (I have a "header" in each message, which shows the user name, but there could be two different users of same name in two separate categories).

I hope I made my requirement clear.

Thanks!

 

0 Kudos
Message 4 of 9
(4,964 Views)

To cut long story short, if I create two different DataSocket references, how would I read them all in a single DataSocket Read function (referring to a single item perhaps, and which item that would be out of the two different)?

0 Kudos
Message 5 of 9
(4,963 Views)

@jareds wrote:

Hi LASAP,

 

In your write VI, you're using a single reference for both DS Write VIs.  Can you try created two separate connections to the datasocket?  This may be the problem you're seeing.


Hi Jared,

 

Writing again, simply asking, if I create two separate connections to the datasocket, how would the reader application read all the messages? I need a reader to read all the messages written by different writers.

 

As I understand, each DS reference has its own messages/data. One cannot read in item B something that was written in item A. Right?

0 Kudos
Message 6 of 9
(4,937 Views)

@LASAP wrote:

@jareds wrote:

Hi LASAP,

 

In your write VI, you're using a single reference for both DS Write VIs.  Can you try created two separate connections to the datasocket?  This may be the problem you're seeing.


Hi Jared,

 

Writing again, simply asking, if I create two separate connections to the datasocket, how would the reader application read all the messages? I need a reader to read all the messages written by different writers.

 

As I understand, each DS reference has its own messages/data. One cannot read in item B something that was written in item A. Right?


 

As I understand it yes that is true for the reference but not the DS itself.

 

Almost sounds like you want the DS to act like a queue but...

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 9
(4,932 Views)

@Ben wrote:

@LASAP wrote:
Writing again, simply asking, if I create two separate connections to the datasocket, how would the reader application read all the messages? I need a reader to read all the messages written by different writers.

  As I understand, each DS reference has its own messages/data. One cannot read in item B something that was written in item A. Right?

 


 

 

As I understand it yes that is true for the reference but not the DS itself.

 

Almost sounds like you want the DS to act like a queue but...

 

Ben

 


But...? I supposed DS works like a queue (at least in this aspect). No?

 

And what do you mean by "...true for the reference but not the DS itself" ?

0 Kudos
Message 8 of 9
(4,923 Views)

I tried Ben's suggestion as a workaround to the multiple simultaneous writers problem, and it will work.  In this case you'll have 2 writer connections (each with its own buffer) connected to the same data socket item on the server (with its own buffer).  If writes on the two connections are occurring in parallel, data will eventually get forwarded from each client buffer to the server buffer.  The data will get interleaved in some non-deterministic fashion on the server, but it should all get there.  Presumably this is OK for your application.  You can then create a separate client connection for the reader (with its own buffer), and it should see the combined results of the two writers.  However, if you have multiple reader connections, you're going to get duplicate data on each reader which probably won't be very easy to deal with.

0 Kudos
Message 9 of 9
(4,826 Views)