TCP connection on 4.6

Hello

I am writing an application that connects to the computer on the specified port. Everything works fine on versions 5.0 and 4.7 Simulator, but if I try to run the same code on 4.6 Simulator or device, it does not connect with the "tunnel timeout" message by writing the data to the open socket or it does not open the plug at all.

I open the connection in this way:

String url = "tcp://" + Manager.getInstance().ipAddress + ":" + Manager.getInstance().port;socket = (StreamConnection)Connector.open(url, Connector.READ_WRITE, true);

I tried to add the = wifi interface to the url string, but it did not really help.

and here is my way to write data:

dataStreamOut = socket.openDataOutputStream();if ((dataStreamOut != null) && (data != null))            try            {                byte[] dataBytes = data.getBytes( "ASCII");                int size = dataBytes.length;                byte[] bf = new byte[4];                bf = intToBytes (size);                dataStreamOut.write (bf);//( bf2);                dataStreamOut.write(dataBytes, 0, dataBytes.length);                dataStreamOut.flush();            }            catch ( Exception ee)            {                Logger.getInstance().log(3, "Channel.writeDataBysize exception");                Logger.getInstance().log(ee);            }

Anyone has an idea why it works on 5.0 and 4.7, not 4.6?

Thank you very much

Eva

Let us first sort the 4.6 Simulator.

You do not specify a connection suffix, so on the Simulator, it will try to connect using the MDS Simulator.  To test that is executed correctly, try the browser on the simulator - it should work.  T it?  If this isn't the case, then the problem seems to be related to the MDS Simulator.  Most likely you did not check the box requesting the departure of MDS Simulator with the Simulator.

Tags: BlackBerry Developers

Similar Questions

  • 63 error to TCP connection open in Simple data Client.vi when connecting to the network storage device.

    Hello

    I tried the simple data client and simple example of data server. I tried this example to connect to a NAS device. My laptop properly communicates with the device since I ping the address of the NAS device and discovered it works perfectly fine. Also, I put the static IP of my pc even as the NAS. So everything I've done. But when I run the program giving the ip address of a NAS device, it shows an error 63.

    Error 63 to TCP connection open in Simple data Client.vi

    Possible reasons: LabVIEW: serial port receive buffer overflow. = LabVIEW: the network connection was refused by the server.

    Why is happening. What can be done to solve this problem. Thanking you.

    vindsan wrote:

    What is the firewall of the SIN.

    Yes, it is very likely. Try disabling the firewall and try again. If the code works when you run the Server & client on your machine, but not when you run the server on your NAS and client on your machine (assuming you have entered the correct port for the NAS server), then it is very likely to be a firewall problem.

    vindsan wrote:

    Server that is listening is no longer VI also means what.

    Your VI server listens only once for a connection after receiving an incoming connection (or it expires after 60 years), he stops listening and the port will be more open for incoming connections - you must re - run the VI for another connection. With your code, you must run the VI server and then run the VI client in the 1960s, so it's not expire.

  • TCP connection does not work as EXE

    All,

    I have a RT and GUI from Windows application that uses the TCP protocol to communicate between vi. LabView 2011 PXI chassis

    Works fine when I run both programs. A program is a graphical interface (uses TCP connection open) to the title of 'My Computer', the other is a vi (in listening Mode, wait for connection) under "system RT.

    But, when I build each in an Application.exe and real-time Application, it is no longer fixed communication.

    Any ideas? Maybe a Build setting I'm missing?

    Thank you


  • How to prevent a TCP connection that is closed when the VI who opened it terminated.

    Hello everyone.

    I'm developing an application based on the servers and clients communicate through TCP in LabVIEW 2012.

    When the Server/client opens a TCP connection, it starts an asynchronosly running "Connection Manager", to which connection reference that takes so all communication happening. It all works very well.

    -J' have a situation where a client connection manager can be informed of another 'new' server. I would like to open the connection (to see if it is still valid) and then pass this reference of connection to the main client code to spawn a new connection manager. This avoids lock me up the Client code main with an ish timeout if the 'new' server does not really accept connections.

    The problem is that if the connection manager that opens the connection to the 'new' server is stopped, then it seems to destroy the reference he opened. This means that the other connection manager that has been happily character with the 'new' server has closed TCP communications (I get an error code 1 on an entry).

    I created an example to illustrate the issue which should be used as follows:

    1 run server.vi - he will listen for a connection on the specified port on his comics.

    2. run Launcher.vi CH - it will open a connection to the server and pass the TCP reference to an instance of connection Handler.vi, which he started.

    3. the connection manager needs to send data to the server

    4. stop the Launcher.vi CH

    5. the will of Handler.vi connection error.

    Any suggestion would be appreciated.

    See you soon

    John

    Do not perform the opening and closing of the TCP connection in Subvi. Do this to master VI.

  • How to get the IP address of the client when TCP connect on the server

    How to get the IP address of the client when TCP connect on the server.

    The only parameter obtained the login is the login ID.

    I assume you are using "Wait of TCP on the listening port" on the server. This returns the remote address and port (like out in option).

  • Good method to reset the tcp connection after timeout error

    I have an application that I build that communicates with a Modbus TCP device.  If a communication occurs error I wish I could reset it TCP communication.  What I have is a control that raises an event when pushed.  In this case, I have a sequence that closes first the tcp connection and then opens a new connection.  My application starts and works very well.  To test the reset function, I removed the ethernet cable from the camera and waited until a timeout occurs.  I plugged the cable reset back to and pushed my control. Sometimes the reset will take place, but most of the time I'll get a timeout in the TCP vi open error.  After that, the only way I can establish communications must leave my application, disable and then enable the network device.  Then, when I restart my application I have communication with my camera.

    Any help would be appreciated on how I should be reset my TCP connection.

    Thank you

    Terry

    Terry S of a. in writing:

    I've attached an example vi (LV10) that shows just the connection TCP and Reset.  An error occurs when you try to run the open in the event of reset tcp protocol.

    As writing that your code should be fine. There is nothing inherently wrong with it. However, depending on the device, you communicate with you can try to restore the connection too quickly once you have closed the connection. The device allows multiple connections to it and may require some time to clean up the things on his end after you close a connection. An experimental basis try wait little time between TCP and the TCP Open shut it down. If possible you can try using Wireshark to see what is happening on the network. It may be useful to diagnose what is happening.

  • Error of TCP connection when sending MODBUS for WAGO controller 750-881 orders after 113655 bytes of data have been sent

    Hi all

    I'm new in the world of labview and trying to build a VI that sends commands to a controller of the WAGO 750-881 at regular intervals of 10 ms.

    To set each of the WAGO comics at the same time, I try so to send the Modbus fc15 command every 10ms using Labview standard TCP write module.

    When I run the VI it works for about a minute before receiving an error message 56 telling me the TCP connection has expired. This strange thought, I decided to record the number of bytes sent via the TCP connection while running the program. In doing so, I noticed that the link broken after exactly 113655 bytes of data have been sent each time.

    Thinking can I have sent too many messages, I increased the delay of the loop of 10ms to 20, 100 and 200 ms, but the error remained. I also tried to play with the TCP connection timeout and the writing TCP timeout, but none of these had no effect on the problem.

    I do not see why this error occurs, such as the program works perfectly up until what brand 113655 bytes.

    I've attached a screenshot of the base VI (simply showing a MODBUS command sent every second) and a more advanced VI (where I am able to control each of the WAGO manually by setting a frequency at which the DO is to switch between ON and OFF).

    If anyone has any ideas on where the problems lie, or that I could do to debug more program this would be greatly appreciated.

    AvdLinden wrote:

    Hi ThiCop,

    Yes, the error occurs after exactly 113655 bytes each time. Time-out control, I would like to use is 10ms, but even that will rise to 1 s or 10s does not error, which leads me to believe that's not the issue (as well, do not add any delay in the while loop, so let it run at the maximum speed showed that the TCP connection is able to send all the bytes 113655 in less than 3 seconds again directed towards control of time-out) is is not the issue here).

    I tried the suggestion of Marco but having difficulty to translate the string returned in a readable string (rightnow the answer given is "-# +" ' ").

    As for your second suggestion, I've implemented something similar, where I created a sub VI to establish a TCP connection, send a message and then close the connection. I have now to build each message and then send the string to the Subvi, which sends the command to my application successfully. While not the most elegant method to solve the problem, it solves the problem of time-out, which means that I am able to send as many orders as I want. So in this sense, the problem has been resolved.

    If you have advice on how to properly read the TCP read the output, I want however to see if I could not get my first program to work because it is slightly more robust in terms of timing.

    MODBUS RTU TCP is a binary protocol, as you show in your base VI, where you put in the form the data stream using byte values. So you have to interpret the returned answer accordingly with the Modbus RTU spec in the hand. Now what is probably happening is that the connection is suspended after a while because you do NOT read data from the device sends as response to your commands. The TCP/IP stack cushions these bytes and at certain point of overflow internal buffers and the connection is blocked by the battery. So to add playback of TCP in strategic locations (usually after each entry) is the right solution for this. Is there a reason any that you do not use the PROVIDED Modbus TCP library?

  • Read bit in the TCP connection

    Hello

    I'm trying to read data from TCP connection.

    As I understand it, I get a string as this login data.

    I need to play different songs in these data

    What will be the best way to do it?

    Thank you

    In this case, you will get a string of one character in the TCP/IP Read function. You said you want to see if, for example, the character ".<". the="" ascii="" code="" for=""><" is="" hex="" 3c,="" which="" corresponds="" to="" 00111100.="" thus,="" it="" sounds="" like="" you="" just="" need="" to="" make="" a="" comparison="" against="" a="" character.="" if="" you="" want="" to="" check="" a="" specific="" bit="" pattern="" then="" the="" easiest="" way="" to="" do="" this="" is="" to="" simply="" convert="" the="" string="" character="" to="" a="" u8="" and="" compare="" to="" a="" u8="" constant,="" like="">

  • Why the customer does not receive the 1 d array sent by the server via a TCP connection?

    I have attached 3 screws:

    1 PC.vi (server)

    2 xbee.vi (client)

    3 CreateSetupPacket.vi (it generates a table of numeric values)

    #1 is executed first, followed by #2.

    #2 tent initiates a TCP connection to #1.  As soon as #1 it detects a "login ID" is created.

    #1 tries to send a package of 'setup' to #2 by the construction of a table.

    The problem is the client of xbee VI gets 0 bytes or "" empty string back.  What Miss me?

    Note that I was running the two VI on the same PC.  And it worked because the IP addresses were set to localhost.

    I don't know if a Windows Firewall affect TCP/IP communication in the same PC.  It is possible, I don't know.

    Firewalls can certainly affect communication between different PC whehter is a firewall in the routers on the network or in the Windows Firewall.  It is therefore useful to check in one more.  But as you say, I see nothing wrong with the code.

  • How to pass the ID of TCP connection in Secondary VI

    Hello

    I'm going through a TCP connection ID in a secondary VI, but was not successful.

    Here's the function I used:

    I managed to spend other control values in the VI but not the code TCP conn.

    Are there restrictions or other ways that I should do?

    Best regards

    Ken

    Hi Ken,

    Is "reference" a TCP connection ID? If so, the reference directly to the Ctrl Val.Set phone invoke node. No property value of the reference needed.

    It really works with connection TCP IDs.

    Hope this helps,

    Daniel

  • Modbus/TCP connection to the controller of power Eurotherm EPack

    There are examples of how to connect to a power controller Eurotherm EPack a modbus/TCP connection?

    I downloaded the Modbus LabVIEW ni_lib_modbus_library library - 1.1.3.32.vip and installed using VIPM.

    However, I am not familiar with the Protocol modbus and terminology such as coils, keeping records.

    I can't even properly run examples for Modbus master and slave to this library :-(

    Most important for me now is just to read the value of the artwork process.

    "ITools" Eurotherm controller software provides information about something I think are an address of memory the value of process I want to read.

    However, I have no idea how to set the various parameters to get successfully connect and read the value of the process.

    Trying to solve my problem, I managed to have basic communication and engineering data conversion.

    Now I can read values of process as the power line frequency, voltage and others.

    Once you know, it's very simple (once you have the modbus library)

    Some things that remain unclear:

    -What values are 32-bit and 16-bit?

    -is the method of addressing identical for all parameters?

    -is it the same for reading and writing?

    I would like to be able to write the target value, for example.

    I'll contact the seller for these outstanding issues. The manual is not really clear (at least not for me). He mentions that some values may be treated differenly (they 16bits, but globally, so 5001 with a scale factor of 100 means actually 50.01 for example).

    See the attachment for reading cover base.

  • How to increase the maximum number of TCP connections simultaneously

    Hi all

    I hope some can help; I am trying to use an XP machine to machine IPERF Linux... we tested loads up to 5 (-P5) outgoing connections using XP, but now we want to move to 8... but the connection keeps flat for 3 of them. We tried the 6 and 7, again same problem, anything 5 + said "breaking" we believe that this is a problem in windows limiting the the maximum number of concurrent/simultaneous TCP connections.

    Thanks in advance

    Kind regards

    PJ

    Hi APKJ,.

    Your question is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please ask your question in the following forum.

    Windows XP IT Pro category

  • IP SLA TCP connect to FQDN - JIT or TCL required?

    Hello

    I have a Setup today where we test the accessibility of a service through the SLA of IP TCP connect the probe. This is done to an IP, straight forward until present. Unfortunately they ISP will not be able to provide a static IP address in the future which means that we do not know the IP address of the service that we test.

    We wanted to solve this problem by providing a FULL domain name to IP SLA probe instead, but unfortunately, it seems it solves the FULL domain name directly and then between an address IP address to TCP connect command. Not very elegant! Of course, this means that the probe would not abreast of any changes in the hostname-> mapping of IP addresses.

    Is it possible to solve this problem with the EEM or TCL somehow? An option that I thought was to make a ping to the host name and check what IP address it is resolved to. If the IP address has changed then update the ports TCP connect command. It's a bit beyond my abilities scripting yet. Is this possible in EEM or that would require TCL?

    Someone told me that IOS is cached responses to requests for four hours, what works well in this situation, of course. Maybe it's possible to clear the cache to ensure that the query contains up-to-date information?

    Grateful for any input from the community can bring.

    You can clear the cache using ' clear host. "  So you could automate this using an applet that can run, for example, every 10 minutes:

    Event Manager cmdlet get - ip

    watch dog timer event duration 600

    order cli action 001 'enable '.

    action 002 cli command "clear host."

    cli command action 003 "ping ip HOST repeat 1"

    action 004 regexp 'echoes in ([0 - 9.] ". (+)' $_cli_result match ip

    005 action puts 'Do what you want with $ip now.

  • Using the BIS network but with guidance TCP connection string

    I just want to clarify if this is really possible.

    Being a small/medium business, that we can afford to be a partner just blackberry alliance partner to win have BIS-B connection size.

    In any case, I just want to clarify that if a device is registered with BIS, is it still possible for my application to use the direct TCP connection string (with AFN etc) to extract information via web services and socket connections?

    I read this, I just want to be sure before making further development to 100%

    http://supportforums.BlackBerry.com/T5/Java-development/connecting-your-BlackBerry-http-and-socket-...

    most of the time: Yes. It is dependent on the vendor however, some may charge extra, for example.

  • Problem of test Signal before using the TCP connection

    Right now my application uses a SocketConnection TCP to communicate with a remote server.  It works fine, but I'm trying to make sure that my program can correctly handle the situation to move to an area with no coverage.

    When I run my application, if I uncheck the box "on the cover" for GSM and CDMA under Network properties, my app fine until it calls the OutputStreamWriter.write () function to send something on the socket connection.  I have it in a try/catch block, but it just seems to hang instead of throwing an exception.

    How can I check the signal before attempting to send data on the SocketConnection?

    To facilitate clear life upwards, here's the order of what happens:

    1 application starts on the cover.

    2 SocketConnection made successfully.

    3 OutputStreamWriter successfully SocketConnection.

    4. coverage is lost

    5 OutputStreamWriter.write () is called, but freezes instead of throwing an exception.

    The socket connection output stream write operations do not throw an exception when there is no coverage is the correct behavior. That's because on cellular networks the IP tunnel to the carrier (and therefore the TCP connections on this tunnel) survives loss of coverage. For example, if your application opens a connection TCP from a BlackBerry, then the BlackBerry loses coverage, then take cover, say, 1 minute later, the TCP connection opened by your application will continue works fine, unless intermediate network component or your server closes the connection due to inactivity.

  • A direct http TCP connection requires any service book?

    Hello

    is it necessary to have any book specific service enabled in order to establish an http connection using the direct method of TCP?

    If not, is it possible for an administrator of BES to block its use without blocking other methods?

    Concerning

    Direct TCP connections do not use registration service.  They use the APN information configured under Options (Advanced Options), Applications.  An application can also specify the APN in the URL (see link below).  Note that CDMA networks do not make use of NPP.

    How - to specify APN information for a direct TCP connection
    Article number: DB-00532

    http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/How_To _...

    There is no way for a server admin BlackBerry Enterprise Server block just direct TCP connections.  They can block all external connections (direct TCP, WAP 1.1, WAP 2.0, etc...).

Maybe you are looking for