Home |
Search |
Today's Posts |
|
#1
|
|||
|
|||
Antenna programming tool/language/compiler/preprocessor?
|
#2
|
|||
|
|||
Antenna programming tool/language/compiler/preprocessor?
Richard Clark wrote:
... programmer. Besides, C is a pretty crummy language with even more horrid library syntaxes (assembler is far more elegant). 73's Richard Clark, KB7QHC A lot of people like to think themselves programmers, real programmers use C/C++. (Weekend programmers use visual basic) C is simply a macro language which calls assembler procedures and functions--Dennis Richie was a real assembly language programmer, he simply designed a "shorthand" language for using assembler--C itself was written in assembler--nowadays C can compile and link itself ... a real C programmer will add to the C libraries and include files using assembler definitions, procedures and functions. While every subroutine of a C program is a function, they can be written as procedures which are only cloaked as functions. Example: #include iostream void helloworldprocedure(void) { cout "hello world!" endl; } void main(void) { helloworldprocedure(); } .... takes no parameters, returns none ... I think most C programmers prefer to program in assembly (but with windows allowing NO direct access of devices, peripherals, memory or disk--why bother, assembly can only be used as a wrapper to call windows libs/dlls/activex/scripts/etc., or custom ones--linux can be made to allow direct access), however, C adds a productivity factor of magnitudes over assembly. No other language offers the efficiency of program "character text" (source code) to actual binary code compiled/linked by C. Indeed, any C compiler I have ever seen gives a option to spit out assembler source .... and the assembler source so generated is quite capable of being assembled/linked by an assembler/linker for the platform in question. C simply has no rules which cannot be broken, even if it breaks all programming rules, and you want to override them, go ahead! (bill gates won't let you break windows rules though :-( )--C is only structured if you program in a structured style. For that reason alone, it is not a good language for newbie programmers ... JS |
#3
|
|||
|
|||
Antenna programming tool/language/compiler/preprocessor?
On Sat, 16 Jun 2007 00:13:37 -0700, John Smith I
wrote: Example: #include iostream void helloworldprocedure(void) { cout "hello world!" endl; } void main(void) { helloworldprocedure(); } ... takes no parameters, returns none ... Horrid examples of language, these are like the proverbial turds in the punch bowl at a party. I think most C programmers prefer to program in assembly (but with windows allowing NO direct access of devices, peripherals, memory or disk--why bother, assembly can only be used as a wrapper to call windows libs/dlls/activex/scripts/etc., or custom ones--linux can be made to allow direct access), Most C programmers are Neanderthals with their skills frozen in the 70s. There is at least one Windows Assembler out there, it's free and has been available for years from Steve Gibson at: http://www.grc.com/smgassembly.htm His executables perform network connections in file sizes of barely more than 5K up to a massive 22K. however, C adds a productivity factor of magnitudes over assembly. Bull Looney. This kind of syrupy rationale was composed to sooth the nerves of Dilbert's pointy haired boss. It merely reveals that many coders need training wheels to allow them to ride faster when designers could have walked there in half the time. C is NOT a user language. 73's Richard Clark, KB7QHC |
#4
|
|||
|
|||
Antenna programming tool/language/compiler/preprocessor?
Again,
my intention is, not to re-invent the programming language "C". My intention is, to describe in a prooven language an antenne. I decided the programming language C, because it is most used language on the world. I have not given any name for my language to the pre-processor. Lets call this as SNEC - just for "Symbolic NEC". The commands for the pre- processor has similar syntax to the programming language C. But not exactly the same. It has many limitations. As an example, I show you one of the source code of a horn antenna for WLAN. It has three modules. As you can see, the language is as superset of NEC2 and 4NEC2. It can be adapted easily to any other antenne defining formats. If the pre-processor detects an unknowing command, it will do nothing. Just taking the line of code and writing to output file. A special set of commands will be interpreted by the pre-processor. It will translate it into the 4NEC2/NEC2 commands. That is all. It is a very simple language, but you can design very complex antenna model with few lines of "code". The output file has a lot of kilobytes of code! It will split surface patches into many segments or wires. The main module is Horn1.txt. Aziz --------------- File: Horn1.txt ------------------------- CM Horn Antenna Model at 2.437 GHz (C) 2007 by Aziz Oeguet CE #include "Common.txt" #include "PP4NEC2Defs.txt" #ifndef H_wrmode H_wrmode = 0 // Drahtmodus (0=Surface-Path, 1=Wire-Modus) #endif #if (H_wrmode) // Parameter für Wire-Modus #pragma mode = _MODE_WR, wrnumseg = 1, wrtagstart=5000, wrtaginc = 1, wrradius = 0.00075 #pragma symode = _SYMODE_REUSE #else #pragma mode= _MODE_SP #pragma symode = _SYMODE_REUSE #endif //--- Biquad-Parameter definieren --- BQ_nsegw = 8 // Number of segments for width BQ_nsegh = 8 // Number of segments for height BQ_RW = 0.10 // Reflector width (y-axis) BQ_RH = 0.10 // Reflector height (z-axis) // Erreger-Antenne einfügen #include "FeedBiQ.txt" refdist = 0.014617 // Reflector distance to antenna // Box parameters B_Px = -refdist // Position of box (x-Axis) B_Py = 0 // Position of box (y-Axis) B_Pz = 0 // Position of box (z-Axis) #if (H_wrmode) B_lseg = 25 // Number of segments for length (x-axis) B_wseg = 21 // Number of segments for width 2 (y-axis) B_hseg = 18 // Number of segments for height 2 (z-axis) #else B_lseg = 30 // Number of segments for length (x-axis) B_wseg = 24 // Number of segments for width 2 (y-axis) B_hseg = 20 // Number of segments for height 2 (z-axis) #endif B_W1 = BQ_RW // Box width 1 (y-axis) B_H1 = BQ_RH // Box height 1 (z-axis) // Opt. simuliert B_L = 0.385216 // 0.398 // Box length (x-axis) B_W2 = 0.40 // Box width 2 (y-axis) B_H2 = 0.291 // Box height 2 (z-axis) #if (H_wrmode) B_nBox = 1 // Number of box divisions for a better segmentation #else B_nBox = 10 // Number of box divisions for a better segmentation #endif #if B_nBox == 1 B_wseg1 = B_wseg // Number of segments for width 1 (y-axis) B_hseg1 = B_hseg // Number of segments for height 1 (z-axis) #else B_wseg1 = 2+B_W1/(B_W2/B_wseg) // Number of segments for width 1 (y- axis) B_hseg1 = 2+B_H1/(B_H2/B_hseg) // Number of segments for height 1 (z- axis) #endif // Deltas for box divisions B_DH = (B_H2-B_H1)/B_nBox B_DW = (B_W2-B_W1)/B_nBox B_DL = B_L/B_nBox //--- Horn Reflektor --- B_dws = (B_wseg - B_wseg1)/B_nBox B_dhs = (B_hseg - B_hseg1)/B_nBox for (i=0; i B_nBox; i=i+1) { #if i==0 #Box %%(B_wseg1+i*B_dws) %%(B_hseg1+i*B_dhs) %%(B_lseg/B_nBox) (B_Px+%%i*B_DL) B_Py B_Pz (B_W1+%%i*B_DW) (B_W1+%%(i+1)*B_DW) (B_H1+% %i*B_DH) (B_H1+%%(i+1)*B_DH) B_DL BLRUD _8ALL #else #Box %%(B_wseg1+i*B_dws) %%(B_hseg1+i*B_dhs) %%(B_lseg/B_nBox) (B_Px+%%i*B_DL) B_Py B_Pz (B_W1+%%i*B_DW) (B_W1+%%(i+1)*B_DW) (B_H1+% %i*B_DH) (B_H1+%%(i+1)*B_DH) B_DL LRUD _8ALL-_4ALL #endif } // for i ofsx = -B_L-B_Px // Offset structure // Achsen-Transformation (verschieben, um aus dem Nahfeld rauszukommen) GM 0 0 0 0 0 ofsx 0 0 0 // End-Of-Geometry GE 0 //--- Wire-Load (HF-Speisung) --- EX 0 Ant_Feed_Tagnr Ant_Feed_Segnr 0 1.0 0.0 LD 5 0 0 0 62900000 // Extended-Wire-Kernel einschalten EK 1 //--- Frequency Parameter and Execute --- FR 0 1 0 0 freq 1 EN -------------------File: Common.txt ---------------------- CM CM File: Common.txt CM CM Antenna Model at 2.437 GHz (C) 2007 by Aziz Oeguet CM CM --- General parameters --- CE freq = 2437.0 // Operating frequency in MHz pi = 3.14159265358979 // famous pi c0 = 299792.458 // Light speed km/s lambda = c0/freq/1000 // One wave length in m lambda2= lambda/2 // Half wave length in m lambda4= lambda/4 // Fourth wave length in m CM End of File Common.txt CE -----------------File: PP4NECDefs.txt ---------------------- CM CM File: PP4NEC2Defs.txt CM CM PP4NEC2 Constant Definitions (C) 2007 by Aziz Oeguet CM //--- Modus-Arten definition (Bit-Flag, Number-Codes) --- _MODE_SP = 0 // #pragma mode=_MODE_SP - Surface Patch Modus (Metallflächen) _MODE_WR = 1 // #pragma mode=_MODE_WR - Wire Modus (Drahtmodell) _SYMODE_UNIQUE = 1 // #pragma symode = _SYMODE_UNIQUE - interne Symbole einzigartig (keine Mehrfachverwendung) _SYMODE_REUSE = 0 // #pragma symode = _SYMODE_REUSE - interne Symbole mehrfach verwenden (durch Neuzuweisung) _HS_OUTSIDE = 0 // Struktur nur ausserhalb zulassen (innerhalb des Hotspots keine Objekte) _HS_INSIDE = 1 // Struktur nur innerhalb zulassen (ausserhalb des Hotspots keine Objekte) //--- Edge definitions (Bit-Flags) (#Sp3 only) --- _P1P2 = 1 // Kante P1-P2 mit Draht verbinden (nur bei Wire Modus) _P2P3 = 2 // Kante P2-P3 mit Draht verbinden (nur bei Wire Modus) _P3P1 = 4 // Kante P3-P1 mit Draht verbinden (nur bei Wire Modus) _3ALL = 7 // alle Kanten des Dreiecks mit Draht verbinden (nur bei Wire Modus) //--- Edge definitions (Bit-Flags) (#Sp4 plus #Sp3) --- _P3P4 = 4 // Kante P3-P4 mit Draht verbinden (nur bei Wire Modus) _P4P1 = 8 // Kante P4-P1 mit Draht verbinden (nur bei Wire Modus) _4ALL = 15 // alle Kanten des Vierecks mit Draht verbinden (nur bei Wire Modus) //--- Edge definitions (Bit-Flags) (#Box, #Horn plus #Sp4) --- _P5P6 = 16 // Kante P5-P6 mit Draht verbinden (nur bei Wire Modus) _P6P7 = 32 // Kante P6-P7 mit Draht verbinden (nur bei Wire Modus) _P7P8 = 64 // Kante P7-P8 mit Draht verbinden (nur bei Wire Modus) _P8P5 = 128 // Kante P8-P5 mit Draht verbinden (nur bei Wire Modus) _P1P5 = 256 // Kante P1-P5 mit Draht verbinden (nur bei Wire Modus) _P2P6 = 512 // Kante P2-P6 mit Draht verbinden (nur bei Wire Modus) _P3P7 = 1024 // Kante P3-P7 mit Draht verbinden (nur bei Wire Modus) _P4P8 = 2048 // Kante P4-P8 mit Draht verbinden (nur bei Wire Modus) _8ALL = 4095 // alle Kanten des Objekts mit Draht verbinden (nur bei Wire Modus) //--- Edge definitions (Bit-Flags) (#SpArc and #Tube only) --- _A1 = 1 // Kante Alpha1 (Startwinkel) _A2 = 2 // Kante Alpha2 (Endwinkel) _R1 = 4 // Kante Radius 1 (Startradius) _R2 = 8 // Kante Radius 2 (Endradius) _RALL = 15 // alle Kanten des Objekts mit Draht verbinden (nur bei Wire Modus) //--- Konvex definition (Bit-Flag) (für Metallflächen (Surface Patches)) --- _CONVEX = 65536 // Objekt ist Konvex, alle Normalenvektoren zeigen nach aussen CM End of File PP4NEC2Defs.txt CE ----------------File: FeedBiQ.txt------------ CM CM File: FeedBiQ.txt CM CM BiQuad-Feeder Antenna Model at 2.437 GHz (C) 2007 by Aziz Oeguet CM CE //--- Antenne parameters --- #ifndef BQ_sgap BQ_sgap = 0.003 // Soldering gap distance #endif #ifndef BQ_wr BQ_wr = 0.00075 // Wire radius #endif #ifndef BQ_wrseg BQ_wrseg = 5 // Number of segments on partial antenne wire part #endif #ifndef BQ_tagwr BQ_tagwr = 1000 // Antenna Tag-Start #endif BQ_elemlen = lambda/4 // Antenna element length BQ_ea = BQ_elemlen/sqr(2) // Projected axis length of antenna element //--- Antenne (BiQuad) --- GW BQ_tagwr 1 0 0 BQ_sgap/2 0 0 - BQ_sgap/2 BQ_sgap/6 GW BQ_tagwr+1 BQ_wrseg 0 0 BQ_sgap/2 0 BQ_ea BQ_ea BQ_wr GW BQ_tagwr+2 BQ_wrseg 0 BQ_ea BQ_ea 0 2*BQ_ea 0 BQ_wr GW BQ_tagwr+3 BQ_wrseg 0 2*BQ_ea 0 0 BQ_ea - BQ_ea BQ_wr GW BQ_tagwr+4 BQ_wrseg 0 BQ_ea -BQ_ea 0 0 - BQ_sgap/2 BQ_wr GW BQ_tagwr+5 BQ_wrseg 0 0 -BQ_sgap/2 0 -BQ_ea - BQ_ea BQ_wr GW BQ_tagwr+6 BQ_wrseg 0 -BQ_ea -BQ_ea 0 -2*BQ_ea 0 BQ_wr GW BQ_tagwr+7 BQ_wrseg 0 -2*BQ_ea 0 0 -BQ_ea BQ_ea BQ_wr GW BQ_tagwr+8 BQ_wrseg 0 -BQ_ea BQ_ea 0 0 BQ_sgap/2 BQ_wr //--- Wire-Load Punkt definieren (HF-Speisepunkt) --- Ant_Feed_Tagnr = BQ_tagwr Ant_Feed_Segnr = 1 CM End of File FeedBiQ.txt CE -------------------END---------------- |
#5
|
|||
|
|||
Antenna programming tool/language/compiler/preprocessor?
|
Reply |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
FA: 1-Day-Left: 3 Books: MICROPROCESSORS, ASSEMBLY LANGUAGE Programming, 8080, Z-80, Etc. | Equipment | |||
PicBasic Pro Compiler Ver 2.43 | Homebrew | |||
PicBasic Pro Compiler Ver 2.43 | Homebrew |