Home AMX User Forum AMX General Discussion
Options

Get the system ID

Is there any function in Netlinx Studio to obtain the own System ID number? I need that information for my program to compare the number with some others because I'm working with 60 masters together...

Thanks

Elena

Comments

  • Options
    DHawthorneDHawthorne Posts: 4,584
    The system variable SYSTEM_NUMBER is supposed to contain this, though I must admit I've never used it.
  • Options
    The system variable SYSTEM_NUMBER will give you the system number of the master the code is running.
    IF(SYSTEM_NUMBER = 3)
    {
      // do something if the system number is 3....
    }
    
    Another application
    DEFINE_DEVICE
    dvMaster = 0:1:0
    
    DEFINE_VARIABLE
    INTEGER nMySysNum = 3 // the system number the master should have
    
    DEFINE_EVENT
    DATA_EVENT[dvMaster]
    {
      ONLINE:
      {
        IF(SYSTEM_NUMBER <> nMySysNum) // if the current system number differs
        {
          SET_SYSTEM_NUMBER(nMySysNum) // set the new system number
          REBOOT(dvMaster) // reboot the system to take effect
        }
      }
    }
    
  • Options
    ericmedleyericmedley Posts: 4,177
    SYSTEM_NUMBER does give it to you. I use it all the time.
  • Options
    System number

    Thanks! :)
Sign In or Register to comment.