Thanks for the inputs.
A dual diode has 2 inputs and 1 output similar to an op-amp . Just think of it as a math-block, and for the component outline just draw a square box with B&C inputs and K output pins. I finally realized that my post was more about spice syntax than diodes.
For example R 1 0 100 refers to the component name R, followed by 2 node numbers followed by a value.
My usage follows that same pattern:
BIA C K I=URAMP(V(B,K)) + URAMP(V(C,K)) the component name BIA stands for ( Behavioral, Current Source, XSPICE model, took a while to find that)
The nodes are C (or B) & K from the subckt line pin list
The value is the equation [ I=URAMP(V(B,K)) + URAMP(V(C,K)) ]
At every spice interval the equation V(B,K) produces V=B-K and the URAMP function returns either the difference value or zero if it is negative. It is safe in this case to add the two together since when one is negative, the other is positive because of the nature of the AC input. Then the result of the function is assigned to the variable I.
My confusion in part, is [ BIA C K ] or [ BIA B K ], in which the B or the C, make no difference. The output node is always K, however the first node can be either of the two input nodes in the subckt line, but the syntax requires something in that position. I think the B or the C is just a syntax placeholder and doesn’t enter into the equation.
I’m not sure I fully understand yet, but ngspice doesn’t complain.
.subckt Dx2 B C K
BIA C K I=URAMP(V(B,K)) + URAMP(V(C,K))
.ENDS