Home AMX User Forum NetLinx Studio

Module/Virtual Device Question

I'm pulling my hair out over a simple problem. I can't get a virtual device that's been passed off to a module to handle events from the master program. The modules run fine. I can setup a timeline inside a module and have it tick away with send_string 0 messages. Sending events to the virtual device however is fruitless. Here's some sample code.

Main
[PHP]
DEFINE_DEVICE
dv1 = 5001:1:0;
dvTp = 10001:1:0;
vdv1 = 41001:1:0;

.....


DEFINE_START
DEFINE_MODULE 'TestMod' tmcomm(vdv1,dv1);

DEFINE_EVENT
BUTTON_EVENT[dvTp,1]
{
push:
{
send_command vdv1,"'SomeCommand'";
}
}
[/PHP]

Module
[PHP]
MODULE_NAME='TestMod'(dev vdv1, dev dv1)

.......

DEFINE_EVENT
DATA_EVENT[vdv1]
{
command:
{
send_string 0,"'Command=',data.text";
}
}

[/PHP]

When the button's pushed nothing happens. I don't get anything in the notifications section of NetLinx Studio. What am I doing wrong? I've written modules like this in the past and had everything work as expected. Now nothing. Is there something obvious that I'm missing? Also, should my virtual devices show up in the on-line tree?

Thanks,
R

Comments

  • rynandorynando Posts: 68
    I should also mention that when I load up a duet module it works as expected. I can manipulate the virtual device it exposes just fine. My own Netlinx modules are a different story.
  • ericmedleyericmedley Posts: 4,177
    Hmmm... Nothing stands out from what you've posted.

    However, one thing... Your module is not duet. So, I'd keep the device of the virtual in the 3X,000 s range not the 4X,000. I don't know if this could be the problem since I've never ran into any issues myself.

    Perhaps try changing the virtual device number to 34001 or something. Perhaps it's stomping on a duet module someplace.

    hope that helps.
    e
  • DHawthorneDHawthorne Posts: 4,584
    Virtual devices in the 41000 address range are reserved for Duet and won't work in a NetLinx module. Likewise, you can't use the 33000 range for Duet. Change that 41001 address to 33001, and it will work.
  • rynandorynando Posts: 68
    DHawthorne wrote: »
    Virtual devices in the 41000 address range are reserved for Duet and won't work in a NetLinx module. Likewise, you can't use the 33000 range for Duet. Change that 41001 address to 33001, and it will work.

    This was the issue! I didn't realize that that address space was reserved for duet. My Netlinx modules would initialize and run in that range which was throwing me off; I just couldn't interact with them which makes perfect sense now. With the module renumbered to 33xxx it works as expected and shows up in the online tree.

    Thanks to both of you.
    R
Sign In or Register to comment.