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.

Tags: NI Software

Similar Questions

  • Cross-origin request blocked: the same political origin does not read the remote resource

    while trying to perform the CORS get request I get this error:
    Cross-origin request blocked: the same political origin does not read the remote resource
    In chrome it works fine.
    I'm using firfox version 29

    A good place to ask for advice on web development is the forum mozillaZine 'Web Standards Development/evangelism'.

    Aid to this forum are better informed on issues related to web development.

    You must register on mozillaZine forum site to post in this forum.

  • 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.

  • 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

  • I have an invasion by a 3rd party to come into Port 68 how to block this port

    I use windows vista Enterprise edition, sp2 and I have a crook invade the port 68 how block this port or any subsequent they might try.  I unraveled 20 year of who and what is being ripped off, and they don't like it... Thankyou

    http://www.ehow.com/how_6225380_block-ports-Windows-Vista.html

    Read the above info.

    See you soon.

    Mick Murphy - Microsoft partner

  • 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.

  • 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.

  • Parity errors & read on Serial Port framing

    Hello, I am writing a program that reads the serial port IR thermometer. Intermittently I get parity so many framing errors and can't explain why or find a way to remedy. All the parameters of the series were double checked and controlled. I don't get any errors when you use HyperTerminal yet, when I do test bed in MAX, I see these mistakes from time to time. I tried the suggestions of the knowledge base for these as presenting a delay between the Visa set up and read the Visa or flushing buffer issue before reading, but none worked. Any idea or ideas would be appreciated.

    In addition, while searching through discussions on parity and framing errors, I saw a when a user recommends the following: "use wait event triggered by the stop character and when the error occurs, I just deleted the error, empty the buffer (wait the next stop character) and reread." If that sounds like a good solution, how would I go about its implementation?

    I've attached a screenshot of my reading series loop so you can see what I'm doing. I do about the error code control timeout is.

    Given that you have activated the stop character, you should not use the bytes to the serial port. You shouldn't have to delay or any function buffer flush.

    PS, You also have to change the way your loop exits.

  • Sometimes the lost bytes, reading the serial port

    Hello!

    I'm reading the serial port data (flow rate 57600 baud rate) that works very reliable so that I do not open any other window

    or minimize/restore my window of the application during the program is running. Then a byte of incoming data will be lost.

    I get a string of 30 bytes each 50 m in most of the cases the first byte is lost, sometimes one in the middle.

    This occurs not only on a PC.

    Is this a problem of LabVIEW or Windows?

    Are there settings that can solve the problem?

    Best regards

    JK78

    I solved the problem.  

    There was a bug in my program who become visible only if a window has been reduced or restored.

    When there are two or more messages in the buffer VISA, the separation of the messages was incorrect.

    Array index corresponded to false so that the first byte of the second message was at the end of the first

    and so the second message in the buffer seemed incomplete.

    In normal operation, the playback loop runs so fast, never both messages are in the buffer.

    Thanks for all replies.

    JK78

    Either way, I work with LabVIEW 2009 and serial interface hardware motherboard. With XON/XOFF flow control

    is not possible in my application because all the hex values from 00 h to FFh may appear in a message.

  • Question - Win7 Home Prem... seeking to block a port. Recently, network multiple attacks of DoS.Generic.SYNFlood go a single specific port. Anyone know how to block a port?

    Recently, several attempted network using DoS.Generic.SYNFlood attacks.  All attacks are trying to come across 40 Port.  How can I block this port?  I checked the registry of Port number and 40 is unassigned... exactly why they use it.  Can anyone help?

    How can I block this port?

    http://www.sciencehq.com/infos/how-to-block-ports-in-Windows-7.html

  • Blocking remote - site-to-site vpn network

    Hello

    I have a VPN site-to site already set up, everything works as it should.  I'm trying to block remote network access to our network as we only need access to them.  I'm sure it's something very easy to implement with an ACL, but I don't know where this rule should go. The VPN is on ASA 5505.

    Example:

    1.1.1.0/24 - local area network - site has

    Site B - remote network - 2.2.2.0/24 - want to block this local access network

    Any help or advice would be appreciated.

    Thanks in advance,

    -j

    You are right.. ACL is the best way to go.

    You can configure ACLs in the outbound direction of the internal interface as follows:

    inside-acl-out of ip 2.2.2.0 deny access list 255.255.255.0 1.1.1.0 255.255.255.0

    inside-acl-out the ip access list to a range

    Access-group inside-acl-out interface

    With the above ACL, it crashes all the traffic from the remote VPN to the internal interface while allowing the rest (for example: were other interfaces of the ASA) originally from connection to the internal network.

    I hope this helps.

  • How can I put the Windows XP firewall in a port configuration 'allow all' and only block some ports?

    Without going into the details of why I need to do this, I'm putting the firewall of Windows XP in one allow all the configuration of ports and only refuse some ports I have in a list.

    I train this script via the command-line batch with the netsh firewall add portopening command.  From what I've read, if enabled the firewall denies all traffic and only allows ports with exceptions, so through batch scripts, I opened all the 65 000 + ports TCP and UDP, essentially with the firewall turned on but in a configuration of "allow all the»  I don't deny the 100 or so ports to my list that I want blocked after they are all open.

    This strategy seems to work, but the problem I waited and I now see is that svchost.exe takes 50% of my CPU time, have to deal with constantly these firewall rules.

    "From what I've seen on Windows XP, there is no way to have the firewall ON, and in a configuration of" allow all the "" because the XP firewall may not have defined port ranges, they must be defined one by one.  It looks like Windows Vista or 7 would be much easier because the firewall has got a re vamp of advanced features.

    Does anyone have a suggestion on how to realize this "allow all", deny some' strategy?  I know it's a strange use of the Windows Firewall, so let's please jump in front of a 'why would you do this incredibly stupid thing?"messages.

    Also, if it was the wrong forum (or website) to post on for this kind of question, I'd appreciate a recommendation of a more appropriate forum.

    Hello

    See the steps in the following article.

    How to manually open ports in Internet Connection Firewall in Windows XP?

    http://support.Microsoft.com/kb/308127

  • Unable to block the port with pfctl(8)

    I try to block the process that is listening on the port on my MacBook Pro 9110 to simulate the network interruption.

    If I have the following rule:

    -------------------------------------------------------------------

    block fast drop on all proto tcp from any to any port = 9110

    --------------------------------------------------------------------

    My second process has communicated successfully with the port is blocked, and the client has successfully sent applications to the blocked process. The best I could achieve blocks all communications process with these lists of rules:

    ---------------------

    drop block in all

    block any waiver

    ---------------------

    However, this is exactly what I need. Am I missing something? Any commnets/suggestion will be appreciated. Here is my result of lsof command:

    > > lsof-i | grep 9110

    Java 41243 yfe 132u IPv6 0x1e7d5327e0e36555 0 t 0 TCP 192.168.1.68:58772-> 192.168.1.68:9110 (ESTABLISHED)

    Java 41243 yfe 145u IPv6 0x1e7d5327e0f43035 0 t 0 TCP 192.168.1.68:58777-> 192.168.1.68:9110 (ESTABLISHED)

    Java 41244 yfe 133u IPv6 0x1e7d5327e116eab5 0 t 0 TCP 192.168.1.68:58747-> 192.168.1.68:9110 (ESTABLISHED)

    Java 41244 yfe 147u IPv6 0x1e7d5327e0e3a075 0 t 0 TCP 192.168.1.68:58756-> 192.168.1.68:9110 (ESTABLISHED)

    yfe Java 41253 201u IPv6 0x1e7d5327e0e38595 0 t 0 TCP *: 9110 (LISTEN)

    Java 41253 yfe 278u IPv6 0x1e7d5327e0e39055 0 t 0 TCP 192.168.1.68:9110-> 192.168.1.68:58747 (ESTABLISHED)

    Java 41253 yfe 279u IPv6 0x1e7d5327e4a195b5 0 t 0 TCP 192.168.1.68:9110-> 192.168.1.68:58756 (ESTABLISHED)

    Java 41253 yfe 280us IPv6 0x1e7d5327e5560035 0 t 0 TCP 192.168.1.68:9110-> 192.168.1.68:58772 (ESTABLISHED)

    View the results of the next PF sanity check:

    % sudo pfctl(8) - v - n f /etc/pf.conf

  • 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.

