Home AMX User Forum AMXForums Archive Threads AMX Hardware

Device Emulation

I have been trying to debug a module I wrote that deals with device feedback. In the process of debugging I was using device notifications and the "Emulate a Device" tool to send strings from COM port 2.

On the NI-700 (firmware v2.95.214) that I was using, when I emulated strings to the master it would not trigger the data event for that port. I could see the string in device notifications, but my code would not run. No matter what I tried, I could not get the data event to work. The RX light on the COM port I was emulating does NOT light up, but the Input light does flash.

This seemed odd behavior to me so I switched to another processor. On a NI-3000 (firmware v2.32.145) with the exact same compiled code and the same string output from the device emulation on the same port, the data event was triggered. In this case, the string shows up on the device notifications and the RX light DOES pulse when the string is emulated.

Has anyone else experienced this with Device Emulation? Could someone from AMX please look into this odd behavior?

Comments

  • DHawthorneDHawthorne Posts: 4,584
    I've had mixed results with Device Emulation and Control myself, it never occurred to me to associate it with a particular master. However, I often confuse myself with how they work in the first place. Control is the one that activates the device directly, Emulation is the one that fakes the device and it's responses to the master. I am always getting them mixed up. But both generate notifications, or should anyway (just did on my test master).
  • Greetings Mr. Bailey and company,
    Thanks for bringing up this issue on the emulator. I will begin the process of looking into this. I would encourage you to call things like this in to support as well. We don't routinely monitor the forums for engineering issues. The moderators do the best they can to bring these types of issue to us however.
    Thanks again for your support and honesty in these forums.
  • Thank you for your prompt response on this issue. I wanted to post of the forums and make sure I wasn't overlooking something simple before calling up tech support and making a fool of myself. :)

    Please let me know of any developments on this issue.
  • cbailey wrote:
    I have been trying to debug a module I wrote that deals with device feedback. In the process of debugging I was using device notifications and the "Emulate a Device" tool to send strings from COM port 2.

    On the NI-700 (firmware v2.95.214) that I was using, when I emulated strings to the master it would not trigger the data event for that port. I could see the string in device notifications, but my code would not run. No matter what I tried, I could not get the data event to work. The RX light on the COM port I was emulating does NOT light up, but the Input light does flash.

    This seemed odd behavior to me so I switched to another processor. On a NI-3000 (firmware v2.32.145) with the exact same compiled code and the same string output from the device emulation on the same port, the data event was triggered. In this case, the string shows up on the device notifications and the RX light DOES pulse when the string is emulated.

    Has anyone else experienced this with Device Emulation? Could someone from AMX please look into this odd behavior?

    Maybe not exactly matching this thread but it may be an issue...
    While testing a dealer's program, I have disabled the runmode and rebooted the master. Next I did was to hotwire Rx and Tx on a COM port to check something. On a NI-X000 this works, I'll get the STRING FROM notification. But if I try this on a NXM-COM2, I will get no notification.

    After some more testing I found that on a NI-x000 the RXON is somehow set automatically, but on a NXC-COM2 (and so maybe also on a NI-700) I have to do this manually either by sending the command RXON to that port, or (in case of an active program) with a CREATE_BUFFER() which is doing this internally.
  • HedbergHedberg Posts: 671
    Marc Scheibein wrote:
    After some more testing I found that on a NI-x000 the RXON is somehow set automatically, but on a NXC-COM2 (and so maybe also on a NI-700) I have to do this manually either by sending the command RXON to that port, or (in case of an active program) with a CREATE_BUFFER() which is doing this internally.

    I've just been playing with an NI700 and I find that, at startup, an RXON command is sent to 5001:2:0 if there is a STRING: handler present in the appropriate DATA_EVENT, but it is not sent if the STRING: handler is removed. My guess is that the master is considering the STRING: handler to be equivalent to a CREATE_BUFFER in this respect.

    For some reason, I can't get the thing to refrain from sending RXON to the first port (5001:1:0).

    In any case, I've observed the same thing as CBailey with the NI700 and the device emulator -- the device notifications shows a "String From," but it doesn't appear to actually occur.

    Harold
  • Joe HebertJoe Hebert Posts: 2,159
    cbaily wrote:
    On the NI-700 (firmware v2.95.214) that I was using, when I emulated strings to the master it would not trigger the data event for that port. I could see the string in device notifications, but my code would not run. No matter what I tried, I could not get the data event to work. The RX light on the COM port I was emulating does NOT light up, but the Input light does flash.
    On the NI-700 (DUET firmware v3.11.323) that I?m using, the emulated strings sent to the master show up in device notifications and DO trigger the data events for both Comm ports as expected. However, like your non DUET firmware, the RX lights for the Comm ports do NOT light but the Input does flash.

    Here is the code I tested with:
    DEFINE_DEVICE
    
    dvComm1 = 5001:1:0
    dvComm2 = 5001:2:0
    
    DEFINE_EVENT
    
    DATA_EVENT[dvComm1] {
       STRING: {SEND_STRING 0, "'String from Comm 1:',data.text"}
    }
    
    DATA_EVENT[dvComm2] {
       STRING: {SEND_STRING 0, "'String from Comm 2:',data.text"}
    }
    
    If I go the CREATE_BUFFER route and watch variables I see the data arrive as expected also.

    Interesting thread?
Sign In or Register to comment.