LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP IP multi client connection is not working properly

Solved!
Go to solution

hope you were able to open my latest files

0 Kudos
Message 21 of 31
(1,313 Views)
Solution
Accepted by topic author ritch_by_nature

I'm still concerned about your lower while loop.

 

You dequeue an element inside the while loop to just display it.  In the subVI inside that same loop, you obtain a reference to the same queue, flush it, then release the queue reference.  Then you log the data that came out of the flush operation.

 

What are you really trying to do with this?  It seems to me you should just be dequeuing the element and logging that to the file.  The whole queue flush thing is just a big conflict with trying to read from the queue.

 

(You also had some broken wires in there.  And your project refers to a lot of other VI's that are just missing.)

0 Kudos
Message 22 of 31
(1,304 Views)

@RavensFan Thanks for the reply. That lower loop  in my client is to save the data that I am getting from the server. Thanks that solve little issues I had with that loop also. Needless to say I have to learn more about queues.

but my main issues is my server throwing error 1122 refnum invalid when I swith my cleint from cdaq to waveform.

Latest version is attached

 

Admin Note - VIs removed per user's request.

0 Kudos
Message 23 of 31
(1,299 Views)

@altenbach thansk for your help but other issues emerged after that fix.  here are my problems.

 

I have a client/server apps i am building. The server has two features cDAQ and waveform generator. it goes to the waveform generator as a default mode intentionally.  The client sends the command to change the server from cDAQ to waveform generator data mode. If i run the server it goes in waveform mode first until the client is on and sends command to tell it to switch. When I turn on the client and set it to cDAQ mode, you get the waveform data first then you get the cDAQ data. I think that will affect my data somehow. I was wondering if there is a way I have it only collect data when the client is on that way I can only get the set of data I want. Or is there a way to clear the buffer in the server once the client is on before it writes the data to the client.  If run the code succesfully, you will notice the issue. The same thing would happen if I set the server to run first in Cdaq mode. Once I turn on the client in waveform mode, I will get cdaq data first then once the server receives the packet from the client then I get waveform data. You will notice a delay when the server switch from waveform to Cdaq.

Suggestions are welcome. 

client name is: Mockup Client.vi

server name is: NEW SERVER1.vi

control type def is ALL data control.ctl

Im using a cdaq9172 with 5 NI cards. the server is programmed to run like that only

 

Admin Note - VIs removed per user's request.

0 Kudos
Message 24 of 31
(1,193 Views)

@ritch_by_nature wrote:

 

but my main issues is my server throwing error 1122 refnum invalid when I swith my cleint from cdaq to waveform.

 


I'm not sure what you mean by that.  How do you switch a client from a cdaq (a device) to a waveform (a datatype)?  Where in the code are you doing this?

0 Kudos
Message 25 of 31
(1,185 Views)

It is more like a a simulated data and a collected data. The waveform generator is made with the wave.vi function then I bundle that array of data with timestamp and DT to make it a waveform. I do the same for the array of data coming from the DAQmx read.

0 Kudos
Message 26 of 31
(1,185 Views)

@altenbach The updated server I attached should not be throwing error 1122. That  is fixed now

0 Kudos
Message 27 of 31
(1,183 Views)

@althebach,

    attahced is my latest update and I am still having the same problem

 

Admin Note - VIs removed per user's request.

0 Kudos
Message 28 of 31
(1,148 Views)

@ritch_by_nature

Can you please share a screenshot of the part of the code where you ae doing the switch from collected data to simulated data. I tried opening the "Server-ClientNew.lvproj" project, but got an error about some files missing. Also, please specify the VI name to look in.

Regards,

Tanim
National Instruments
0 Kudos
Message 29 of 31
(1,126 Views)

Inside Mockup client.vi is where i do the switch.  That is not included in a subVi. but the server "New Server1.vi is doing the switch once it receives the command in the producer loop. im still trying to understand why do you get an error. Because I put everything that is included in it. Which error do you get?

0 Kudos
Message 30 of 31
(1,119 Views)