NEC-2 Card Deck Functions
(Last changed: June 21, 2009)

Note: the calls on this page, although still available, are now deprecated since arcs, helices, surface patches and GM cards are now implemented by native NC Functions.

Although NC now supports geometries other than straight wires, you can still generate NEC-2 cards directly. These calls allow you to precisely specify the card fields.

You have to be careful to ensure that the tags that are specified by cards do not conflict with the tags that NC uses. NC starts with tag number 1. You can check by looking at the card deck which cocoaNEC generates.

Since NEC-2 cards references segments by using tag and segment numbers, the geometry sub-structures that are generated from the card deck functions will not be able to use NC functions that references elements. This includes the use of functions such as currentFeed, shortTransmissionLine, etc. However, the parameters that are passed to the card deck functions can be NC variables, expressions and attributed constants such as feet, inches and AWG wire gauges.

Since NC wire and line functions eventually generate GW card images for NEC-2 to process, you can connect an native NC wire to a geometry sub-structure that is generated from a card deck function by placing the ends of the two types of wires close enough to one another. You can use this mechanism to cross over from a card deck geometry to use the currentFeed facility of NC, for example.

The following NC model shows how cards can be mixed with the native NC functions.
mixed

Normally, when creating a card deck, you have to be careful about the precise order of geometry card, network, transmission lines and frequency specifications. You need not exercise the same care when you are using the NC card functions. The interpreter will assemble the cards in the proper order. The setFrequency function call can come before a gwCard call, for example.

Notice from the above example that the native NC wire geometry function and the native setFrequency control function can be inter-mixed with functions that generate the card deck GW card and EX card. Notice too that the arguments sent to the card functions can be NC constants, variables and expressions.


Geometry Cards

A Wire Arc (GA) card is generated by using the gaCard function:

gaCard( i1, i2, f1, f2, f3, f4 ) where i1, i2, f1, f2, f3 and f4 correspond to I1, I2, F1, F2, F3 and F4 respectively in the NEC-2 manual.

A Helix (GH) card is generated by using the ghCard function:

ghCard( i1, i2, f1, f2, f3, f4, f5, f6, f7 ) where i1, i2, f1, f2, f3, f4, f5, f6 and f7 correspond to I1, I2, F1, F2, F3, F4, F5, F6 and F7 respectively in the NEC-2 manual.

A Coordinate Transformation (GM) card is generated by using the gmCard function:

gmCard( i1, i2, f1, f2, f3, f4, f5, f6, f7 ) where i1, i2, f1, f2, f3, f4, f5, f6 and f7 correspond to I1, I2, F1, F2, F3, F4, F5, F6 and F7 respectively in the NEC-2 manual.

A Generate Cylindrical Structure (GR) card is generated by using the grCard function:

grCard( i1, i2 ) where i1, i2 correspond to I1, I2 respectively in the NEC-2 manual. Note that this will also make copies of geometry that is generated by NC native functions such as wire() and line().

A Scale Structure (GS) card is generated by using the gsCard function:

gsCard(f1 ) where f1 is the scale factor. Note that this will scale the entire antenna structure, including geometry elements that are generated by NC native functions such as wire() and line().

A Wire Specification (GW) card is generated by using the gwCard function:

gwCard( i1, i2, f1, f2, f3, f4, f5, f6, f7 ) where i1, i2, f1, f2, f3, f4, f5, f6 and f7 correspond to I1, I2, F1, F2, F3, F4, F5, F6 and F7 respectively in the NEC-2 manual. You can mix GW cards with geometry elements that are generated by NC native functions such as wire() and line(). However, control functions for GW cards, such as excitations and transmission lines, must be made using other card. You will not be able to use native functions such as currentFeed() with wires that are generated by gwCard. (You can splice wires between them since NEC-2 will join wires that are sufficiently close to one another.)

A card that Reflects the Structure around coordinate planes (GX) is generated by using the gxCard function:

gxCard( i1, i2 ) where i1, i2 correspond to I1, I2 respectively in the NEC-2 manual. Note that this will also make copies of geometry that is generated by NC native functions such as wire() and line().

A Surface Patch (SP) card is generated by using the spCard function:

spCard( i2, f1, f2, f3, f4, f5, f6 ) where i2, f1, f2, f3, f4, f5 and f6 correspond to I2, F1, F2, F3, F4, F5 and F6 respectively in the NEC-2 manual. Please note that a surface patch will not be drawn in the Geometry view of the Output window.

A Surface Patch Continuation (SC) card is generated by using the scCard function:

scCard( i2, f1, f2, f3, f4, f5, f6 ) where i2, f1, f2, f3, f4, f5 and f6 correspond to I2, F1, F2, F3, F4, F5 and F6 respectively in the NEC-2 manual.

A Multiple Patch Surface (SM) card is generated by using the smCard function:

smCard( i1, i2, f1, f2, f3, f4, f5, f6 ) where i1, i2, f1, f2, f3, f4, f5 and f6 correspond to I1, I2, F1, F2, F3, F4, F5 and F6 respectively in the NEC-2 manual. Please note that a surface patch will not be drawn in the Geometry view of the Output window.

The continuation card (SC) follows the scCard format above, with i1, i2, f4, f5 and f6 set to 0.


Control Cards

An Excitation (EX) card is generated by using the exCard function:

exCard( i1, i2, i3, i4, f1, f2, f3, f4, f5, f6 ) where i1, i2, i3, i4, f1, f2, f3, f4, f5 and f6 correspond to I1, I2, I3, I4, F1, F2, F3, F4, F5 and F6 respectively in the NEC-2 manual.

A Loading (LD) card is generated by using the ldCard function:

ldCard( i1, i2, i3, i4, f1, f2, f3, f4, f5, f6 ) where i1, i2, i3, i4, f1, f2, f3, f4, f5 and f6 correspond to I1, I2, I3, I4, F1, F2, F3, F4, F5 and F6 respectively in the NEC-2 manual.

A Network (NT) card is generated by using the ntCard function:

ntCard( i1, i2, i3, i4, f1, f2, f3, f4, f5, f6 ) where i1, i2, i3, i4, f1, f2, f3, f4, f5 and f6 correspond to I1, I2, I3, I4, F1, F2, F3, F4, F5 and F6 respectively in the NEC-2 manual. Unless you are certain of the tag of a wire that is generated with a native NC element, you cannot use an ntCard between a wire that is generated by gwCard and a wire that is generated as an NC element. You can, however splice a pair of short wires to one of the wires and then use either a ntCard or a native NC network() function call.

A Transmission Line (TL) card is generated by using the tlCard function:

ntCard( i1, i2, i3, i4, f1, f2, f3, f4, f5, f6 ) where i1, i2, i3, i4, f1, f2, f3, f4, f5 and f6 correspond to I1, I2, I3, I4, F1, F2, F3, F4, F5 and F6 respectively in the NEC-2 manual.Unless you are certain of the tag of a wire that is generated with a native NC element, you cannot use a tlCard between a wire that is generated by gwCard and a wire that is generated as an NC element. You can, however splice a pair of short wires to one of the wires and then use either a tlCard or one of the native NC transmissionLine() function calls.