Home AMX User Forum NetLinx Studio

Can I not declare a device array and pass it to a module?

AvophileAvophile Junior MemberPosts: 70
Can I not declare a device array and pass it to a module?
PROGRAM_NAME='module'

DEFINE_DEVICE

dvTP1 	= 	10001:1:0
dvTP2	=	10002:1:0

DEFINE_VARIABLE

DEV devTPs [ ] = {dvTP1, dvTP2}

DEFINE_MODULE 'module1' ABC123 (devTPs)

The error I am getting is this:
ERROR: Dimension mismatch: [0] vs. [1]
ERROR:Type or dimension conflict for [ABC123]

When trying to create a module with just a single device, I get a different error:
PROGRAM_NAME='module'

DEFINE_DEVICE

dvDEV	=	5001:1:0

DEFINE_MODULE 'module1' ABC123(dvDEV)

Brings up this error:
ERROR:Cannot convert type [DEV] to [INTEGER]
ERROR:Type or dimension conflict for [ABC123]

Comments

  • filpeefilpee Junior Member Posts: 64
    is the variable declared as an array in your module?


    module_name ="MyModule" (dev tpArray[])

    that should work for you.
  • AvophileAvophile Junior Member Posts: 70
    Thanks, filpee!

    MODULE_NAME='module1' (dev devtps [ ])

    ...solved my first problem.

    Any idea about the second error I am getting when attempting to pass a single device as a parameter to the module?
    ERROR:Cannot convert type [DEV] to [INTEGER]
    ERROR:Type or dimension conflict for [ABC123]


    Nevermind... similar deal.

    The module wanted the device declared like so:

    MODULE_NAME='module1'(dev dvDEV)
Sign In or Register to comment.