Z-World Customer Support Center: Top FAQs
Home Contact Site Map
Company Info Products Ordering Documentation Support Partners Pressroom
Top FAQs
Z-World Product Documentation
Technical Refernece
Knowledgebase
Legacy Product Support

Go to Z-Store

Free Catalog
Top FAQs
General Topics
  • Can I program Z-World controllers in Basic or with a C++ compiler?
  • If I design a Z-World controller into my product, how can I be guaranteed that the controllers will always be available?
  • How many workstations can I run Dynamic C on at the same time?
  • What are the differences between Dynamic C and ANSI C?
  • How many times can I write to a Flash EPROM?
  • Is there a royalty fee for each burned EPROM?
  • If I place my order today, when will it ship?
  • What is the warranty on your controllers?
  • Can I get a unit for evaluation?
  • Can I open terms on the first order?
  • What is the lead-time for an installed option?
  • Dynamic C
  • My program won't compile using the new compiler. Why?
  • Dynamic C can't find the specified '#use' file. Why?
  • Why does my program fail in Flash, but run in RAM?
  • A left- or right-shift on a long integer crashes my program. Why?
  • Why do I get a compiler error 'Undefine (but used) label !AA'?
  • How do I find the location 'Array Index Out of Bounds'?
  • My program compiles fine on two boards, but runs on only one. Why?
  • What is a general protection fault in module DCWD.EXE at 0007:0000248b?
  • EPROMS
  • Why does my program run in RAM, but not in EPROM?
  • My program executes correctly prior to burning an EPROM, but it does not run properly from the EPROM. Why?
  • Why does my program run faster in EPROM?
  • My LCD/KIO works at development time, but not in EPROM. Why?
  • Why do two binary files compiled at different times for the same program have different check sums?
  • How can I keep the value of my variables across a power recycle?
  • How do variables initially get their values?



  • General Topics

    Can I program Z-World controllers in Basic or with a C++ compiler?
    No, Z-World controllers can only be programmed with our Dynamic C software. Dynamic C offers many benefits. First, because it is a C programming language, it is far more powerful than Basic or Ladder Logic, offering flexibility which is essential to embedded control systems. Second, using Dynamic C will save valuable development time because it was created to meet the special requirements of embedded applications. In Dynamic C, each Z-World controller has many pre-written drivers, libraries, and sample programs to make your development fast and easy.




    If I design a Z-World controller into my product, how can I be guaranteed that the controllers will always be available?
    Z-World products were developed with the typical OEM customer in mind, and we are committed to supply any product which we develop indefinitely. If for some reason beyond our control, a component is discontinued, Z-World will attempt to secure a life-time supply or make a substitution which provides the same form, fit, and function.




    How many workstations can I run Dynamic C on at the same time?
    As with most software, Dynamic C can only be installed on one computer per purchased copy of the software.




    What are the differences between Dynamic C and ANSI C?
    Dynamic C and ANSI C are very similar. The main difference being that Dynamic C includes pre-written drivers, libraries, and sample programs developed specifically for Z-World embedded controllers.




    How many times can I write to a Flash EPROM?
    Minimum of 10,000 writes per sector.




    Is there a royalty fee for each burned EPROM?
    No, it is considered part of the Dynamic C license.




    If I place my order today, when will it ship?
    In most cases, Z-World ships the following business day for stock items. If you order at stock item prior to 8:30 a.m., your order will ship the same business day. Orders including custom options will ship within four business days. Large volume orders may be subject to a lead-time. Please schedule large volume shipments with your Sales Representative.




    What is the warranty on your controllers?
    Z-World offers a limited warranty on all of our controllers.




    Can I get a unit for evaluation?
    All Z-World development systems are backed by a 30-Day-money-back guarantee. This provides our customers a way to evaluate our controllers at no risk. Because of its extremely low cost, the $99.00 CM7100 Evaluation Kit and Jackrabbit development kit are not eligible for return.




    Can I open terms on the first order?
    Z-World requests that all first-time purchasers pre-pay via COD, credit card, or check in advance. We will be happy to look into setting up NET 30 terms on a second order.




    What is the lead-time for an installed option?
    Installed options will be shipped within four business days.



    Dynamic C

    My program won't compile using the new compiler. Why?
    The most common problem is the error message "Used (but Undefined) Label ???". This is the result of:

    1) Missing custom libraries. The libraries need to be added to LIB.DIR.

    2) Modified Z-World libraries. The original programmer may have modified libraries provided by Z-World, and any changes are in the newly installed libraries.




    Dynamic C can't find the specified '#use' file. Why?
    The '#use' directive takes a single parameter which is the base name of the library to be linked. The name can be quoted or unquoted - Dynamic C will accept either format. However, if the string is not quoted, the preprocessor will make substitutions where appropriate. For instance, if a portion of the file name previously was '#define'd, the substitution may create a nonsense file name. Always double-quote your '#use' filenames.




    Why does my program fail in Flash, but run in RAM?
    Flash introduces a potential problem associated with embedding code. If an erroneous attempt is made to write to flash (i.e. not through the WriteFlash function), a 10 mSec write-cycle is initiated. The cycle will fail, and the contents of flash will not be disturbed. However, the write cycle will make the flash inaccessible to the processor for the 10 mSec period. Naturally, the CPU will crash without access to it's program. Dynamic C attempts to detect such writes at compile time. Most often, the error is attempting to modify an initialized constant by its address, such as the following:

    	char acBuffer[] = "Dummy Data (To Be Written Over)";
    		strcpy ( acBuffer,... );
    




    A left- or right-shift on a long integer crashes my program. Why?
    When a left or right-shift is performed on a long integer, and the shift count is 32 or greater, extra bytes are left on the stack. This results in a stack error or target crash.




    Why do I get a compiler error 'Undefine (but used) label !AA'?
    This results due to a failure to improperly dump the internal symbol table. Two things can cause this error:

    1) This may occur if a compiler interleave occured in the middle of a string table. To fix this problem, just disable interleaving by adding '#nointerleave' to the top of your program.

    2) You may have used a string constant within an inline C statement contained in a block of inline assembly. An obvious way around this is to not use inline C at all.




    How do I find the location 'Array Index Out of Bounds'?
    In general, you don't. The run-time error mechanism simply reports the occurance of an error. It is possible to find the location of an error from "garbage" left on the stack. After a run-time error, close the error box and open the Stack (use WINDOW | STACK). If the top two words on the stack are identical and the next two words on the stack are identical, the value of the second pair is the logical addres of the offending indexing operation.

    You may find the location of the error by using Disassemble At Cursor option (Ctrl-F10, or INSPECT | DISASSEMBLE AT CURSOR). Place the cursor somewhere in you program, press Ctrl-F10, then move up or down depending on whether the address of disassembly is higher or lower than the address you're seeking. If the logical address is less than 2000h, the address is in the BIOS and probably nonsense. If the logical address is E000h or greater, the address is in virtual memory and incomplete.




    My program compiles fine on two boards, but runs on only one. Why?
    Are you compiling the program on one controller, then moving the serial cable and recompiling on another controller? If so, your problem could be the symbol table in the Dynamic C BIOS.

    Whenever Dynamic C initializes communications with a controller, it downloads a symbol table residing in the target BIOS (this occurs during the display on the "Loading Information from Target" message). This table tells Dynamic C where to find I/O device and entry points for library routines in EPROM.

    If you move the serial cable without downloading the symbol table of the new BIOS, Dynamic C will mistakenly think it's still connected to the first target and compile the program using the symbol table of the first BIOS. Unless the two BIOSes are identical, the program will compile, but fail when library routines in EPROM are called.

    Whenever you move the Dynamic C serial cable, perform the Reset Target function (either from the menu or by pressing Ctrl-Y). This will dump the old symbol table and load the symbol table from the BIOS in the current target.




    What is a general protection fault in module DCWD.EXE at 0007:0000248b?
    It means your program is too long. Dynamic C can deal with programs (the .c file) of up to 10,000 lines of code. The solution is to put certain functions into a .lib file, especially those that are proven correct. As far as the compiler is concerned, there is no limit to the size of a .lib file. However, the editor in Dynamic C can only deal with files up to 10,000 lines or up to 256k long only.




    EPROMS

    Why does my program run in RAM, but not in EPROM?

    Burning a program into EPROM which worked in RAM is a common source of errors. It is not a particularly difficult process, but it does involve multiple steps and several unknowns. The sequence is rather simple:

    1. When program development is complete, compile the program using Ctrl-F3, the "Compile to File" option. The "Options/Compiler/File" type for the "Compile to File" option should be set to "Code with BIOS (*.BIN)".

    2. If the compilation produces errors, attempt to correct the errors and retry compilation to file.

    3. After this is accomplished, a .BIN file will have been generated containing the binary image of your compiled program. If the "Create .HEX File Also" box (OPTIONS | COMPILER) is checked, an extended Intel HEX file is generated.

    4. If the compilation is successful, exit Dynamic C. You now have the data necessary to program an EPROM. Please note that Z-World controllers cannot program EPROMs. Programming must be done by third party devices.

    5. Use an EPROM which is large enough for the program and fast enough for your controller. To determine the size of your program, look at the size of the .BIN file (don't use the .HEX file which is artificially large). Use the .BIN or .HEX file to program the selected EPROM.

    6. Your newly programmed EPROM should replace the normal Dynamic C EPROM. Normally, configuration jumpers should not require any changes. However, based on the size of the new EPROM, it may be necessary to move one or two jumpers. See the hardware manual for your controller for more details.




    My program executes correctly prior to burning an EPROM, but it does not run properly from the EPROM. Why?
    The following trouble-shooting tips are listed by frequency of occurrence and the ease of remedy. They should uncover most problems.

    1. You should be using an EPROM with a part number of some variation of 27C256, 27C512, 27C010, 27C020, or 27C040, which are different sizes of EPROM.

    2. The EPROM may not be large enough for the program. To determine the program size, look at the size of the .BIN file. Don't use the size of the .HEX file, because it contains overhead and it's over twice as large as the actual program! EPROMs are measure in KiloBits, so a 27C256 is 32KByte, 27C512 is 64KByte, etc. Make sure the KByte size of the EPROM is at least as large as the size of the .BIN file.

    3. The EPROM may not be fast enough. Controllers with 9Mhz clocks require 100 nSec or faster memory. All controllers faster than 9Mhz should use 70nSec memory.

    4. The board may not be jumpered correctly for the selected EPROM. Most Z-World controllers that are not FLASH based, are shipped with 27C256s installed. If this is the size EPROM the selected, no jumpers are needed to be moved. If a 27C512 or larger is selected, one or two address jumpers will need to be changed. Consult Z-World documentation and/or schematics for the particulars for any given board. The SmartCore Z1 is configured to accept a 27C010, 27C020 or 27C040 without jumper changing. Smaller EPROMS (the 28-pin 27C256 and 27C512) will not work without moving J3, a surface-mounted zero-ohm resistor.

    5. It is possible the EPROM was not burned correctly. Since EPROM programmers tend to verify in the manner they have programmed, verification is of little help if the programmer is setup incorrectly. The best way to verify the correctness of the programming procedure is to burn a new Dynamic C EPROM. Once this EPROM is burned, place the EPROM in a target board and try to have Dynamic C respond as normal. Note that it is not sufficient to copy the EPROM by reading the original EPROM into a buffer. The point of this exercise is to test whether your programmer can convert a file to an EPROM, not whether it can duplicate EPROMs. Most EPROM programmer problems occur in reading files.

    6. Your program may contain STDIO (printf, putchar, etc.) function calls. These functions calls are intended for debugging purposes only. They communicate with the STDIO window in Dynamic C. Since the debugging kernel is not running when a program is in EPROM, executing one these commands will cause the program execution to stop.

    7. Are variables being modified which are initialized when declared? Consider the declaration "int x = 6;". This defines an integer x. Since x is assigned a value when it is declared, the variable x is placed in code space, which at development time is RAM. During development, x may be freely modified. When the program is burned into EPROM, however, the value of x is also placed in EPROM and now it's value is fixed. If the proper execution of your program relies on modifying such variables, it will fail in EPROM.




    Why does my program run faster in EPROM?
    A certain amount of overhead is incurred during development code for the purposes of debugging. When the program is compiled to EPROM, debugging code is removed, making the program slightly smaller and faster. While this may not seem like a problem, it can create some difficulties:

    1. Busy delay loops tuned empirically by hand will run faster in ROM. The proportion of execution overhead devoted to debugging is inversely proportional to code complexity. Since busy loops are trivial code, debugging overhead is high and its removal can be dramatic. Loops in ROM can execute 2 to 3 times faster! The solution is to make such routines stand-alone functions and declare them as nodebug. This will remove the overhead at development time and should make the delay uniform.

    2. If timing sensitive code (such as the initialization of an LCD) is written incorrectly, debugging overhead may introduce enough delay to allow the procedure to work. When this overhead is removed, the routine then fails. In this situation, the incorrect code must be fixed.




    My LCD/KIO works at development time, but not in EPROM. Why?
    The KIO used with the Little Giant Series (models BL11xx) works during development, but not in EPROM. Some Dynamic C kernels initialize the wait state generator differently depending on whether the system is in RAM or EPROM. Since LCDs and the KIO require maximum I/O wait states, adding the statement "outport ( DCNTL,0x30 );" as the first executable line of the main may solve some timing problems.




    Why do two binary files compiled at different times for the same program have different check sums?
    Two binary files compiled at different times will have the following differences which result in different check sums:

    0x2240:one bytes
    0x2288-0x228f: time information, 8 bytes
    0x2305-0x2306: checksum two bytes
    end of root code: 8 bytes, time information
    




    How can I keep the value of my variables across a power recycle?
    A common problem in embedded systems is having variables retain their value across power up. This is needed in order to prevent operators from having to reprogram the system each time the power is cycled. Fortunately, Z-World boards and Dynamic C make this very easy. Variables are assigned fixed locations at compile time. Most Z-World boards have battery-backed RAM. And Dynamic C doesn't implicitly initialize any variables (unlike most C compilers which zero static variables). Consequently, all global and local static variables in Dynamic C programs are non-volatile. Once a value is assigned to a variable, this value is retained until it is assigned another.




    How do variables initially get their values?
    There are three ways variables get their values:

    1. Explicit Initialization

    In this case, the user must take some action (install a jumper, press a button, etc.) that will be recognized by the program as a signal to set all globals to their default values. This system has the benefit of being the only 100% fool-proof way to know whether or not a system needs initialization. The downside is an operator may forget to explicitly initialize the unit.

    2. "Magic Number"

    A magic number is a pattern stored in memory which indicates whether or not the system has been initialized. In C, a magic number is normally implemented as:

    long lMagic
    void main ()
    {		if (lMagic != 0x55AA5AA5L) {
    			// Do Initializations
    			lMagic = 0x55AA5AA5;
    		}
    		// Program Goes on from Here
    }
    

    Note that the magic number (0x55AA5AA5L) is chosen because it is unlikely to occur randomly in RAM. Not accounting for the physical nature of randomized RAM, this method will fail only once in 4.3 billion units.

    3. Bounds Checking

    Bounds checking is nothing more than an extension of the magic number principle. Mission critical values (such as set points and safety ranges) are bounds checked to see whether or not their values are reasonable, both with respect to other system parameters and to absolute norms. If one (or any one of a collection) of such parameters is out of bounds, the parameter (or entire group of parameters) is reset.

    Bounds checking has the benefit of allowing the programmer to partition the variables to be initialized into two or more group, while magic numbers allow a pass or fail type initialization. Bounds checks are also more reliable because they can normalize the system state in case a transient upset or software error wipes out one or more vital operating parameters. The only draw back is some additional coding, but the result is well worth the effort.



    COMPANY | PRODUCTS | ORDERING | DOCUMENTATION | SUPPORT CENTER | PARTNERS | PRESS ROOM
    HOME | CONTACT | PRIVACY STATEMENT | SITE MAP

    Copyright © 2001 Z-World Inc. All rights reserved.
    zworld@zworld.com