wait on tcp read

I'm sure this is a total noob question, but here it goes.

I have a test machine that spits out data on a serial line after each test (about 1 or 2 minutes).  This unit is not near my pc, so it has a serial number to ethernet connected to it.  Everything is fine with the data to my pc but I don't know when the test is finished.

My only solution is to stay connected while is Read.vi of TCP in a loop and ignoring the timeout error (56).  I don't want the entry timeout to be set to infinity, because if, for some reason, the test never ends, my program is stuck.

Any ideas?  Your contribution is greatly appreciated.

programmindragon wrote:

My only solution is to stay connected while is Read.vi of TCP in a loop and ignoring the timeout error (56).  I don't want the entry timeout to be set to infinity, because if, for some reason, the test never ends, my program is stuck.

Any ideas?  Your contribution is greatly appreciated.

I have an idea... it's the same as your idea . Set a time-out and clear errors if you get the error 56. I wouldn't set up in 2 minutes, because, as you say, in this case, your program could potentially take 2 minutes to stop. I would have put something like 200 ms (random value I took.).

Tags: NI Software

Similar Questions

  • How fast can get a TCP read?

    LV 2009 + WIN 7 with 6 GB of Ram.

    I acquire two analog channels as a word of 16 bits each and adding a CRLF at the end example: 1234 567 \r\n

    These data are acquired to 50ms intervals and sent over a link WiFi for my notebook running code LV.

    I know not how fast the "TCP - Read" function can work and which mode (it has four options) to choose if I do not miss any incoming data...

    Now I get some data in French - initially rather quickly and after a few seconds, it slows down the consdierably. I'm running the TCP-read inside a timed loop and I tried various intervals from 10 ms to 500ms. The largest value works OK, but I need the fastest possible. Tips how to handle this?

    My code is attached. (The passage DIO works very well)

    Even if the passage DIO works, it doesn't make sense to use a sequence structure.  It would be better to change the Standard mode and the 100ms Timeout value instead of "wait for next"millisecond"Multiple" as leading to uneven wait times.

    TCP Read should run very quickly, subject to any waiting period that you set.  You should never lose data in any mode, although there is a possibility to receive a partial when you use Standard mode or immediate (unlikely in your case since you read so little data).  The operating system will be buffering of data not read for you.  If you want the fastest possible exchange, divide your code in two while loops, one for EID and the other for the series.  Serial communication can be simply a normal life while loop, with the reading of TCP dictate the timing.  Set a long timeout in buffer mode and the loop will run as quickly as it receives data.

    Also, when the loop ends, you must close TCP connections, not just one of them.

  • TCP Read blocks remote Port

    Hello

    I want to read a string of NMEA (1 Hz update rate) of a server. The original NMEA (series, 4800 baud rate) is converted by a MOXA to TCP.

    Here is my minimum program, I normally have a timer "wait until 1000ms" inside.

    The problem is that the MOXA closes its other port every minute. I can still read, but everyone else is blocked.

    Other Terminal programs work. The network guy told me that he sees a lot of traffic from my address and he thinks that, at some point, the MOXA is confused and shut its ports.

    Is there a possibility that read TCP sends a string of status or failure?

    azavarsky wrote:

    Hello

    I want to read a string of NMEA (1 Hz update rate) of a server. The original NMEA (series, 4800 baud rate) is converted by a MOXA to TCP.

    Here is my minimum program, I normally have a timer "wait until 1000ms" inside.

    The problem is that the MOXA closes its other port every minute. I can still read, but everyone else is blocked.

    Other Terminal programs work. The network guy told me that he sees a lot of traffic from my address and he thinks that, at some point, the MOXA is confused and shut its ports.

    Is there a possibility that read TCP sends a string of status or failure?

    How fast this device sends its strings? -What is simply spit data without any query command to be sent? If so your Moxa can be a problem too, because he doesn't know what to do with the data if there is no client connected to read. Also your Moxa converter can struggle to serve more than one client TCP on port even anyway. What should you do if several clients try to access the same port? Send the same message to everyone? Or send the incoming message randomly to one of them?

    Do you get your TCP read once errors Moxa "closes" the port as you say? If so you should terminate your loop on any error except maybe a timeout error and reopen the port in a second outer loop until your program wants out. Your loop never stopping on the errors will prevent the close TCP to run that will keep open socket and prevent the Moxa to see good handshake that the connection has been properly closed by the customer, which will probably prevent the Moxa device able to accept new connections. Network communication can be tricky and one of the first things you have to learn is the appropriate error handling. No matter what mistake anywhere in the network connection, usually error timeout on reading, with the exception should be managed by closing the connection and tries to reconnect.

  • TCP read bytes to read

    Hello! I have a small question on ports TCP read palett in labview, im trying to send 1 bit from a server to a client. This works when I put 4 digital in the bytes to read TCP entry read client-side. But when I change the value to 1, as it should be efficiant, this work dosent. Any ideas?

    Your number of bytes value is a number of I32 (32 bits, or 4 bytes), so you send 4 bytes followed by 1 byte for the boolean itself.   You can convert the number of bytes in an I8 to make a byte (but I wouldn't bother because the IP header information is the number of bytes, which means 1 to 4 bytes means little).

  • LabView TCP read

    Hello

    I'm reading the data from a personal weather station which is transmittng data to a web site using a bridge.  I can see the data transmitted with WireShark, so I know the bridge works and the data is there.  Also the data are learning web site.

    I want to read that data, using LabView, it is sent to the web site.

    I tried the TCP connection open with the TCP Read function and also the TCP Listen.vi with the TCP Read function without success.

    I have attaced the two screws and also a page of WireShark.

    A question I have is how do I know what port to monitor?  It continues to change in WireShark?

    Any help is appreciated.

    Perry

    TCP in LV functions are not sniff the functions. They are used for the direct connection from point to point.

    If the web site supports getting data back, you can try to contact and to read the data in (probably use the HTTP or web service screws, according to the API provides the site).

    Otherwise, you could try to imitate the BT site and having the unit send you data, but probably the address of the site is hard coded into the device. You could probably play with it to feign a DNS server which will redirect to your computer, but you should always know what the API to send data on the site.

    A third option is to do the desired sniffing. LV has no functions for this, but you can find wrappers that people wrote for WinPCap, that might do what you want. I've never used, so I don't know.

  • interpretation of TCP read the output string

    What is the right method to interpret the data from the TCP Read function? The output is a string of characters, which are obviously not hexadecimal values. How can I convert the string to a binary table or bytes?

    OK, time wild guess...

    The first four bytes are an indication for SYNCHRONIZATION

    The four bytes 0 4 0 0 is a 32-bit integer, GIS bytes less first. 1024

    Then you have 6 0 0 0, which could be another 32-bit integer, lsb first. 6

    Then your random data

    Rod.

  • Stop listening tcp and tcp read

    Hi all

    If I use tcp and tcp listening read blocks with a time of judgment-1, how to prevent their execution if they are waiting for incoming connection or data?

    The read block tcp is in a while loop and the State of the stop button is not evaluated, because the reading block is pending.

    can someone tell me a solution compatible with the S-RIO target device problem?

    Thank you

    Hi giac82,

    I know you want to just close the server. You can create your own connection to the listener. You need another loop for it.

    See the attached picture. This is only a small example. You can do more complex to react on the different statuses.

    Mike

  • little binary string in array (of TCP read) to the table of Boolean LV (and back)

    I would like to ask what is the easiest way for the next conversion? We use aTCP Read function to read an incoming binary string to a S7 API using LabVIEW. We know that LabVIEW stores a Boolean value to 8 bits. The incoming binary string contains 14 bits (representing 14 indicators of status). What is the best way to convert these values of 14-bit LabVIEW Boolean table?

    In addition, we send a LAbVIEW Boolean table in the PLC data (to write a TCP) string containing status bits.

    Thank you very much!

    Martins wrote:

    This 30 bytes contains some data more, including 14 bit flags (size is 14 bits). Since the PLC cannot put 'together' (16-bit) words at his side before sending data TCP, 14 bits is padded with 2 bits holding no valueable info.

    Then the solution is simple.  Take your 2 bytes and unflatten in a U16.  Then use Boolean table number.

  • TCP Read and Write at the same time

    Hello everyone,

    I have a question about parallelism in TCP connections.

    I know that it is possible to read and write on the same connection ID.

    So, if you ReadTCP and WriteTCP block each other, if you use the same TCP connection ID?

    Or to request more precise if I run two while loops, in parallel, with one end by calling WriteTCP and the other called ReadTCP.

    one of the delay of loops (or block) will be the other if both loops call their VI TCP at the same time right?

    The system is Windows 7 and Labview 2012.

    Kind regards

    Sebastian

    They are perfectly parallel.  Just write in one and read it from the other.  There is no conflict.

    See My TCP articles for more details.

  • Writing TCP TCP read of the same VI.

    Hello

    I want to write data to a c program and also read data from it just after grace to a TCP connection. How can I implement both options in a single VI.

    I send you pictures of pixels values - program, then technology will send the berries to me. I made a suggestion, but I don't know if it is correct or not.

    The VI is downloaded and shown in the image below

    Yes, you can read and write to the same connection. Why would it be possible? I do not understand why you ask the question. Did you try and have a problem? If you don't try it, you might at least have opened one of the many TCP examples delivered with LabVIEW and illustrate this, you have not even need to write new code to see. If you have a problem, then ask for it specifically on this issue.

  • Modbus tcp read holding registers return not requested quantity

    Background: I have a client using ELAU motion system - they record data with records they want to be able to read on a cRIO match with some analog FPGA data (I have digital handshaking going on for this).

    LabVIEW 2010 SP1

    cRIO-9074

    With the help of the library of VI of MOdbus.llb OR communicate with the other system.  I can open the TCP communication without problem and actually get SOME records, but not ALL registry data, I want to read.

    I want to do is read the registers individual operating 330 U16 values.  I know how the data are split to represent different lengths (i.e. most of the data items use 2 records number represent a 32 bit).  I want just to read all of the individual records and analyze the data in another VI to convert it to other data types.

    I provided the .vi MB Ethernet Master Query (poly) with the starting address for the first register, then the amount of 330.  The polymorphic instance selected is "reading record keeping.  The array returned by this VI via 'Holding Registers' is only 74 elements and not requested 330.  I have no exception code and no error in LV.  Is there some intrinsic limit, i.e. the number of Holding Registers that can be read?

    I do not use the (not sure if necessary) MBAP header entry.

    Thank you.

    Simple solution once I dug in the series MODBUS/TCP protocol protocol documentation out there via Google.

    History of the modbus function series is the limitation that carried over TCP - the maximum amount of bytes in the pack a data can be only 256 bytes.  So I was limited to approximately 125 ~ records at a time.

    256 bytes is 2048 bits.  The use of the 16-bit registers which gives maximum 128 registers.  I went with 125 followed making easier totals.

  • ORA-19102: literal string XQuery waited while xmltable reading using the clause of passage

    Hello

    I have the following XML in the column tmp_xml in the tmp_medimail_accounts table:

    " < = xmlns:env env:Envelope ' http://schemas.xmlsoap.org/SOAP/envelope/ ">

    < env:Header / >

    < env:Body >

    " < its: findAccountByCriteriaResponse xmlns: its = ' http://session.kernel.CMP.com/ ">

    < return >

    < detailedInfo > accounts found: 1 < / detailedInfo >

    < operationResult > MPROXY_RESULT_OK < / operationResult >

    < value >

    < authCertificate / >

    < autocertificationActive / >

    < boolAck > true < / boolAck >

    < caDomain > BE_AUTO < / caDomain >

    < certified > false < / certified >

    < City > BELSELE < / City >

    < commercialAction / >

    < country / >

    < description > MediMail 3.7.4 < / description >

    other < dmi > < / dmi >

    < emailForward > false < / emailForward >

    < enabled > true < / enabled >

    < encCertificate / >

    medidoc < encodingType > < / encodingType >

    < etk / >

    < fax > LDAP this field is masked by the SECURITYFILTER < / fax >

    PC < firstName > < / name >

    < inami > 72091883000 < / inami >

    < institution > pc sint hieronymus < / institution >

    < language > NL < / language >

    < name > sint-hieronymus < / lastName >

    < lastconnectiondate > 20140115090051Z < / lastconnectiondate >

    < localeStr / >

    PC.Sint - hieronymus of < connection > < / login >

    < mail > [email protected] < / mail >

    < mexiAddress > pc.sint-hieronymus.72091883@BE_AUTO < / mexiAddress >

    < mexiBackup / >

    < mobilephone > LDAP this field is masked by the SECURITYFILTER < / mobilephone >

    < niss / >

    < oldIP / >

    < oldSystemId > 720918 < / oldSystemId >

    < packageName > M < / packageName >

    This LDAP is hidden by the SECURITYFILTER field < password > < / password >

    < pin / >

    < pkey / >

    < pkeyehealth / >

    < main > false < / main >

    < principalUserName / >

    the province <>FLANDRE_ORIENTALE < / province >

    < registrationDate > 20101213093341Z < / registrationDate >

    < role > HOSPITAL < / role >

    < sender > true < / sender >

    < senderInvisible > true < / senderInvisible >

    < subscriptiondocs > false < / subscriptiondocs >

    This LDAP is hidden by the SECURITYFILTER field < phone > < / phone >

    < improved / >

    < userpublic / >

    < usetranscodor > true < / usetranscodor >

    < version / >

    < / value >

    < / return >

    < / its: findAccountByCriteriaResponse >

    < / env:Body >

    < / env:Envelope >

    I want to read the XML column and display it as a relational table.  I have the following SQL code:

    Select x.*

    of tmp_medimail_accounts t

    xmltable)

    xmlnamespaces ('http://schemas.xmlsoap.org/soap/envelope/"as" env" )

      , ' http://session.kernel.CMP.com/ ' as 'his'

    )

    , ' env:Envelope / env:Body / its: findAccountByCriteriaResponse return value '

    in passing t.tmp_xml

    path of varchar2 (30) columns "firstName", firstName

    path varchar2 (30) LastName "lastName."

    rizivnr varchar2 (11) path 'inami ',.

    path of varchar2 (50) address "mexiAddress."

    path of varchar2 (100) email "mail."

    Gemeente varchar2 (50) path 'city') x;

    But I have error: ORA-19102: literal string XQuery WAITED

    Can someone help me?

    Best regards, Hans

    Hello

    What is your version of the database?

    It looks like an old problem related to the CURSOR_SHARING parameter.

    See if the solution given here helps: How to use a web service xml document

  • Error 66: TCP Read

    Hi all

    I need to communicate with a machine to send a unique information. This unique information is to provide different sensors that communicate with Labview. My problem is when I start my VI, he stopped 30 seconds with the error code 66. You can see attached a screenshot of the error and my VI. This error that when I use a while loop, if I use the term continually touch the error does not appear.

    As a beginner I don't really know the origin of this error. I only know that it can be linked to the respons of time between my computer and the controller.

    Thanks in advance for your help

    Concerning

    Baptist

    The model of the automaton is a pro-deal LM 4301

    Looks like something is to be constantly opened and closed.  You really shouldn't do.  You must initialize once before the loop and close once after the loop.

    Specifically, this error indicates that the instrument has closed its connection.  You make something for him say to unplug?

  • Reading TCP timeout

    I understand that other discussions on this topic are already, but I still have to find a solution among them.

    Here's the scenario:

    I have a PC (running Win7) which is connected to a monitor Signal Agilent N9020A MXA (WinXP) host over a LAN connection. The reason behind the connection to the LAN via the GPIB is software VSA 89601 B added I want to access through SCPI commands through code LabView on the host PC. According to Agilent, it's one of the ways to do so.

    I have IPS assigned and specified the Agilent recommended port 5024 for a TCP/IP connection. I am able to write commands using TCP write using LabView, but I can't read anything by using TCP Read. Indeed, according to some variations of the options I tried of the subjects of the previous forum, I always end up with error 56 or 66.

    I checked that the SCPI command is working to extract data using Agilent IO Interactive. It should be fairly simple. Because I want to automate this process, please help? What Miss me?

    Thank you in advance.

    Solved.

    Remove the end must be disabled to get rid of Reading TCP timeout.

  • Reading TCP does not detect the network closed conncetion error (66)

    Hi dear all,

    Instead of LAN I use WIFI to connect PC and mobile. Read all communications and write operations are performing ok. But the only problem I am facing is that once I disconnect the network from a mobile phone connection my labview TCP read operation does not detect it and only timesout at the specified interval. Although for Bluetooth connection network if I disconnect mobile then BT read detects it as network conncetion closed in error by peer (66).

    Can someone help me on this.

    Thank you & best regards

    Zdzislaw qureshi

    Hi Zdzislaw,

    The behavior you're seeing is expected for TCP as the device will timeout while it is looking for the connection close the connection.  This Wikipedia article explains how TCP protocol works in relation to a handshaking procedure four lanes running in order to close a TCP connection.  I hope this helps!

    Kim

