CHAIN_DEVICES

CHAIN_DEVICES is a read-only built-in integer giving the total number of JTAG devices that XJTAG expects to be in the current dynamic chains profile, across all active JTAG chains in that profile. This is particularly useful when processing the output of the CHECKCHAIN function. This is a global read-only built-in.

Example

This example uses the CHECKCHAIN function to test whether the expected hardware is attached. If it is not detected it prompts the user to attach it and allows them to try again.

The function in the example can be called multiple times (from different profiles) in order to check that all chains on the UUT are functioning, because the value of CHAIN_DEVICES will change as different profiles are selected.

CheckChain()(INT result)
  INT key;

  DO
    CHECKCHAIN()(result);
  WHILE result != CHAIN_DEVICES
    PRINT(CIRCUIT_NAME, " was not correctly detected - check it is attached to the XJLink.\n");
    PRINT("Press space bar to try again, or Q to quit.\n\n");
    DO
      key := WAITKEY();
    UNTIL key = ' ' ||? key = 'q' ||? key = 'Q'
    END;
    IF key != ' ' THEN EXIT; END;
  END;

  result := 0;
END;

See Also