NI Home > Community > NI Discussion Forums

Circuit Design Suite

Showing results for 
Search instead for 
Do you mean 
Reply
Member
Werewolf-Prankster
Posts: 3
0 Kudos
Accepted Solution

Problemms with simple XSpice model

I try to create a simple XSpice model. For example NOT-element.
I wrote MOD and IFS files and compiled it. But element work one time, when i start simulation.
IFS-file

NAME_TABLE:
C_Function_Name: cm_testor
Spice_Model_Name: testor
Description: "A simple gain block"
PORT_TABLE:
Port_Name: in out
Description: "input" "output"
Direction: in out
Default_Type: d d
Allowed_Types: [d] [d]
Vector: no no
Vector_Bounds: - - 
Null_Allowed: no no

Mod File

SPICEdev * FAR DynDEVices[] = {
    &cm_testor_info
};
#include 
#include 
void cm_testor(ARGS)
{
	if(INPUT_STATE(in) == ONE)
		OUTPUT_STATE(out) =  ZERO;	
	else
		OUTPUT_STATE(out) = ONE;
}
Active Participant
Tien_P
Posts: 1,198
0 Kudos

Re: Problemms with simple XSpice model

Hi Werewolf-Prank,

 

Can you send us the source code, the compiled dll and circuit you used to test the model.

 

Tien P.

National Instruments
Member
Werewolf-Prankster
Posts: 3
0 Kudos

Re: Problemms with simple XSpice model

Code and project in the attachment

Thank you 

Member
Werewolf-Prankster
Posts: 3
0 Kudos

Re: Problemms with simple XSpice model

Any body can help me?

Active Participant
Tien_P
Posts: 1,198

Re: Problemms with simple XSpice model

Hi,


I am sorry for the long delay, I was only able to get you code to work during the intial stage but when the simulation was running the component didn't toggle between high and low.  I had to get help from a developer to make this model  toggle between high and low during the simulation.

 

Attached is the .mod, ifs and the dll we created.   In the .mod file, we modify your code to include a delay, without the delay Multisim will not toogle during simulation.  Also, in the .ifs file, I added a parameter section  for the rise_delay paremter.

 

When you create a component in Multisim using the Component Wizard, in step 1, make sure you select "Digital" under "Component Type" and then select "Til" from the "Component Technology" field.

 

 

Tien P.

National Instruments