Home NetLinx Studio

Set a variable from a list?

emdx71emdx71 Posts: 5
edited July 15 in NetLinx Studio

Hi,

Trying to set a variable to tell the system if it has a DSP or not, based on a variable learned from the dsp itself when the system boots if its attached, so in simple terms if either a '64' or a '128' is returned from the device, has_dsp will = 1, however this is getting set as '1' regardless if there is something being returned or not. I assume i'm just not using the right operator

right now I'm using this under an online event for the dvMASTER device:

IF (DSP_TYPE = '"64'" || "'128'")
{
HAS_DSP=1
}

should the || be an ^^ for an xor
or am i going about this the wrong way?

Thanks

Comments

  • richardhermanrichardherman not-so-junior member Posts: 254
    edited July 15

    I assume you meant:

    if (dsp_type == '64' or dsp_type == '128')
    {
        has_dsp = 1
    }
    

    ('64' or '128') wil always evaluate to true.

    Now it's another thing how, when the master comes online, it will know about anything returned from that device?

  • emdx71emdx71 Posts: 5

    @richardherman said:
    I assume you meant:

    if (dsp_type == '64' or dsp_type == '128')
    {
        has_dsp = 1
    }
    

    ('64' or '128') wil always evaluate to true.

    Now it's another thing how, when the master comes online, it will know about anything returned from that device?

    Thank you sir. This worked as expected. I have a function defined to poll the dsp to get basic info from it, so as long as its on the correct port once a dsp is "detected" it sets everything into motion

Sign In or Register to comment.