Home AMX User Forum NetLinx Studio
Options

Need som basic help, I am brand new to AMX programming.

Hi there.

I have just started working with AMX programming, and have a NI-3000 to work with. To start with I have two IR senders which I wan't to try out with a receiver and a projector. I have followed all guides I can find, and thought I was doing things right, but apparantly not.

First thing, I have telnet into NI-3000 to try to send commands via telnet. To just do a basic operation, I wanted to send on IR port 2, with channel 9 which I understood is power for the receiver after reading from IREDIT. I tried "pulse[1:10:0,9]" which then states that it pulses. I see a small flash at the IR light on the NI-3000, but nothing happens. I try different IR ports, and find out that this is the only IR port that flashes when I try this command. I of course changed the port number, like: "pulse[1:9:0,9], pulse[1:10:0,9], pulse[1:11:0,9], pulse[1:12:0,9], and so on..." If I try the "ON" command, port 2 is the only one lit. What does this means? Is all of the others broken, or isn't it supposed to light at all? If I try port status via Netlinx Studio, they all come up with the same result. And I suppose it isn't as easy to just send a pulse via telnet. Is it a easy way to send commands through Netlinx Studio the same way?

And I have read about the DUET firmware which is able to run Java modules, I don't think I have the DUET firmware installed now. Is it possible to upgrade from regular to DUET? And is there a good guide on using Java modules instead?

If someone could help me with some of this questions, I would be very thankful. I am a complete newbie when it comes to AMX programming.

Comments

  • Options
    DHawthorneDHawthorne Posts: 4,584
    The lights on an IR port won't flash unless an IR file is loaded to that port that has an actual function on the channel you are pulsing. If the light flashes but nothing happens, then the loaded IR file is not correct, or something is wrong with the emitter (usually placed badly).

    You are using the right method to pulse them from Telnet (well, one of the right methods :)). Have you actually uploaded the IR files to those ports?
  • Options
    Thanks for help, I really appreciate it.

    I fell kinda stupid right now, but no I haven't uploaded the ir file to the IR port. I haven't done it before so I thought perhaps it would be sufficient if the .irl file existed in my workspace.

    Do I use Netlinx Studio to upload the IR file to a spesific port? And is it possible to see what IR file that allready exist on the actual port?
  • Options
    oleabakk wrote:
    Do I use Netlinx Studio to upload the IR file to a spesific port?

    Yes. Here is the conventional method (there are others)

    Create a program in NS2 which declares the relevant device:
    define_device
    dReceiver = 1:10:0
    

    You may have to compile it to make it visible in the workspace pane.

    Add the IRL in the IR branch of the workspace pane: Right click on IR folder - Add existing file.

    Map the IRL to the device: Right click on IRL icon - select device mapping - select dReceiver - click on Map.

    Add to the File Transfer list: Tools / File Transfer - Add - select the IRL.

    Now click on Send.
    oleabakk wrote:
    And is it possible to see what IR file that allready exist on the actual port?

    I don't think so. It shouldn't matter - just replace it.
  • Options
    Jeff BJeff B Posts: 37
    For simple testing I use IREdit.

    1. Open IR file to use with IREdit.

    2. Select: Tools, Comm Settings. Select Device Connection tab. Select the connection parameters needed for your system.

    3. Select: Tools, Send. In the dialog box set the D:P:S for the IR port you wish to use. Select Send.

    4. Select: Tools, Actuate. In the dialog box set the D:P:S for the IR port. In the channel list, select the command you want to test. Select Pulse. This will pulse the IR emitter.
  • Options
    DHawthorneDHawthorne Posts: 4,584
    Jeff B wrote:
    For simple testing I use IREdit.

    1. Open IR file to use with IREdit.

    2. Select: Tools, Comm Settings. Select Device Connection tab. Select the connection parameters needed for your system.

    3. Select: Tools, Send. In the dialog box set the D:P:S for the IR port you wish to use. Select Send.

    4. Select: Tools, Actuate. In the dialog box set the D:P:S for the IR port. In the channel list, select the command you want to test. Select Pulse. This will pulse the IR emitter.

    Even IREdit requires the file to be loaded to the IR port first.
  • Options
    Jeff BJeff B Posts: 37
    Yes, that was step 3

    3. Select: Tools, Send. In the dialog box set the D:P:S for the IR port you wish to use. Select Send.
  • Options
    DHawthorneDHawthorne Posts: 4,584
    Jeff B wrote:
    Yes, that was step 3

    3. Select: Tools, Send. In the dialog box set the D:P:S for the IR port you wish to use. Select Send.

    Rubs eyes vigorously ... . Ah, so it is :). Entirely missed that.
  • Options
    Thanks alot for this help:-)
    Looking forward to trying it out. I am on course yesterday and today, so will try out til monday. Have I nice weekend meenwhile:-)
  • Options
    Oki, worked like a charm!

    No wonder we werent getting any signals through when we didnt have any IR files attached to the IR senders :)

    Now we have a fully working system controlled from the mobile phone, via telnet/python code. As for now we are just sending individual signals via Python and telnet to the NI-3000 box,and it isnt the fastest - and we cant seam to set the pulse length, so makes tweaking the amp a little hard.

    Is it possible to access code from the program code on the box after compiling it?

    Like, you make a program to "AMP:SHUTDOWN" - and you can just call on that from telnet? Since we want some of the things we do to pulse fast, and you cant seam to put in any pulse timer command directly into telnet.

    If any of this makes sense and anyone understands what I am asking :)
  • Options
    Joe HebertJoe Hebert Posts: 2,159
    oleabakk wrote:
    Like, you make a program to "AMP:SHUTDOWN" - and you can just call on that from telnet?
    One virtual device will do the trick.
    DEFINE_DEVICE
    
    vdvCLI	= 33001:1:0	//Virtual Command Line Interpreter
    
    DEFINE_EVENT
    
    DATA_EVENT[vdvCLI] {
       COMMAND: {
          SEND_STRING 0, "'Got your command to ',DATA.TEXT"
          //call whatever function you want
       }
       STRING: {
          SEND_STRING 0, "'Got your string: ',DATA.TEXT"
          IF (FIND_STRING(UPPER_STRING(DATA.TEXT),'HELLO',1)) {
    	 SEND_STRING 0, 'Hello to you too'
          }
          //call whatever function you want
       }   
    }
    

    Now just telnet into the NI master, turn on messages with ?msg on?, and SEND_COMMANDs or SEND_STRINGs to your virtual CLI.
    >msg on
    Extended diagnostic information messages turned on.
    >send_command vdvcli, 'Jump in the lake.'
    >(0000245303) Got your command to Jump in the lake.
    send_string vdvcli, 'hello'
    >(0000259360) Got your string: hello
    (0000259360) Hello to you too

    HTH
Sign In or Register to comment.