NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
007Aland
Posts: 1
0 Kudos

回复: Simple TCP Messaging (STM)

I'm doing SBRIO9632 data collection system, communication is the Example, the requirement of STM Command Based Example-Client. Vi and STM Command Based Example-Server (RT). Vi. The server directly download SBRIO9632 inside RT system, however,can't communication

Member
annacm
Posts: 5
0 Kudos

Error 56 from STM Read Meta Data (TCP Ref).vi in CCC Client Init.vi

All, I'm very new to using STM.  The context is the CVT and CCC libraries.  I am trying to start the CCC server and then initialize the CCC client using some example code as a reference.  However, I keep getting a timeout error (error 56) from the STM Read Meta Data (TCP Ref) VI.  Can someone explain what exactly the meta data contains and where it gets written? 

 

I've attached my VIs.  They are very simple, as I'm just trying to get a better understanding of the CVT and what it does. 

 

Had to attach the XML tag file as a text file since xml isn't accepted.

 

Any help would be appreciated.  Much thanks!

Trusted Enthusiast
crossrulz
Posts: 3,723
0 Kudos

Re: Simple TCP Messaging (STM)


crossrulz wrote:

Is there any plan to put the STM into a package so I can install using VIPM?  It would be a great add on to the LabVIEW Tools Network.


I really like using the STM.  But it would be a lot easier to sell to coworkers if it was on the LTN.  Is there any plan to add STM to it?

 



Kudos always welcome for helpful posts...Kudos always welcome for any post.
Active Participant
Christian_L
Posts: 622

Re: Simple TCP Messaging (STM)

crossrulz,

 

Thank you for the feedback. In fact we are in the process of adding several of the popular reference designs including STM to the LVTN.  Please look for it there in a couple of weeks.

Christian Loew, CLA
Principal Systems Engineer, Embedded Systems
National Instruments
Please tip your answer providers with kudos.
Member
Quintin
Posts: 39
0 Kudos

Re: Simple TCP Messaging (STM)

I have an application in which I'm streaming data from a PXI RT target back to a host PC at roughly 0.5Hz.  The data that I'm sending back is typically an array of clusters (some elements are strings), from my benchmarking the data sizes are around 22kbyte for a single packet that gets sent.  The issue I'm running into is that over time, I seem to eventually get a 'Not Enough Memory to complete this operation" error popup in LabVIEW.  And the error popup coincides with the following errors in my code:

 

Timestamp

Source

Code

2013 01 19 05h 57m 40.840s GMT

TCP Get, DataPackets.  STM Read Message (TCP).vi<ERR>Header information was received but the complete message was not received before the specified timeout period.  This generally indicates a poor or broken connection.

Code:  537650

2013 01 19 05h 57m 40.940s GMT

Consumer Loop, Get Pkts.  STM Read Message (TCP).vi<ERR>Header information was received but the complete message was not received before the specified timeout period.  This generally indicates a poor or broken connection.

Code:  537650

2013 01 19 05h 57m 41.596s GMT

TCP Get, DataPackets.  Unflatten From String in STM Read Message (TCP).vi:1->TCP Send Receive - PC.vi->PXI Data Receiver.vi->CSC-205 - Display.vi

Code:  74

2013 01 19 05h 57m 41.696s GMT

Consumer Loop, Get Pkts.  Unflatten From String in STM Read Message (TCP).vi:1->TCP Send Receive - PC.vi->PXI Data Receiver.vi->CSC-205 - Display.vi

Code:  74

2013 01 19 05h 57m 41.897s GMT

TCP Get, DataPackets.  Unflatten From String in STM Read Message (TCP).vi:1->TCP Send Receive - PC.vi->PXI Data Receiver.vi->CSC-205 - Display.vi

Code:  74

2013 01 19 05h 57m 41.997s GMT

Consumer Loop, Get Pkts.  Unflatten From String in STM Read Message (TCP).vi:1->TCP Send Receive - PC.vi->PXI Data Receiver.vi->CSC-205 - Display.vi

Code:  74

2013 01 19 05h 57m 42.697s GMT

TCP Get, DataPackets.  STM Read Message (TCP).vi<ERR>Header information was received but the complete message was not received before the specified timeout period.  This generally indicates a poor or broken connection.

Code:  537650

2013 01 19 05h 57m 42.797s GMT

Consumer Loop, Get Pkts.  STM Read Message (TCP).vi<ERR>Header information was received but the complete message was not received before the specified timeout period.  This generally indicates a poor or broken connection.

Code:  537650

2013 01 19 05h 57m 42.998s GMT

TCP Get, DataPackets.  TCP Read in STM Read Message (TCP).vi:1->TCP Send Receive - PC.vi->PXI Data Receiver.vi->CSC-205 - Display.vi

Code:  2

 

I'm wondering what is causing the partial header and corresponding corrupted data that causes the not enough memory issue to occur.  Am I sending to large of chunks of data?  Are data packets that are being sent from my PXI building up at the PC and then my PC code is trying to convert to large a block of data?  My timeout for the TCP Read that the error 537650 refer to is set to 500ms.  I haven't tried increasing that yet to see if that makes a difference.

 

Any thoughts or insight in appreciated.

Quintin

Active Participant
ryank
Posts: 310

Re: Simple TCP Messaging (STM)

The out of memory could be caused if you get an offset in your data stream that causes the STM library to use a random byte for the size (which often results in trying to read a really big message size).  If you roughly know the size of your data it's a good idea to modify the library and put in an upper bound on the message size that throws an error if it get's the wrong size.

 

Of course that begs the question of what is causing you to get that offset in the first place.  It could be a few things, but I think given your situation it's likely you are overflowing one of the buffers at some point, most likely the write buffer on the RT target.  Different targets behave differently when that happens, I know that VxWorks throws an error and that Windows doesn't.  I'm not sure if I ever tested it for Pharlap, but my guess would be that it behaves more like Windows.

 

My suggestion would be to try sending smaller chunks of data, perhaps sending each cluster in the array separately rather than sending the entire array at once.  Assuming the clusters are already reasonably large that shouldn't affect your streaming performance much.

 

You may also need to increase the speed of the reader if it turns out you are overflowing the write buffers.  The best way to do this is probably to take a close look at your data structure and decide if it's the best way of streaming the data.  An array of large clusters with variable sized strings is going to be hammering your memory manager on both sides, and you probably end up doing a lot of indexing and unbundling/rebundling, which can be expensive.

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page