Multisim and Ultiboard

cancel
Showing results for 
Search instead for 
Did you mean: 

Problemms with simple XSpice model

Solved!
Go to solution

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;
}
0 Kudos
Message 1 of 5
(3,685 Views)

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
0 Kudos
Message 2 of 5
(3,654 Views)

Code and project in the attachment

Thank you 

0 Kudos
Message 3 of 5
(3,639 Views)

Any body can help me?

0 Kudos
Message 4 of 5
(3,578 Views)
Solution
Accepted by Werewolf-Prankster

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
Download All
Message 5 of 5
(3,516 Views)