Home AMX User Forum NetLinx Studio

data.text problem

Hi,

I'm trying to get my feedback from the devices i'm controlling (via Serial port) and for some reason my data.text never gets any value. I was using include files and tried to put all codes on the same file so i would be able to debug my code line per line but for some reason i couldn't. Also i tried to use create_buffer instead of the data.text to get the command feedback from the device (I'm using a AMX Module to control the device) and it also never gets any value.

I tried to reset the controller using the reset factory command and it didnt worked too.

Any more suggestions??

Thank you,

André Roberto da Silva

Comments

  • mpullinmpullin Posts: 949
    Maybe there is no data to get. How do you know the device is working?
  • I'm already controlling the device via the touch panel. I can see the feedback statements on the device notifications options. Both virtual and real device are replying back to the controller and I can see the feedbacks on my netlinx studio on the device notification window.
  • mpullinmpullin Posts: 949
    So create a data_event in your main program that looks like this:
    DATA_EVENT[vdvVIRTUAL_DEVICE]{
         string:{
              SEND_STRING 0, "'virtual device says:',DATA.TEXT";
         }
    }
    
    And turn on your diagnostics. You should see something.
  • I suppose that it's not even going to the COMMAND OR STRING line on the data_event because i was unable to see any string sent to the device 0. Altought I do know that I'm receiving feedback from the device to the master because I can see command from [40004:1:1] - [INPUTSELECT-1].

    On the device notification options I tried to see all the strings and commands going and coming and still was not able to see the message: virtual device says:

    The firmware of the master controller is updated to. Is possible that maybe this controller have a factory problem or something? I do have another controller on the smaller auditorium that I'm programming right now and I have the same problem there.

    Thank you for the help.
  • PhreaKPhreaK Posts: 966
    Judging by the command you referenced I'm guessing that you're using a Duet module to communicate with the device. When you've got a duet module instantiated the NetLinx data event handler will not fire for events originating from the phsyical device (aka serial port). If you want to catch string events from the actual device shoot the duet module a "'PASSBACK-1'" command and the duet virtual will pass back incoming strings from the physical device.
    data_event[vdvDevice]
    {
    	online: {
    		send_command vdvDevice, "'PASSBACK-1'"
    	}
    	string: {
    		// You will now get string from the real device here
    	}
    }
    
  • Even with equipments that I'm not using any module I'm not receiving any feedback. I tried in another controller in other project that I was working for and it worked perfectly. The weird part is that both controllers in this job site doesn't work. I'm about to decide that this is a hardware problem.
  • svTechsvTech Posts: 44
    It could be several things.

    a) Are you listening for the return strings on the physical device (5001:2:0)?
    b) If you use "Create_Buffer", are you checking the buffer in the DATA_EVENT for the physical device (STRING event)? Or in mainline to see that it has data?
    c) To check the Netlinx hardware, short the TX and RX pins together on the DB-9. Then anything sent will automatically be returned. This will indicate whether the hardware and cabling are working.
    d) Does the device you are controlling require RTS/CTS? If so, it may not respond until you pull the RTS low. In these cases, it is usually good enough to short pins 7 and 8 together on the DB-9 (or other connector) connected to the device you are trying to control.

    These are some possible causes that I can think of.
  • Spire_JeffSpire_Jeff Posts: 1,917
    I do know that I'm receiving feedback from the device to the master because I can see command from [40004:1:1] - [INPUTSELECT-1].

    Are you using a Duet module? If so, you need to use the PASSBACK and PASSTHRU commands. Duet takes over the serial port and prevents NetLinx from even getting the notifications (on most modules).

    Jeff
  • HedbergHedberg Posts: 671
    It seems very unlikely that this is a hardware problem with the AMX master. Apparently, the processor is receiving the interrupts and strings from some devices because you can see them in diagnostics (if I understand correctly). I don't think there is anything with the hardware which would allow messages to diagnostics but would prevent a data_event string or command handler from working properly.

    As mentioned in another commenter, there are things that can prevent strings from being properly processed and it's not impossible that you've got something goofy somewhere. Check the things about the duet modules (passback, etc) and make sure you've got a string handler in your data event or a properly configured buffer. Try RXON, also.

    If you can't figure out the problem otherwise, my suggestion would be to clear out the program, or load a program with a data_event for just one serial port. Use that data_event to properly configure the serial port (in online: handler) and put a string handler in it which will put the data.text string into a buffer you can look at in debug. Then use telnet (available in Windows XP and elsewhere) to send strings to the connected device and watch for the response. In other words, go back to the simplest possible configuration where you know that you can send a device a good string and get a good response.

    Oh, among other things, some equipment hooked to AMX serial ports will not work if pins other than 2,3,5,7, and 8 are connected. Make sure you don't have anything connected to pins 1,4,6, and 9 on the AMX end of the cable, including one of those goofy little null modem adapters.

    Then there is the dead serial port issue. There have been recent threads about that.

    Good luck with it.
  • The problem was exactly the last of all things that I tried. The installer made all cables using all pins on the serial cable. After fixing the cables, everything got working.

    Thank you all for the attention!
Sign In or Register to comment.