Communicating with Crestron using tcp/ip sockets

Greetings...
I trying to finish a desktop application written in Java that connects to an automation controller(Crestron) via sockets (TCP/IP). My main problem is that the connection is constantly going down. I have a thread that is always running to check if the connection is up, when it's brocken just puts it up again.
Then i have another thread that's always running also to get the data that the
Crestron controller sends me.
The connection is broken usually by receiving a null.
Is there any tip to solve this kind of trouble?
The java app. is client and the Crestron is a server. Also i'm running the app. in Windows XP.
It's a fix ip and the port is 4444.
Also if anyone has experience of making software that interects with Crestron Controllers, please tell me something.
Thanks for the help

Sorry, but if your connection keeps getting dropped and your client does not close the connection then there is only one source: the controller itself is closing the connection. It may be some kind of timeout that is causing that the connection is closed. In any way, it is most likely not java but hardware / setting related.

Similar Messages

  • Communication with database using TCP sockets connection

    Hi all,
    I am bit of a newbie when it comes to databases. In a project I realised over te passed few weeks, I communicated with an 11g database using an application I created with VS Express. It uses an ODBC connection. I now want to connect a PLC to the same database. These PLC's don't have the ability to install an ODBC client so I need something different.
    I am easily able to open a TCP socket on the PLC and send data from there. I would like to know if I can start a TCP sockets connection with our 11g server and send all queries directly. The other (already suggested) option would be to have the PLC connect to a PC that reads this information and hands it over to the ODBC connector, but that would mean I need an extra PC just to 'translate'.
    I have been searching these forums for socket, TCP and more and feel it is possible, but I need a good document as a reference to show/tell me how it's done.
    Thanks in advance,
    Marijn

    The TCP/IP interface to Oracle is undocumented (and hugely complex anyway). You'll need to use a higher layer iterface or setup your own infrastructure.
    We need more information about what is available to you inside the PLC.
    Can you use Java? If so, perhaps use thin JDBC?
    Can you sent HTTP requests? If so you could set up your own Web services to handle this.
    If you can only use C or C++, Oracle has interfaces there too.. it's called OCI (Oracle Call Interface) and thats as close to the networking layer as you can get.
    Finally if you can use .NET Oracle has a Fully Managed Oracle Data Provider for .NET that you could use.
    But if all you can do is super low level network access and none of the above then you will need to set up an intermediary as you mentioned.

  • How to interface a tuxedo app with another application that uses tcp/ip socket  messaging

    How would you interface a tuxedo app with another application that
    uses tcp/ip socket messaging? I have a vendor product that offers
    a tcp/ip message interface, and would like to know how best to
    integrate it into a tuxedo application. I could write a C application
    that listens and accepts incoming request from the vendors application,
    and then make a tuxedo client call to a service. But this doesn't
    allow me to control the listen thread through tuxedo. The C application
    would have to be started seperately and would not take advantage
    of the tuxedo restart facilities etc of a tuxedo service.

    You can make an empty server only with tpsvrinit that starts your client
    listeners and a tpsrvdone that stops them. Be carefull with sharing ipcs
    between processes, or your clients may get puzzled!!!
    Another choice can be builting a custom WSL/WSH but I haven't done
    this yet and I don't know exactly the troubles related with making them.
    R.G.
    Travis Ward wrote:
    How would you interface a tuxedo app with another application that
    uses tcp/ip socket messaging? I have a vendor product that offers
    a tcp/ip message interface, and would like to know how best to
    integrate it into a tuxedo application. I could write a C application
    that listens and accepts incoming request from the vendors application,
    and then make a tuxedo client call to a service. But this doesn't
    allow me to control the listen thread through tuxedo. The C application
    would have to be started seperately and would not take advantage
    of the tuxedo restart facilities etc of a tuxedo service.

  • Interface of Allen Bradley PLC with LabVIEW using TCP\IP modbus protocol

    Hello.....
    I want to connect a Allen Bradley PLC with LabVIEW using TCP\IP modbus protocol.
    The PLC which I am using is a series of 1766BWA (Allen Bradley) please can you help me for the same or please give me suggestion.
    Also I want to know the resistance values of this PLC.
    Thank you.

    Hello
    I was trying for connection of a Allen Bradley PLC with LabVIEW using TCP\IP modbus protocol.
    Here I am attaching the snapshot of PLC interfacing and communication vi using modbus but it is not working
    For reading we use setting shown in CHANNEL 1-modbus but it gives error regarding modbus addressing
    and for writing it shows error illegal address please help me for the same.
    Thank you.
    Attachments:
    PLC_SCREEN.zip ‏261 KB
    Modbus_(Read-Write).zip ‏14 KB

  • I want to do communication via ethernet using TCP/IP

    i want to do communication via ethernet using TCP/IP i did it but code is runing but im not getting any output

    Look on this easy example: http://www.labviewtutorial.eu/viewtopic.php?f=14&t=328
    You will find there two identical VIs (only port numbers are different). One is for PC1 and other for PC2. If you will get prodlems starting VIs, so look on your firewall settings, you have to unlock ports used in these VIs.
    LabVIEW Portal

  • Problems communicating with device over TCP/IP

    Greetings,
    In designing a GUI for a device with both RS-232 and TCP/IP communications capability, I've run into quite a puzzling issue that has me stumped and my brain in pain.  You can query and send commands to this device using ASCII commands.  Developing the serial port communications aspect of the GUI was trivial.  My problem with TCP/IP is this:
    I first establish the TCP connection using the "TCP open" vi.  I then send my ASCII command or query (that is CR terminated) using "TCP write," pause for 250 ms, and then read using, "TCP read" in the CRLF mode (the device does respond with CRLF line termination).  Success using this method in LV is intermittent, especially when I put the write/read vi in a loop and go between querying and sending commands-only.  As a matter of fact, if I am only querying the device, it will run indefinitely without any problems and my front panel indicators display values from the read buffer.  As soon as I send a command (to change a setting, for example), an error is propagated and the GUI no longer receives the data from the read buffer.  More recently, I've found out that the device is definitely receiving the commands even when the GUI fails to retrieve the read buffer, because I can send a query, switch over to hyperterminal, and hit return... it displays my response in HT without my even having to type in a command!  I'm totally stumped here, as I've played around with all kinds of delays in different places, different read modes, opening/closing connections, etc.  I even tried putting in a redunant "dummy" read by itself, and a dummy read following a write with just a CR as the command (I thought this might solve my problem based on the behavior I saw when switching over to hyperterminal).
    I've been searching the discussions for similar problems, but to no avail.  I have read that TCP communications is handled by the OS, so perhaps this is where I am running into trouble?  Any help, advice or suggestions are greatly appreciated.
    (A little bit more information on the device: The way I want the device to work is as a monitor, so it should be querying indefinitely unless the user sends a command to update a setting, at which point it would send the command and then resume monitor status).

    Hello CryoGuy,
    Thanks for the question.
    Your description seems to fit this KB about poor performance in TCP read.  If this document isn't helpful, please let us know the following:
    1.  Which OS are you using?
    2.  Which version of LabVIEW are you using?
    3.  What's the specific error number and message you're getting?
    4.  At which function in LabVIEW are you seeing this error?  (Turn on highlight execution to see where the error starts if the message doesn't say.)
    Thanks,
    Lisa
    Applications Engineer
    National Instruments

  • Communication with servlet using HTTPURLConnection

    Hi Again,
    well..trying to connect to a servlet using the HTTPURLConnection class.
    but the servlet is found (as i have put a system.out in init method of the servlet and that gets printed correctly).my problem is that the doget method does not get invoked.
    following is the code:
    client side:
    public class test
    public test()
    ObjectOutputStream outs=null;
    try
    URL url = new URL("http://127.0.0.1:7001/DataFetchServlet");
    HttpURLConnection urlcon = (HttpURLConnection)url.openConnection();
    System.out.println(urlcon.toString());
    urlcon.setRequestProperty("Content-Type","application/octet-stream");
    urlcon.setRequestMethod("GET");
    urlcon.setDoInput(true);
    urlcon.setDoOutput(true);
    urlcon.setUseCaches(true);
    outs = new ObjectOutputStream(urlcon.getOutputStream());
    String str = new String("hello");
    outs.writeObject(str);
    ObjectInputStream inp = new ObjectInputStream (urlcon.getInputStream());//********************
    outs.flush();
    outs.close();
    catch(Exception e)
         e.printStackTrace();
    //******************** THIS LINE GIVES A FILENOTFOUND EXCEPTION
    I am sure the servlet is found before the object is written but after the getInputStream it throws the excpetion..
    can anyone help?????
    THanx in advance

    urlcon.connect();

  • Communication with OTM using SOA

    Hello,
    I am new to SOA and Fusion. I am trying to use the OTM webservice to insert records in the OTM Database.
    I have an external system reading an XML file. Using mediator to map the external XML to the OTM webservice WSLD. When I look in the OTM side, it seems like the XML generated by JDeveloper is not what OTM is expecting.
    How can I find the XML built based in the mappings in mediator?
    Thanks

    I'm having the same sort of issue. I can open and see the wsdl and I believe it should be running finE but getting an internal system error. Hope someone an help...

  • Communication with the  Idoc file with is server through FTP (TCP/IP)

    Hi All,
    My file which is stored in the directory of the SAP server.
    In this file Sales order data is stored in the IDOC format.
    I have to devlelop a interface which which communicate with Server (where IDOC file is stored) with FTP using TCP/IP.
    Is there any sample code is there.
    Thanks in advance .
    Point guranted .

    Hi,
    Check this links out
    Using of FTP_CONNECT
    FTP_CONNECT
    FTP_CONNECT
    Regards,
    Samson Rodrigues.

  • Bonuses of EJB creating server that uses TCP/IP to read/write to hosts

    I have created just Java application(not EJB) that uses Socket classes to communicate(read/write) via TCP/IP with connected clients.
    I'm new in EJB technology. I have read about 150 pages of different EJB and AppServer manuals but haven't yet found any bonus of EJB for my task. What bonuses could I get if I will remake application as EJB? Please describe advantages in good explained examples.

    You can make an empty server only with tpsvrinit that starts your client
    listeners and a tpsrvdone that stops them. Be carefull with sharing ipcs
    between processes, or your clients may get puzzled!!!
    Another choice can be builting a custom WSL/WSH but I haven't done
    this yet and I don't know exactly the troubles related with making them.
    R.G.
    Travis Ward wrote:
    How would you interface a tuxedo app with another application that
    uses tcp/ip socket messaging? I have a vendor product that offers
    a tcp/ip message interface, and would like to know how best to
    integrate it into a tuxedo application. I could write a C application
    that listens and accepts incoming request from the vendors application,
    and then make a tuxedo client call to a service. But this doesn't
    allow me to control the listen thread through tuxedo. The C application
    would have to be started seperately and would not take advantage
    of the tuxedo restart facilities etc of a tuxedo service.

  • Fetching Idoc file from server through FTP using TCP/Ip protocol

    Hi All,
    My file which is stored in the directory of the SAP server.
    In this file Sales order data is stored in the IDOC format.
    I have to develop a interface which which communicate with Server (where IDOC file is stored) with FTP using TCP/IP.
    Is there any sample code is there.
    Thanks in advance .
    Point guranted .

    Hi,
    Check this links out
    Using of FTP_CONNECT
    FTP_CONNECT
    FTP_CONNECT
    Regards,
    Samson Rodrigues.

  • TCP/IP communication with remote host

    Hey guys,I wrote a class for TCP/IP communication with remote host.I am trying to use this class in following way:Its not working.One thing I am not sure about if I can give IP address of the machine while creating a socket.Please take a look at my program and let me know where i am doing wrong.Help me!
    CommunicationAgent commAgent;
    commAgent= new TCPIPCommAgent();
    writer = commAgent.getWriter("CASS");
    /* Send GC request message to CASS */
    writer.print(searchduedateRequestMsg);
    /* Get reader object to read TCP IP response from CASS */
    reader = commAgent.getReader("CASS");
    /* Read response message */
    String respMsg = reader.readLine();
    if(respMsg!=null)
    System.out.println("Search due date Response from CASS is:" +respMsg);
    else
    System.out.println("Error in reading search due date response");
    and here is my class responsible for TCP/IP communication:
    * Created on Jul 15, 2004
    * To change the template for this generated file go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    package com.prtc.commif.framework;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintStream;
    import java.net.Socket;
    import java.net.UnknownHostException;
    import java.util.Properties;
    import com.prtc.commif.framework.interfaces.CommunicationAgent;
    import com.prtc.commif.util.InputResources;
    * @author spolireddy
    * To change the template for this generated type comment go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    public class TCPIPCommAgent implements CommunicationAgent
    public BufferedReader getReader(String system)
    InputResources inputResources = new InputResources();
    Properties props=inputResources.getProperties(system + ".properties");
    Socket socket=null;
    BufferedReader in=null;
    //Get this from the properties
    String hostName = "113.132.192.21";
    //Get this from the properties
    int port = 10103;
    try
    socket = new Socket(hostName, port);
    in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    catch (UnknownHostException e)
    System.err.println("Unable to identify the Host: " + hostName + ":" + port);
    System.exit(1);
    catch (IOException e)
    System.err.println("Couldn't get I/O for the connection to: "     + hostName + ":" + port);
    System.exit(1);
    return in;
    public PrintStream getWriter(String system)
    InputResources inputResources = new InputResources();
    Properties props=inputResources.getProperties(system + ".properties");
    Socket socket=null;
    PrintStream out=null;
    //Get this from the properties file
    String hostName = "113.132.192.21";
    //Get this from the properties file
    int port = 10103;
    try
    socket = new Socket(hostName, port);
    out = new PrintStream(socket.getOutputStream(), true);
    catch (UnknownHostException e)
    System.err.println("Unable to identify the Host: " + hostName + ":" + port);
    System.exit(1);
    catch (IOException e)
    System.err.println("Couldn't get I/O for the connection to: "     + hostName + ":" + port);
    System.exit(1);
    return out;

    Hi,
    Yes, you can specify ip-address as host-address.
    What do you expect the class to do? Why does reader and writer both open sockets?
    What happens when you run the program?
    /Kaj

  • NI VBAI TCP Communication With Staubli CS8 Controller

    I have a Staubli CS8 controller running the VAL3 programming language. Their documentation is light but I managed to brute force the solution to controlling DIO (Digital Input/Output) commands. I am having trouble brute forcing the SIO (Serial Input/Output) commands. The Staubli appears to only be capable of being the TCP/IP communication Master. I have my laptop's IP address configured in the Staubli controller with the ethernet socket name of "test". With the NI VBAI TCP/IP communication manager set up as slave and the TCP server enabled, the Staubli controller claims it is actively communicating with the NI VBAI socket server, and status is OK. In the VAL3 programming language I believe I have correctly linked the sioLink(siotest,io:test) between the variable name and the actual hardware device port. I try to send serial text strings from the CS8 to the VBAI. But I cannot figure out where to observe the serial communication traffic in VBAI. I have it set up right now to run infinitely and check the TCP port for serial input, but don't see any results. Anyone integrate these two systems yet? I have been using both for quite some time so I'll catch on fast if someone can run me through some quick steps if they have done this before with NI and Staubli. Thanks.

    Actually the VBAI side of the communication was easy and straighforward. Plenty of help files and info on the NI support site. The Staubli side was more complex with minimal information supplied in the programming manual, and I was having trouble with that. After experimenting further I was able to transfer data between VBAI and the CS8 controller. If anyone else ever tries this here is what you need to on the Staubli side of the communication:
    Set up the ethernet socket on the teach pendant:
    Create a new socket and call it VBAI (or anything you really want)
    Set the Staubli up as the TCP communication SERVER
    Set the termination character for " ; " which is Staubli ASCII character 59 (default is ASCII character 13 which I could not generate in VBAI)
    Create the Staubli program (VAL3 language ONLY):
    Create a new program in your application
    You need to create a serial input output variable (In the data sheet add a new SIO variable, call it sioASCII or whatever you want)
    Also create a string variable (In data sheet add a new STRING variable, call it sTEXT or whatever)
    Now you must link this variable to the actual hardware socket
    Then read the socket and output the value to the teach pendant display screen like this:
    UserPage ()
    CLS ()
    sioLink ( sioASCII , io:VBAI)
    sTEXT = sioASCII
    putLn ( sTEXT )
    Run your VB Inspection on infinite loop first, then run the Staubli program and the inspection data will be displayed on the CS8 teachpendant. Yeah, it always looks to easy after you figure it out the hard way.

  • Tcp/ip communication with LabVIEW

    Does anyone have experience building an application with LabVIEW that
    communicates over a socket? I new to LV, but it appears that the
    application I have in mind is possible. Specifically, the LV
    application would open a socket (port and IP known ahead of time) and
    send a character to that socket. Depending on the character sent, the
    application on the other end (a UNIX process) would send back a one
    integer value to indicate the number of packets to expect. The LV
    application would next need to parse each packet for such things as the
    packet length, data length and so forth and then distribute those data
    to appropriate sub-processes. The header value types are integer,
    double, byte and character. The data values are all 4-
    byte integers.
    The sending code (on the UNIX side) was written in C. The aggregate
    throughput is relatively low; no more than 2,000 bytes per second,
    including packet headers.
    If I can get this to work, the results would represent a significant
    cost savings over competing alternatives. As a federal employee, I'm
    always looking for the most cost effective solutions.
    Thanks.
    -Robert
    Basically, I'm just looking for confirmation that this sort of thing is
    possible with LV. And, I'd like to get a better idea of how hard it
    would be to do.
    Sent via Deja.com http://www.deja.com/
    Share what you know. Learn what you don't.

    Hi everyone,i am currently trying to communicate with two computers at the moment using TCP/IP.I have done a simple server and client VI but the server doesnt seem to be writing the string im trying to send and it also gives an error message
    Error 1 occurred at TCP Write in Server.vi
    Possible reason(s):
    LabVIEW:  An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.
    Please find attached the simple server and client VIs i have done.can you help me?
    Thanks
    Osowoaji
    Attachments:
    Server.vi ‏13 KB
    Client.vi ‏13 KB

  • Using thread and socket connection with other machines

    Hi all!
    we are using weblgoic 5.1 SP9 JDK1.2.2
    we already using java.net.Socket and java.lang.Thread
    to communication TANDEM Machine on the weblogic.
    the reason why we use to socket and thread even though it is not
    recommanded is that below
    1. once we connect Socket, then we using until server shutdown or
    connection may has the problem, so we're using thread to wait
    java.io.Inputstream to read from socket.(if I using EJB, It can't
    wait socket inputstream indefinetly, because it has timeout)
    2. we're logging Database date sent or received with TANDEM Machine.
    so we need Database Access. so we using Database Access
    thru Weblogic.
    3. EJB Application using (other EJB Application - send Module)
    to send data to TANDEM Machine. So "Send Module" should
    be implemented EJB.
    but. Now I see there might be problem this framework.
    so, is there some way by just using J2EE spec, to implement this kind of
    framework.
    wait for your great help !!
    regards.

    Yes i've tried interrupt method and it doesn't have any effects on the thread... it stay in connect() method...
    And for the timeouts, in fact i use an API : J2SSH, to connect with SSH protocol, and the setting of connection timeouts is not implemented yet... and the default timeout is about 4 minutes...
    so i don't know how to solve this problem...

Maybe you are looking for

  • How do I get a microsoft employee to respond to me by email?

    None of these forums address an issue, and there isn't a contact email on the company website. Don't tell me to search, I already have and it's not addressed neither here, the company's website nor any "help files". Don't ask me to explain the issue,

  • Premiere Elements 9 - editing in low-res then rendering in HD

    Hi all, Just started using Adobe Premiere Elements 9, editing together a 3 minute music video (so not an epic!). Half way throughand having all sorts of problems as the footage is running slowly or not running at all. Just bought a brand new laptop w

  • Adobe Reader X (10.0.1.434)cannot open pdf:s

    We have problem to open some pdfs after upgrade , here is one example http://www.forsakringskassan.se/privatpers/blanketter_och_intyg/ladda_ner_blanketter nr 9210 the problem is cryptocme2.dll in the reader catalog we have earlier another cryptocme2.

  • Solaris 10 JET install and ZFS

    Hi - so following on from Solaris Volume Manager or Hardware RAID? - I'm trying to get my client templates switched to ZFS but it's failing with: sudo ./make_client -f build1.zfs Gathering network information.. Client: xxx.14.80.196 (xxx.14.80.0/255.

  • Trying to update 10.6.3  - iTunes is gone and will not re-load.

    Trying to update to version 10.6.3 either by .exe on web site or through automatic update and keep getting an error.  "The feature you are trying to use is on a network resource that is unavilable." etc.  It lists 2 sources to try to find 'iTunes.msi