LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP psh and ack

does any one have any experience of sending psh on the end of a tcp write command,

 

is there a method of ensuring each write has a tcp [psh] push code added at the end of the string.

I would prefer to keep the tcp rather than visa libraries as these allow the tcp callbacks to determine data ready

 

Many Thanks

0 Kudos
Message 1 of 4
(4,677 Views)

Hi john_cvi_user

 

 

I hope you are well. 

 

I understand you would like to essentially concatiate a string to the end of your TCP write for example, your transmitted string may be "Hello World!" and you wish to concatinate "PSH" to the end of it so it reads "Hello World!PSH" 

 

If this is correct then you will be able to use the strncat function. 

 

Here is a screen shot taken from the CVI help file.

 

 

 

Kind Regards

Kevin R
Applications Engineer
National Instruments UK&Ireland
0 Kudos
Message 2 of 4
(4,631 Views)

Hi Kev

 

Thanks for the reponse, but I think you missed the point.

The tcp protocol uses flow control to determine whether communication is succesful. usually the receiver acknowledges the sender with an [ACK] to every message received, if the sender does not receive this [ACK] the sender retries. There is an option for the sender to add a [PSH] to let the receiver know this is the end of message and that it should now respond.

 

Adding [ACK] in the string would confuse the device listening, the [ACK] or [PSH] is not part of the message string but an additional structure on the TCP. Is there a method for setting up this in CVI.

 

 

0 Kudos
Message 3 of 4
(4,606 Views)

I have answered my own qusetion..

 

I was addressing the device as port 23 , which would allow open and communication, however if addressing port 8081 (equipment port address) the correct tcp protocol is then observed.

 

0 Kudos
Message 4 of 4
(4,595 Views)