Control an NI-4000 from a PC

Hi all,

I am new to this forum and to AMX. I would like to use an NI-4000 device controller in a project and would like to know whether I can control the NI-4000 from a computer (rather than the other way around). The idea is to have an Apache Tomcat webserver hosting a jsp website that controls both the NI-4000 and applications running in the computer. The use of java would be an advantage as I could reuse a lot of code and would make things much easier. Is this possible? What do I need to use? Are there any requirements? Many thanks in advance

Comments

  • DHawthorneDHawthorne Junior Member Posts: 4,584
    Anything you do in Java to run on the NetLinx itself is going to require Cafe Duet, and the required licensing for it. Last I checked, that was dealer-only, on the order of $900 or so ... assuming my memory hasn't failed me. Right now, it only creates modules, you can't right your main code in it. This is supposed to change, eventually (they are at least a year behind on this by my reckoning - still doing better than Microsoft :)).

    You can, however, create a comand-line interface via a virtual device. Your computer will have to connect via telnet, but if you are writing Java, you could most likely easily create a front end for that with a GUI. You can then connect to the master, and send and recieve commands to and from the virtual, which can hook into as much of the rest of the program as suits you. I do this all the time for troubleshooting and remote management, sans the GUI - a telnet terminal is sufficient for me; it wouldn't do for all but the most tech-savvy of customers, though.
  • jjamesjjames AMX Sustaining Engineer Posts: 2,900
    Okay - does anyone have any code to show how to connect a PC to a NI? (And I'm not talking NetLinx code either.) I've always wondered how you connect, and say which device number you are and all that stuff in VB, C++, or C# (my personal favorite - though I'm a complete noobie in "real" programming languages), etc.
  • DHawthorneDHawthorne Junior Member Posts: 4,584
    Pretty much, it has to open an IP connection to the telnet port. However the programming language handles that is where you take it. I imagaine you could connect to port 1319, but I don't recall anything ever being published about that protocol, I assume it's proprietary.
  • Duncan EllisDuncan Ellis Code Junkie Posts: 102
    Controlling an NI from a PC

    Don't want to try and state the obvious, but wouldn't the easy solution be to open a server port on a specified port and get your PC to attach via a client connection. Then use a data event in the NI to catch command string and translate the strings into commands within the NI??

    It just means that someone has to have the ability to open a client port in Java/VB/C++ and send string to the port???

    I have done this for a project where the client wrote thier own interface in Perl and I wrote the Netlinx end on their behalf.
    Obviously you can always tell when a client is online through the online event of the server port. If you need more connections just open up multiple server connection on seperate local ports.

    Hope this helps

    Duncan
  • joelwjoelw Junior Member Posts: 175
    zzalsjg2 wrote:
    Hi all,

    I am new to this forum and to AMX. I would like to use an NI-4000 device controller in a project and would like to know whether I can control the NI-4000 from a computer (rather than the other way around). The idea is to have an Apache Tomcat webserver hosting a jsp website that controls both the NI-4000 and applications running in the computer. The use of java would be an advantage as I could reuse a lot of code and would make things much easier. Is this possible? What do I need to use? Are there any requirements? Many thanks in advance

    Hello,

    Yes it is possible, this is what you need:

    If you install i!-PCLink Web it will install a Windows ActiveX object called i!-PCLinkXtra.

    Default location:
    c:\Program Files\Common Files\AMXShare\COM\i!-PCLinkXtra.ocx

    This ActiveX object allows native connectivity to Netlinx, and supports three connection models:
    1. Client - TCP/IP (connects to specified IP address)
    2. Server - Listen (requires URL table entry, Netlinx processor connects to you)
    3. Auto - Connects to first Netlinx multicast heartbeat on subnet

    Once connected it will show up in Netlinx device tree as a device.

    So this can be implemented in your favorite Windows development environment.

    If you want a Java wrapper search the web. Here's one: http://java.sys-con.com/read/48177.htm


    Joel Winarske
    www.indyelectronics.com
    Programming AMX since 93'

    I'm still waiting on my practical test results, growing a beard here guys....
  • Netlinx IP Communication (TCP/IT Server Listening on Port 86)

    I am trying to program Netlinx as a Server so it will listen on a given port. I am at a point where I can telnet to the port I'm listening on however the Netlinx program drops the connection automatically after some time. Once the connection is dropped I cannot telnet to the same port again until the unit is rebooted. This issue also occurs when I manually disconnect the telnet session. It won't allow me to reconnect.

    Has anyone seen this issue before? Please see attached zip file...

    Any help would be appreciated as I am pulling my hair out on this issue...

    Thanks in advance,

    RMR
  • DHawthorneDHawthorne Junior Member Posts: 4,584
    I regularly open Telnet connections to a master and leave them open indefinitely. I suspect an overall network problem.
  • Spire_JeffSpire_Jeff Formerly Caffeinated Programmer Posts: 1,917
    I had a processor that was having all kinds of problems with telnet and processor to processor communication. After a few hours of troubleshooting, Tech support and I determined it to be a problem with the network interface on the processor. Sent the processor in for repair and everything works great now.

    Jeff
Sign In or Register to comment.