Maybe you are looking for

  • Restore iPhone in iTunes deletes information carrier?

    I know that restore iPhone from iTunes will delete the photos, not apple apps, music, videos, etc.. But using Restore iPhone in iTunes deletes any information carrier? -Mike

  • FF takes longer than Chrome to begin

    I have been using ff for 2 years. I noticed that when comparing chrome one ff, FF takes a long time to start.I used these plug-ins: Adobe Acrobate 10.1.9.22 Java deployment Toolkit 7.0.650.20 10.65.2.20 Java(TM) Platform SE 7 U65 10.65.2.20 Shokewave

  • Address-home page/search bar will not save

    Hi people! I tried to change my homepage and my search from the address bar of the SmartPage, but whenever I restart Firefox, won't save the settings and I'm back to my old home page. I have tried several strategies: (1) I first tried to set the home

  • No sound on my Satellite A85-S1072

    Hello I don't know when it happened, but all of a sudden, I wasn't able to hear all the sounds. I can open the icon near the hour (bottom right) but adjusting the volume here or the physical button on the outside did not make a difference. When the s

  • Audio device does not work on Satellite A300

    I have the new Satellite A300 for 3 days... and its not working. I have updated drivers and it did not help. I removed and installed again and it didn't work. I've tried everything. But when I look in Control Panel, everything is said to work, but it