Device Wiring: Using formulas to deliver specific wire numbers


SOLIDWORKS Electrical uses variables that sends information to the data base, (Component marks, wire numbers…). This information in the variables can then be utilized via the formula manager so that it can be displayed in your documentation.

For example:

  • Equipotential number coming from the database: "5"
  • This value is stored in the variable "EQU_NO"
  • If you want to present this information on your drawing as "005" (N° displayed with 3 characters), you will need to use the following formula: STRZ(VAL(EQU_NO), 3, 0)


Existing inside of SOLIDWORKS Electrical is a large number of predefined formulas.  However, there are instances where you are looking for a very specific wiring sequence and using the formula manager you can create these wiring numbers.   

  • A formula is made up of variables and text.
  • Text needs to be placed within quotes
  • Each variable or string of text should be separated by a "+" sign.
    • For example: CHAN_TYP + ":" + COM_VAL1 + "." + CHAN_ADDR
    • Certain functions are often used to work on a variable like a leading zero
      • STRZ (VAL(FIL_NO),2,0) sends the drawing number represented with 2 characters, The missing character here is replaced by a 0 (e.g.: 01, 02, …).
      • You can use arithmetic functions ( + – * /) to modify the result of the variables.
        • STRZ(VAL(EQU_NO)*2,4,0) sends the number of equipotentials represented as 4 characters, but by only using the even numbers.


PLC I/O wire number formula


For our documentation requirement, we would like to have it read, 12ga-I.01-4  (where 4 is an arbitrary number that allows us to have no duplicate wires)

Using the address or also known in the formula as Origin component terminal number (COR_TNO) we can get most of our number.



Our completed formula would look like the following:

“12ga-“ + COR_TNO +  “-“ + EQU_NO






Corey Kubichka

Computer Aided Technology, Inc.