Home > Community > Forums > PCB Design > PSPICE - Text string problem

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 PSPICE - Text string problem 

Last post Tue, Dec 3 2013 9:41 AM by Auftrag2013. 2 replies.
Started by Auftrag2013 22 Oct 2013 06:36 AM. Topic has 2 replies and 2068 views
Page 1 of 1 (3 items)
Sort Posts:
  • Tue, Oct 22 2013 6:36 AM

    PSPICE - Text string problem Reply

    Hi all,

    What I need to is define a text parameter, and compare it with another string.

    below is my spice code: 

    .SUBCKT XXX 1 2
    + TEXT: Material_Name = "AL"

    R 1 2 {IF(Material_Name=="AL", 100, 200)}

    but the pspice compiler said:

    **** EXPANSION OF SUBCIRCUIT X_R1 ****

    ERROR(ORPSIM-15166): Bad expression
     Material_Name is used as a PARAM here, but used as TEXT elsewhere.

    ERROR(ORPSIM-15081): Can't add param <Material_Name>.
    X_R1.R N00056 0 {IF(Material_Name=="AL", 100, 200)}
    ----------------$
    ERROR(ORPSIM-16318): Missing or invalid expression

    my question is, what is the correct syntax for comparing two string values...

    thank in advance

    • Post Points: 20
  • Tue, Dec 3 2013 8:08 AM

    • GeoffS
    • Not Ranked
    • Joined on Tue, Dec 3 2013
    • Posts 1
    • Points 20
    Re: PSPICE - Text string problem Reply

    I have been trying to do exactly the same. Did you find a solution?

    • Post Points: 20
  • Tue, Dec 3 2013 9:41 AM

    Re: PSPICE - Text string problem Reply

    Hi, I'm afraid to say... no I didn't find the answer...

    but there is one thing you should know...

    Even there is no "standard" function supported by PSPICE to compare two strings, you may probably try to implement the  function by yourself in Fortran. (like a char array in C)

     otherwise you have to let the User input the "Number" instead of "Letters"...

    • Post Points: 5
Page 1 of 1 (3 items)
Sort Posts:
Started by Auftrag2013 at 22 Oct 2013 06:36 AM. Topic has 2 replies.