Maybe you are looking for

  • Whenever I run Firefox, it starts to download a huge file that I don't want. How to stop this.

    I had Firefox starts downloading a file yesterday and then changed my mind leave Firefox in the process. He asked if I wanted to cancel the download and I said yes. Now, whenever I run Firefox, it starts to download the same file 805 MB that I alread

  • Drop-down lists don't drop-down list in Firefox 5

    Since upgrading to Firefox 5, drop-down lists on Web sites, no longer drop-down list. They work OK in IE, Chrome, Safari, et al, and they worked in FF4 - simply no FF5.This seems to happen on all websites but I can't believe that something this blata

  • impossible to install window updates

    Please I neeed helpI get the error message when I try to install the updates, but everything I tried didn't work. What should I do?first the window vista pack 2 was not installed sucsessfully and it blocks the rest available updates

  • How to solve the problems highlighted in each journal in the issues of the CBS

    Hello Please could someone help me decipher the CBS logs for two of my Vista machines and tell me how to solve the problems highlighted in each journal. Vista 1 machine has Vista Ultimate x 64 SP2 installed and has been implemented in the following w

  • Printer displays offline

    I have the printer deskjet HP 1560. it becomes offline I give impressions... I thought that it is a cartridge problem, so I replaced it by news... and then I also reinstalled his driver... But it still shows the same problem... Please help me...