SeriCon 2.8
Users' and Target Programmers' Manual

  1. Introduction

    SeriCon is a universal PC interface program to your target (external hardware). It receives data from the target to show not only texts but also numbers and graphics, and sends it mouse clicks as well as texts and numbers. SeriCon also can be used to utilize the control-bits in a serial port to measure and generate pulses. Important features are:

    • RxD: SeriCon stops the normal character mode when it receives three 0 bytes, and turns into the "function" mode. Let your target send SeriCon, a "function type" byte and the "arguments" data. Then SeriCon converts them into texts and graphics, like C printf and Win32 drawing functions.

    • TxD: Not only characters but also 8/16/32-bits binary numbers can be sent easily by typing, with automation (variable period and number of times). Mouse clicks on the graphics also can be sent to the target with the signal byte defined by it.

    • To help you program the target('s MCU or microcontroller) to send/receive such forms of data, a library and example codes with the source files are included in the package. While they are in C and for dos targets (other PC or embedded board), you may easily modify them to construct libraries for your targets.

    • 3 control-bits CTS, DSR and RLSD (also called DCD), which have been used by other programs just to control the serial communication, now can be used to read and display some signals from your hardware. For each bit (pin), the present level(high or low), the count of level changes (pulse), and the level durations with linear or exponential transformations, can be displayed.

    • 2 control-bits RTS and DTR also can be utilized to send static or dynamic signals with variable specifications (periods, level durations, and numbers of cycles) to your hardware, including a DC motor. Also they can pulsate in such a way to drive a stepper motor, with the 3 inputs selectable to stop it.

    • A file (sound file or program, for example) can be specified for an 'action' to be excuted when an 'event' occurs. You can define an event to be when an input pulse count reachs a specified value or when a specified character is received.

    Therefore SeriCon can be used in many ways, in experiments, engineerings, or electronic hobby works, turning your PC into a GUI Module (to your device), pulse counters, voltage meters, pulse generators or timers, for example, as follows.

    If you want to use a PC and it's serial ports to control devices (equipped with MCUs) and you don't want to develop a special PC program, you may prefer SeriCon to old text programs, since your MCU programming becomes easier with SeriCon doing data conversions between binaries and text(decimal, hex, octal)/graphics/mouse.

    Interested not in the serial communication (RxD/TxD), but in making use of the input bits (CTS/DSR/RLSD) to watch a low frequency signal from an apparatus, in order to count level changes, to measure durations, or to be alarmed by changes? You don't have to develop a special PC program and will be satisfied by SeriCon.

    SeriCon can be used as a pulse generator or a timer utilizing the output bits (RTS/DTR). For example, if you are going to make a simple circuit to turn something on and off, periodiodically or after a time delay, PC and SeriCon will make you spend less electronic components. Even a DC motor can be controlled, and the two pins also can pulsate cooperatively to drive a stepper motor.

    SeriCon also can turn your PC into 3 voltage meters if you make a simple circuit with resisters, capacitors and one voltage comparator IC, since SeriCon can provide the power by output (RTS/DTR) pulses and show exponential transforms of input (CTS/DSR/RLSD) pulse durations in order to calculate transient effects in RC circuits. Refer to http://www.softbattery.net/measurement for the circuit and other applications of SeriCon.

    In general, you are interested in only one of the two kinds of serial port applications. One is utilizing the control pins, and the other is the serial communication, as described above. The titles of most chapters and sections show what kind they belong to, so that you can easily decide to read or not.

  2. Installation

    1. Upgrading

      If you have used a previous version, you don't have to uninstall it. Just install this version as described in the next sections, selecting OK in the box asking your confirmation of overwriting. If you have a license file, it will be effective also for this version.

    2. System Requirements

      • CPU: Intel 80486 or higher

      • OS: Windows 95, Windows NT 4.0 or higher

    3. Trial Version

      SeriCon is distributed as a compressed file, *.zip, without a full license key. That is, the zip file is for the trial version. The installation process is simple. Just extract all of the files contained in it into a folder and run the installer(install.exe).

      In the second box in the installer, be sure not to choose the product folder but the parent folder! For example, choose "C:\Program Files" if you want SeriCon to be installed in "C:\Program Files\SeriCon". If you are a new user, the product folder does not exist and the installer will create it.

      A new user now has the trial license. That is, there are restrictions on some features, before you acquire and install a full license key.

    4. Full License Key

      Go to http://www.softbattery.net and acquire a key, a small file. The installation is simple. Just put it into the product folder.

  3. Getting Started

    If you are accustomed to hardware control softwares with only one option file which save option changes without confirmation and you are going to use SeriCon that way, or if you are a beginner and won't learn about option files for the time being, uncheck the [File]->[Ask Save] menu and create a file named "simple.scs" in the SeriCon's folder using the [File]->[Save As...] menu. Then SeriCon saves and loades the changes automatically. Note that the main window size and location are saved only when any other change happen or when you manually run the [File]->[Save] menu.

    There are 3 "views" in SeriCon, according to which SeriCon shows the corresponding controls (child windows, i.e. edit boxes, buttons, ...). Right after installed, the "Serial" view is selected so that only the controls for serial communication are shown. You can move to the "Control" view by the [View] menu so that only the controls for CTS/DSR/RLSD and RTS/DTR appear.

    The other view "All" shows all the controls. But, you may seldom use the All view, since if your target system has an MCU for serial communication you may hardly use control-bits to measure or control any part of your target system while making the other parts be controlled by the MCU. You may do, if you want to add some simple things to the system without modifying the MCU.

    1. Ports

      Right after executed for the first time after installed, SeriCon automatically tries to open COM1. In the 4th part of the status bar (at the bottom of the main window) is displayed the port name. If the port is opened, the last part of the status bar displays the port state as "Open", and the [Port]->[Run] menu is checked. You can close the port by unchecking the menu and open again by checking. If the port is closed by the menu, the port state part in the status bar reads "Closed". If the port failed to be opened, it reads "Not Available". If you don't want Sericon to open the port automatically right after the program starts, uncheck the [Port]->[Run On Start] menu. Then, when SeriCon starts running the next time, the port state part in the status bar reads "Not Tried".

      There are two possible reasons why the port failed to be opened ("Not Available"). The port does not exist or it is used (opened) by other program or other instance of SeriCon. You can try other or the same port by the [Port]->[Select and Run...] menu only when the present port is closed.

      If the port is open and the program is about to terminate or a new set of options (from a file or the defaults) is to be loaded, SeriCon should close the port. To protect your hardware from an unintentional closing in this case, check the [Port]->[Ask Stop]. Then Sericon asks your confirmation by a dialog box before closing.

      To change the baud rate and other parameters of the port, use the dialog box popped up by the [Port]->[Configuration] menu only when the port is opened. The box is provided by your OS and looks a little different from OS to OS. When you are going to utilize control-bits without serial communication, select "None" in the "Flow Control" combo (the exact expressions may differ a little depending on the OS) and ignore the other options in the dialog box.

      When you are going to communicate serially with the target system, you are also recommended not to use a flow control, unless you are sure that the target is capable of that kind of control with exactly the same characteristics.

    2. Character Communication

      Let's communicate with the target. If you don't have any target hardware to test SeriCon, run one more instance of SeriCon or other program (Hyper Terminal in your system, for example) using other port or using other PC connected through a null-modem cable. If you use Hyper Terminal as the target and want to send non-english characters as well as english ones to SeriCon, select "VT100" as the emulation in the option box of Hyper Terminal.

      Send characters from the target. Then the Rx window (the edit box labeled "rX") will show them. Note that the window is read-only and gray when the port is open, while editable and white when closed. Like any general edit box, the window allows you to use the mouse right button for pop-up menus so that you can copy texts to other programs. Note that all the texts will be cleared each time the port is newly open.

      Let's call this way of processing the received data, as the "normal" mode. SeriCon regards the bytes as just characters to show. There is one more thing SeriCon can do in the normal mode. You can specify "event" characters and the "action" file to run/open when one of them is received, using the [Bit] menu. Refer to the Event-Action for Serial Input section of the More Options chapter.

      Type "Hello, my lovely target" into the Tx window (the edit box labeled "Tx") and press the Enter-key. The target will receive the string. The enter key works the same as the "Send" button, i.e. sends the data, except when the Rx window has the focus. The focus automatically goes to the Tx window right after sending, to make you feel comfortable in setting the next data. The 3rd part of the status bar reads "Tx Sending..." while the data is being sent, and reads "Tx Ready" after they are sent (Usually you can read only "Tx Ready" because baud rates are fast enough to make "Tx Sending..." last during a very short time).

      Do you want to automatically send ? Check the [Auto]->[Tx] menu, to turn on the automation. SeriCon will send the data after 1 second and repeat this cycle 60 times. The period and the number of times can be changed by a menu, as described in the Output Automation Parameters section of the More Options chapter.

      To stop the automation, uncheck the [Auto]->[Tx] menu. If you want the automation to start automatically right after when a port is opened, check the [Auto]->[Tx On Open] menu.

      The 2nd part of the status bar shows about output automations. The first character after "Auto: " in that part indicates the Tx automation state. If the automation started and is not finished, the character reads 't'. Otherwise, it reads "0" if the [Auto]->[Tx On Open] menu is unchecked and reads "T" if checked.

    3. Binary Communication

      The combo box on the right of the Tx window lets you select the format by which the string set in the window is converted to the final data to be sent. The following 5 formats are provided. In the previous section, you might test SeriCon with the first format selected.

      • Characters: No conversion occurs.
      • Integer 1, 2, and 4: The string is taken as an integer expression and converted into 1-, 2- and 4-byte binary, respectively. As well as decimal expressions (signed or not) you can also use other espressions as follows. Prefix by "0x" or "0X" for hexadecimal expressions with lower or upper case letters respectively. For example "0xaebf" or "0X3FD" are valid hexadecimal expressions. Prefix "0" for octal expressions. Note that the "0" in these two kinds of expression is not the alphabet letter but the number zero.
      • Float 8: The string is taken as a double precision floating number expression and converted into the corresponding binary of 8 bytes. "100", "9.4" or "-2.5e-3" (meaning -2.5*10^(-3)) for example are valid expressions.

      To test the binary outputs using Integer or Float formats, you should run other instance of SeriCon as the target, using other port or on other PC, since the target should receive and display binary numbers which cannot be done by conventional character communication programs. If you already have a target device programmed to receive binary data to do something (turning LEDs or motors on/off for example), you may use that "real" target to test SeriCon, instead of the "virtual" target. Here follows what you can see using the virtual target, that is, other instance of SeriCon.

      Select Integer 1 in the format combo, for you to be ready to send byte numbers. Send the target 5 byte numbers 0, 0, 0, 8, 4, by typing the first number in the Tx window and pressing the Enter key and so on. Then, change the format back to Characters and send a string "F=%e". Finally, using the Float 8 format, send "1.7e308". What you see in the target is as follows.

      Now, you are not only introduced to how to send binary numbers as well as character strings, but also saw one example of how SeriCon processes such data received, since the present target is other instance of SeriCon. Let's turn to the latter role of SeriCon, and we will not call the latter instance a target any more in this section. Here follows what happened in it.

      After receiving three successive null bytes, it turned into a special state called the "function" mode. In this mode SeriCon processes the next data not as character bytes but "function packets". One packet is defined to consist of the followings.

      • FTB (Function Type Byte): A byte which tells SeriCon what to do. The values are defined in base.h in the "include" folder of the package. If the byte received is invalid, SeriCon will add an error message "Invalid FTB" in the Rx window.
      • Additional Data: The size and structure of these data depend on FTB, since these are the "arguments" of the SeriCon's internal function corresponding to FTB.

      In the previous demonstaration, all the data after the three null bytes constitute a function packet named "Print8f" which lets SeriCon convert a double precision float binary number into a text string. The first byte, 8, is the FTB for Print8f and SeriCon converted the final binary argument 1.7e308 using the format string "F=%e" to display. If you know printf in C, this looks very familiar and you can call this "remote printf". There are packets for graphics that can be called "remote Win32 GDI functions". Now you may recognize what the SeriCon serial communication is for: You want to program not PC but only MCU.

      Various function packets are defined in SeriCon, as described in the Function Mode chapter. The chapter also describes the library included in the package to help you program the target to send packets. Throughout this manual, a "function" may mean a function packet, the work SeriCon does according to it, or the function routine in the target which sends it, depending on the context.

      While some functions converts the arguments into text expressions to display in the Rxext" window demonstrated above, some other functions draw graphics in other window behind the text window. Check the "G" button below the window label, to hide the text window, and to see the "graphic" window, a static window without scroll bars. The background color is gray when the port is open, and white when closed. The G button state and which window shows are changed not only manually, but also by special functions.

      For more about the graphic window, refer to Function Mode chapter. The chapter also describes the "mouse packet" that the target receives from SeriCon by a click on the window. It is enabled and the signal byte is defined, when the target sends SeriCon a special function.

    4. Measuring Pulses: CTS/DSR/RLSD

      If you are not interested in serial commnunication, and going to utilize control-bits to make or monitor a low frequency signal in the external world, use the [View] menu to let SeriCon show the Control view as shown below.

      The 3 input control-bits show their states in the first 3 rows of the main window below the menu bar. In each row, the display window showing the state is on the right, the background of which is white when the level (pin voltage) is high, gray when low, and black when the port is not opened.

      Each display window text shows the pulse count and the latest durations. A couple of level-changes increases the count by one. tL and tH are the durations of the latest low and high levels respectively. The button on the left to each display window not only shows the bit name but also resets all the values.

      Want to test right now, by soldering a wire to an input pin from external sources pulsating between 10V and -10V? Note that there are already such sources in the port: the output bits RTS and DTR. The next section describes how to pulsate them manually or automatically. The screenshot above is the result obtained by pulsating RTS on other instance of SeriCon running other COM port connected through a null-modem cable. This popular cable connects RTS at one end to CTS at the other end.

      If you don't like this way of displaying the states, refer to the Showing Pulse Measurements section of the More Options chapter, to use the [Bit] menu. By the menu, you can let the display window show not the durations but a linear or exponential transform of them, can include or exclude some of quantities (count, durations, ...), and can edit the format string which converts the quantities into texts. The following screenshot is an example of such cutomizations used in an application as a voltage meter said in the Introduction chapter, where only two quantities are displayed with new texts including suitable name and unit after the second quantity tH transformed.

      The menu also enable you to specify the "threshold" count value to define an "event", and the "action" file to run/open on the event. Furthermore, the count can be scaled up or down by the divisor you specify. The pulse count shown in the two screenshot is obtained by the default divisor value 2 since what SeriCon count is the number of level changes.

    5. Pulse Generation: RTS/DTR

      To set the high level on an output control pin, check the buton named after it, i.e. the "Rts" or the "Dtr" button above the status bar. To set the low level, uncheck the button.

      If you are running other instance of SeriCon through a null modem, you can see these outputs on it as described in the previous section. Otherwise, you may search your desk for a LED and a resistor to be soldered to the pins. The DSR and RLSD windows on that "target" SeriCon instance shows the DTR signals of this "host" instance, since the cable connects them that way.

      The buttons can be automatically toggled to make SeriCon be a pulse generator or a timer for your hardware. If you check the [Auto]->[Rts] menu, the Rts button will shuttle between the checked and unchecked states according to the default period, number of times and duty ratio. The [Bit]->[rX,Outputs...] menu enables you to change the period, the number of cycles, and the high and low level durations, as described in the Output Automation Parameters section of the More Options chapter.

      Uncheck the [Auto]->[Rts] menu if you want to stop the automation. If you want the automation to start automatically right after when a port is opened, check the [Auto]->[Rts On Open] menu. The Dtr button can be automated by the same method, with Dtr instead of Rts in the 2 menus.

      The 2nd part of the status bar shows about output automations. The second and the third characters after "Auto: " in that part indicates the RTS and the DTR automation states respectively. If the automation started and is not finished, the character reads 'r' for RTS or 'd' for DTR. Otherwise, it reads "0" if the [Auto]->[Rts On Open] menu for RTS or the [Auto]->[Dtr On Open] menu for DTR is unchecked, and reads "R" for RTS or "D" for DTR if checked.

    6. Driving a Motor

      A DC motor can rotate, stop and rotate in the opposite direction, if it is driven by power FETs, transistors or a special "driver" IC consisting of them, and if this driver circuit's outputs are turned on and off by inputs. For example, if both the two outputs (connected to the motor) have the same voltage, the motor stops, and if not, it rotates. SeriCon can let you turn on and off RTS/DTR to control a DC motor, if the pins are connected to the driver IC's inputs, by way of a level-shifter IC (since driver ICs need TTL/CMOS-compatible input voltages).

      How to drive a stepper motor is not that simple. There should be 4 pulse signals into the motor and there are various ways in how they vary to rotate the rotor a unit angle called one "step". One of the most popular ways is the "2-wire way", in which two signals are just the inverses of the other two called "A" and "B" pulsating as below:

      Any level change in the signals rotate a step angle and can be called a step (Therefore there are 6 steps in this figure). How can we define a step using one statement? An answer is "B copies A if they are different, and A changes if they are the same". The motor rotates in the opposite direction if they swap the role in this definition of a step. The following screenshot shows the controls for stepping, below the Rts and Dtr buttons.

      Press the sTep button to recognize that RTS and DTR correspond to A and B respectively explained above. The screenshot corresponds the state of A and B between the 3rd and the 4th steps in the previous diagram. Check the bacK button to change the rotation direction.

      While the sTep button lets you make manual steps, the aUto button can be checked to repeat stepping periodically. The period is specified by the spinner (up-down control) next to the button, in miliseconds. If the period is modified during the button checked, the new value will be effective on the next check (after unchecked). You can use the [File] menu to save the period.

      If your stepper motor should stop before the rotating object hits a boundary surface or something, you can detect it using a sensor to turn one of CTS, DSR, or RLSD on or off which can be selected to stop the stepping. Use the [Bit]->[Stepper...] menu to choose input pins and the levels as the condition to stop, as the following screenshot.

      This screenshot depicts the default situation, where no input disables stepping. But, for example, if Cts is checked in this dialog box, any step will not happen unless the CTS pin is low. If you want the low CTS level to disable the stepping, uncheck the Level button. In summary, steps are disabled if any one or more checked inputs has the specified levels.

      If you skipped the previous sections in a hurry to know stepping pulses, you may be curious about the controls above the Rts and Dtr buttons in the main window. The colors of the windows next to the Cts, dSr, and rLsd buttons show the the input levels. The previous screenshot of the main window shows low levels since the colors are gray. The window texts are editable to show more about the input pulses, although the screenshot shows just a help about driving motors. Refer to the related sections for the roles of the buttons and more about the texts.

    7. About Timing Accuracy

      Do NOT move the main window (by mouse-dragging for example) after the automation of Tx, Rts, or Dtr starts, or during generating periodic stepper pulses, because the output will be delayed during the move.

      While CTS/DSR/RLSD input pulse durations tL and tH can differ from true values by hundreds of microseconds, Tx/Rts/Dtr automations and periodic stepping pulses are not that much accurate. The period and High/Low durations of the latters can differ from the specified values by about tens of miliseconds, due to the multi-tasking feature of your operating system. The differences may not be larger than that, unless you are running extraordinary applications simultaneously which spends much CPU time.

      Here follows what are working internally in SeriCon and your system.

      When any change (High to Low or Low to High) happens in the 3 input pins CTS/DSR/RLSD, your operating system calls SeriCon's internal procedure that checks the PC internal counter to measure tL and tH. In contrast to this, SeriCon uses other method for output automations or periodic stepping, which can be called "software timers" realized by the system routines. Note that the priorities of the two mechanisms assigned by the system are different: The former has such a higher priority that it is much less delayed by the multi-tasking feature.

  4. Function Mode

    The definition of function packets and their basic common structure are stated in the Binary Communication section of the Getting Started chapter. This chapter describes the detailed structure of each one, with examples of application.

    While you can construct your library consisting of functions to send the function packets (Of course, the former "functions" are function routines in your target), this SeriCon package provides you one with source codes, in the "include" folder, as described in the Library section. Although the codes are for dos targets and are in C, they may help you program your targets in other languages. In that case you are recommended to use the same prototypes at least, in contructing your library, in order for you to easily replace it by other one without severely modifying your main codes: Libraries for various targets can be released in later versions of SeriCon or by other developers in the world like you.

    The two sections Text Functions and Graphic Functions describe the structures of the function packets in terms of the library function prototypes instead of listing component parts of each packet, since most packets' structures are apparent by the corresponding library functions' arguments. When parts of a structure are not apparent by or differ from arguments, they are described in the sections. Note therefore, that you can read the 2 sections only to know the packets' structures and what they let SeriCon do, even after skipping the second paragraphs in the Library section.

    Interesting main target codes with sources which use the libray are also included in the package and are described in the Example Target Codes section. If you use other PC bootable by dos or an embedded dos board as the target, the codes let SeriCon in the host PC demonstrate how it processes the function packets. For example you can see various graphics in the Rx graphic window, just by a few key-strokes on SeriCon that makes target send the packets corresponding to the graphics. You might have followed a demonstration of a function in the Getting Started chapter which uses other instance of SeriCon as the target utilizing the binary serial output feature, which was somewhat tedious, sending part by part of a packet, just to see a text result. Enjoy easy and fast demonstartions from texts to graphics in this chapter.

    1. Library

      All the constants used to define the packets are listed in base.h in the "include" folder, and their name begins with "SERIC_". The other parts of the file define data types, which are used in the prototypes of the library functions and their routines. If you are not interested in the function routine codes, you can skip the next paragraphs to the next sections which list only the prototypes of the functions, describe the corresponding packets they send SeriCon, and show what the packets let SeriCon do. Note that we may frequently omit prefixes through out the manual, "seric_" of the target function names, "SERICOND_" of the data types.

      The function routines are contained in the latter part of pc.h, with the part title "Send: High Level". The prototypes of these functions are used in the next 2 sections to describe the function packets, except seric_FunctionMode which just sends three null bytes to turn SeriCon into the function mode. Only these functions are recommended to be called in the main codes in order for you to easily change or replace the library later. The other functions in the file are just low or middle level layers used in the high level function routines.

      The low level function codes depend on target platforms and make the higher functions independent of platforms. In this library, they program internal registers of the serial port in the target PC, to set it up, read and write data. You are expected to think "There must be a lower layer", because of seric_outp and seric_inp. They are defined in digitmar.h and it can be called a compiler compatibility layer. That is, since port I/O function prototypes differ from compiler to compiler, write your header file to be included in the main codes instead of digitmar.h, so that pc.h needs not be modified. All that digitmar.h contains are just two macros to wrap the port input and output function calls. Replace the calls by those of your compiler.

      All the codes in this library and main routine examples are compiled by the Digital Mars C/C++ compiler. The target PC which ran the final program as demonstrated in the Example Target Codes section was a general PC with a Pentium II CPU. The programs are expected to run well also with an older x86 CPU. You are strictly recommended not to use the dos window in the host PC (in which SeriCon runs) as the target platform.

    2. Text Functions
      This section describes function packets which let SeriCon insert text strings into the caret position in the Rx text window. Collectively we call them text functions. The prototypes of the target library functions to send the packets are listed instead of the packet structure, since each structure corresponds to the arguments next to the first one (a number identifying the port) in the prototype, as follows. - The first entry, the FTB byte is SERIC_FTB_xxx defined in base.h if the target function name for the packet is seric_Printxxx. - The other entries corresponds to the second to the last arguments in that order, except that if an argument is the pointer to a null- terminated string, two entries will be sent: the unsigned byte specifying the length before the null, and the characters before the null. All the text functions have a null-terminated string pointer as the second argument. They except PrintStr, let SeriCon convert the last entry (argument) into the text using the string as the conversion format, before inserting into the window, while PrintStr lets the string itself inserted. The size (number of bytes) and the value range, of the number binary, i.e. the last entry to convert, are clear by the argument data type and were used to make the function name. For example, Print2u converts a 2 byte unsigned integer and Print8f converts a 8 byte double precision float. The conversion is the same as the way the C function printf converts a number. If you don't know about printf, here is an introduction. Include in the format string, "%d" for a decimal integer, "%x" or "%X" for a hexadecimal integer, and "%f" or "%e" for a double precision floating number. For example, a number that can be converted into "1023" by "%d", can be converted into "3FF" by "%X", or into "3ff" by "%x". A number that can be converted into "0.0758" by "%f", can be converted into "7.58e-2" by "%e". If you want other formats or if you want to specify the width of the number expression and need padding with blanks or zeros, you are recommended to read C books. Note that all the text functions let SeriCon uncheck the G button if checked, to show the text window hiding the graphic window. A pair of successive bytes, 13 (called "carriage return" and expressed as "\r" in C) and 10 (called "line feed" and expressed as "\n" in C), in the final text string, makes the caret go to the next line in the text window. You may ask why the text function packets other than PrintStr are suggested, since we can use the C function sprintf to convert numbers before sending. All the function packets are and will be defined, for targets even tiny or poor without a C library, to utilize SeriCon. ------------- "Printf" String or Variable void seric_PrintStr (int Port, char *Str); void seric_Print1u (int Port, char *Format, unsigned char Var); void seric_Print1 (int Port, char *Format, char Var); void seric_Print2u (int Port, char *Format, unsigned short Var); void seric_Print2 (int Port, char *Format, short Var); void seric_Print4 (int Port, char *Format, long Var); void seric_Print8f (int Port, char *Format, double Var);

    3. Window and Canvas

      Actually SeriCon draws graphic texts or objects on an internal "canvas". The graphic window copies it any time the window wants, for example, when SeriCon is restored from being minimized in the task bar of the system. (If you know dwTerm programming you may be familiar with the canvas.) The main window size is adjusted for the canvas to fit into the graphic window and is "freezed" i.e. does not allow the user to change it, as far as the canvas exists. Uncheck the first check-box in the Miscellaneous group in the dialog box popped up by the [Bit]->[rX,Outputs...] menu, if you don't want that feature.

      The small static window just below the G button shows the canvas state. It displays "N" if the canvas does not exist, "h", "v", or "s", if the graphic window is Horizontally shorter, Vertically shorter or Shorter in both, than the canvas, respectively. Adjust the main window size to see the whole canvas, in the latter three cases, which may not happen if you use the Adjust & Freeze feature as introduced in the previous paragraph.

    4. Graphic Functions
      This section describes function packets which let SeriCon draw texts or 2-dimensional objects in the Rx graphic window. Collectively we call them graphic functions. The prototypes of the target library functions to send the packets are listed instead of the packet structure, since each structure corresponds to the arguments next to the first one (a number identifying the port) in the prototype, as follows. - The first entry, the FTB byte is SERIC_FTB_xxx defined in base.h if the target function name for the packet is seric_xxx, except for those that have seric_Drawxxx as the function names. The FTB is SERIC_FTB_Gxxx for the latter cases. - The other entries corresponds to the second to the last arguments in that order, except the followings. If an argument is a pointer then the content pointed by it is the entry. If an argument is the pointer to a null-terminated string, two entries will be sent: the unsigned byte specifying the length before the null, and the characters before the null. The argument types SERICOND_Point and SERICOND_Rect defined in base.h are structures to specify coordinates of a point and a rectangle respectively. (If you are familiar with Win32 programming you can say they are short versions of POINT and RECT respectively.) The coordinate convention in all the graphic functions is that the x coordinate grows to the right and the y coordinate grows downward, with the top left point of the graphic window being the origin (0,0). Many functions have pointers to Rect structures as arguments. Note that if each of all the 4 coordinates of a Rect is 0, SeriCon will use the rectangle corresponding to the whole canvas instead. Just use the null-pointer (i.e. 0) as the argument, to send SeriCon such an "empty" Rect. Then the target function sends 4 zero coordinates. The "canvas" is introduced already in the Getting Started chapter. "tools" are needed in drawing on the canvas. While most drawing functions use default tools so that you don't have to know about them, you do if want to replace them by new ones. There are three kinds of tool, brushes, pens and fonts, and there is an "painting box" which can hold 20 tools so that every tool is identified by an id out of 0 to 19. Right after the port is open, SeriCon creates the default tools, with IDs being SERIC_DefBkBrush, SERIC_DefBrush, SERIC_DefPen and SERIC_DefFont defined 0 to 3 in base.h. They are a dark blue brush, a bright green brush, a 1-pixel-wide yelow pen, and an Arial font of about 5x15 size respectively. Note that all the graphic functions let SeriCon check the G button if unchecked, to show the graphic window hiding the text window The description of what SeriCon does after receiving the packet, and more comments on the packets if needed, are shown below each prototype or below the title of a set of functions. ------------- Data Types typedef struct SERICOND_Point_tag { short x; short y; } SERICOND_Point; typedef struct SERICOND_Rect_tag { short left; x coordinate of the left edge short top; y coordinate of the top edge short right; x coordinate of the right edge, plus 1 short bottom; y coordinate of the bottom edge, plus 1 } SERICOND_Rect; ------------- Paint Tools Like in all the drawing functions, the argument iTool in the following creation functions is the tool id and can be any number out of 0 to 19. Since these functions deletes the previous tool and creates a new tool (brush, pen and font respectively) with the same id, even the tools with the default IDs can be replaced. The color is specified by the argument clr. The highest byte should be 0 and, the next bytes specify the BGR strengths respectively. For example, clr = 0xffff means yellow. The argument name in NewFont is the type-face name, "Arial" for example. The weight is 0 to 1000, and 400 is said to be normal while 700 is said to be bold for example. The flag can be a combination (by the bitwise OR operator |) of one or more out of SERIC_Font_Italic, SERIC_Font_Underline or SERIC_Font_StrikeOut to make the font italic, underlined or striked out respectively. void seric_NewBrush (int Port, char iTool, unsigned long clr); void seric_NewPen (int Port, char iTool, unsigned long clr, short width); void seric_NewFont (int Port, char iTool, char *name, short width, short height, short weight, unsigned char flag); ------------- Canvas void seric_NewCanvas (int Port, short width, short height); create a canvas with that size and delete the previous one. If the width or the height specified exceeds that of the graphic window in the maxized main window, the latter is used to create. Note that the trial license also limit the size. That is, if the width or the height specified exceeds that of 300 x 200, the latter is used. After creating the canvas, this function also does the followings. - erases all by the default brush. In other words, it paints over the whole canvas with the brush of tool-id SERIC_DefBkBrush. - lets the graphic window copy the canvas. - select the default tools on the canvas. - updates the canvas state window, and adjust & freeze the main window size if the option is checked. void seric_ShowCanvas (int Port, SERICOND_Rect *rc, char iBr); let the graphic window copy the rectangular area in the canvas, after painting the area with the brush of tool-id iBr. You may frequently use this function with iBr = -1 just for copying, because the function omits the painting if the tool-id is invalid (i.e. not in the range 0~19). void seric_SelectPaintTool (int Port, char iTool); select the tool with tool-id iTool on the canvas, replacing the previous one of the same kind. That is, if the tool identified by iTool is a brush, the previous brush selected on the canvas gets "unselected", for example. Many drawing functions use some of the selected tools, without any argument specifying a tool. void seric_SetTextColor (int Port, unsigned long clr); specify the color with which functions draw texts on the canvas. The color is represented by the argument clr in the same way as in NewBrush and NewPen. ------------- Draw String or Variable The following functions draw texts in the rectangular area. All the arguments except the last two arguments in a function are the same as those in the text functions. The conversion and the final text string by Drawxxx are the same as those by Printxxx. Refer to that section. The argument fDT specifies how to draw. The text will be located horizontally at the left, center or right position in the rectangle, if it is 0, SERIC_DT_Center, or SERIC_DT_Right respectively. void seric_DrawStr (int Port, char *Str, SERICOND_Rect *rc, unsigned char fDT); void seric_Draw1u (int Port, char *Format, unsigned char Var, SERICOND_Rect *rc, unsigned char fDT); void seric_Draw1 (int Port, char *Format, char Var, SERICOND_Rect *rc, unsigned char fDT) void seric_Draw2u (int Port, char *Format, unsigned short Var, SERICOND_Rect *rc, unsigned char fDT); void seric_Draw2 (int Port, char *Format, short Var, SERICOND_Rect *rc, unsigned char fDT); void seric_Draw4 (int Port, char *Format, long Var, SERICOND_Rect *rc, unsigned char fDT); void seric_Draw8f (int Port, char *Format, double Var, SERICOND_Rect *rc, unsigned char fDT); ------------- Brush Drawing The following functions paint the retangular area (Solid) or its 1-pixel thick edges (Frame), with the brush of tool-id iBr. void seric_Solid (int Port, SERICOND_Rect *rc, char iBr); void seric_Frame (int Port, SERICOND_Rect *rc, char iBr); ------------- Pen Drawing The following functions draw with the pen selected on the canvas. void seric_Line (int Port, SERICOND_Point *pt1, SERICOND_Point *pt2); draw a line from pt1 to pt2 void seric_Arc (int Port, SERICOND_Rect *rc, SERICOND_Point *pt1, SERICOND_Point *pt2); draw an arc defined by an ellipse and two radial lines, where the ellipse is defined by the rectangle, and each radial line comes from the center of the rectangle to a point. ------------- Pen+Brush Drawing The following functions draw edges with the pen selected on the canvas, and fill inside with the brush selected. What and how a function draws is apparant by the name and arguments, especially in view of the Arc function introduced above. The last 2 arguments in rRectangle are the width and height of the ellipse to round the corners. void seric_Rectangle (int Port, SERICOND_Rect *rc); void seric_Ellipse (int Port, SERICOND_Rect *rc); void seric_rRectangle (int Port, SERICOND_Rect *rc, short wRound, short hRound); void seric_Pie (int Port, SERICOND_Rect *rc, SERICOND_Point *pt1, SERICOND_Point *pt2); void seric_Chord (int Port, SERICOND_Rect *rc, SERICOND_Point *pt1, SERICOND_Point *pt2); ------------- Image Operation void seric_Invert (int Port, SERICOND_Rect *rc); invert the pixel colors of the rectangular area ------------- Mouse void seric_EnableClicks (int Port, char LeftClick, char RightClick); set the Button Byte values for the clicks of the left and the right mouse buttons, which will be the head of a "mouse packet" sent by SeriCon on a button click. If one of the last two argument is 0, SeriCon won't send any mouse packet on the corresponding button clicks. Refer to the Mouse Packet section for the mouse packet structure.

    5. Mouse Packet

      There is one more way of sending data, other than using the Tx window. If you click on the Rx graphic window, the following successive data will be sent, which we call a "mouse packet". Program your target to understand the packet structure of 6 bytes described as follows, if the target needs mouse clicks.

      • Button Byte: A byte specifying which mouse button is clicked. In advance, the target should inform SeriCon of the byte value for each button, by a special function packet named "EnableClicks" introduced in the previous section. After receiving this byte, the target recognizes that a button is clicked and which button it is.
      • Point: The x and y coordinates of the point clicked in the window, and are represented by the data type SERICOND_Point which is described in the previous section. The coordinate convention is also stated in the section.
      • Combination Keys Byte: This byte tell the target which keys are pressed when the click happened. The value should be SERIC_Clicks_Ctrl, SERIC_Clicks_Shift, the bitwise OR of the two, or 0, which means that respectively Ctrl, Shift, both, or none of them is pressed. The constants are defined in base.h in the "include" folder.
      Note that SeriCon does not send any mouse packet before it is informed of a non-zero Button Byte value since the port is opened. Similary, the target can let SeriCon not to send mouse packets, by informing SeriCon of zero values.

    6. Example Target Codes

      There are two programs to make a dos PC be the target, in "examples" folder, with source codes. The programs demonstrate what the function packets let SeriCon do. The sources show how to use the library to send the packets.

      The simple one, reflect.exe, just sends every received byte back to SeriCon. Its source file can help you understand the low level functions in the library. The program is also helpful in testing SeriCon in the normal mode, and also in the function mode "tediously" where a function packet is sent manually part by part similary as in the example described in the Binary Communication section of the Getting Started chapter. Using this program makes such tests a little easier and more reliable, since only one instance of SeriCon is used and the real target is involved instead of other instance of SeriCon. The program was used in the early stage of SeriCon development for function packets.

      The other example, demo.exe receives a character and regards it as a command to send the corresponding function packets. You will see various texts and graphics. It also receives mouse packets and reacts to show what and how you clicked. The source file may help you develop a program. Visit to SeriCon's web pages from time to time, since some practical programs will be released. What about turning an old PC into a special instrument ?

      The rest of this section is devoted to show a recommeded procedure in using demo.exe in which you can understand easily what the function packets do, while you may use the program later in any order of commands as you want. The routines in the program and the procedure in this section are specially designed for you to easily understand the funcion packets and the library.

      As in reflect.exe, the target PC's keyboard can be used to quit the program or to change the port number. You may get rid of the keyboard or the monitor if you use the COM1 port.

      From now on, you are assumed to run demo.exe in the target PC and SeriCon in the host PC, with the same port configuration including the baud rate. All the user inputs and all the screenshots in the next paragraphs are about SeriCon. You are also assumed to be reading the source file during the procedure. What is this program for, if not?

      After sending 'q' to let the target turn SeriCon into the function mode, send 't' to demonstrate the text functions. The result is the following screenshot.

      Send '1' to create a 300x200 canvas. The graphic window will appear in place of the text window, with the canvas painted dark blue. Then send 'g' to see texts decorated by rectangles. Nothing happened? The routine for this command omits the ShowCanvas function to show you its role of updating. This time, minimize the main window into the task bar and restore back, or toggle the G button twice, to see what was drawn. The result is similar to, but simpler than the screenshot at the end of the next paragraph.

      Erase the left half of the content by sending 'e', and then erase all by 'E'. Send 'h' to see other texts with rectangles. The routine also omits ShowCanvas. Sending 's' will run the function to show the left half. 'S' will show all, as in the following screenshot. The two commands for each of erasing and updating, and their routines are provided instead of one, to show you the role of an empty (zero) rectangle in ShowCanvas.

      Send 'd' to draw various objects. You may want to click the area saying "Click here with or without Shift/Ctrl". Click now, to see nothing. Something will happen, after you send 'k' for the target to send the EnableClicks function packet to let SeriCon memorize nonzero bytes ('l' and 'r' in this program), as the header byte (Button Byte) of mouse packets. Test now, the left and right mouse-buttons, with or without two keys pressed, inside or outside the area. The following screenshot is one of the results.

      Send 'c' and 'd'. Then you will see the text color changed. To test creating and using a font, send 'f' and 'w'. You can see texts drawn with the new font (which is italic, underlined and striked out) by sending 'd'. To test the Invert function, send 'i' or 'I' any number of times. You will see the left half or all inverted each time. The function is called using an empty rectangle, in the routine for 'I', to invert all.

      Create a very small canvas by sending '4' to see the "Adjust & Freezing" with margins due to the existence of the minimum main window size if the option is checked. Create larger canvases using '3' and '2'. However their sizes are the same as the one created by '1', unless you have the full license.

      Send 'n' 9 times to see what drawing-functions do with an empty rectangle argument.

      The following paragraphs describes the tests where SeriCon can delete the canvas and stop processing the Rx data after showing a waning message "Limited by Trial License" in the text window. In that case or to prevent it, close the port, open it again, and send 'q2', to recover or prevent.

      Let's test other brush and pen. Note that only 1 tool-creating packet can be processed since the port got open, unless you have the full license. Because a new font was created in one of the previous paragraphs, the following two new tools will stop the process under the trial license. Send 'b' and 'w' to create and use a new brush. The 5 pictures shown by repeatedly sending 'n' will contain the results. Send 'p' and 'w' to create and use a new pen. You can see the results in the 6 pictures shown by 'n's.

      Let's test some numbers forbidden in the trial license to convert. Send 'T' to see them in the text window. You will see them in the graphic window by sending 'H'. SeriCon stops processing the Rx data in the two tests unless you have the full license.

    7. Errors

      There are two error messages which can be added in the Rx text window, other than "Invalid FTB" stated in the Binary Communication. They are originated from the "old" function mode provided in SeriCon 2.0, which is also provided in this version.

      If SeriCon receives a byte 0, it turns into the old function mode, in which SeriCon gets ready to act like printf. It receives a null-terminated "format" string, a "VarSize" byte specifying the number type, and the binary number, to convert it like printf and go back to the normal mode. That is, the old mode processes only one packet and return to the normal mode, in contrast to the new function mode, besides the packet structure difference.

      If the number of characters before the null in the format string is larger than 255, SeriCon issues the error message "Too Long Format" and return to the normal mode. Unless the VarSize is +1, -1, 2, -2, 4, 8 or 0, SeriCon issues the error message "Invalid VarSize" returning to the normal mode.

      Now you may recognize what each of the three 0 bytes for the new function mode does: SeriCon turns into the old function mode by the first 0, receives an "empty" format (by the second 0) and turn into the new mode by the last 0.

  5. More Options

    1. Showing Pulse Measurements

      To customize the display format of the pulse measurement results in the display window for each of CTS/DSR/RLSD, you should know that there are more about the quantities introduced in the Measuring Pulses: CTS/DSR/RLSD section of the Getting Started chapter. There are 4 internal quantities as follows.

      • Count/Divisor: (level changes) ÷ (Divisor)
      • Threshold: The "event" is defined to be the situation where Count/Div reaches this value. Refer to other sections for Event-Action.
      • tL: The last low level duration in mili seconds. Note the word "last". If the present level is low, it's duration will be measured and displayed when the level becomes high.
      • tH: The last high level duration in mili seconds.

      You can specify what quantities to display and how to display them, using the dialog box popped up by the item named after the input bit in the [Bit] menu. The next paragraphs and the next section describe how to use the box for CTS, the screenshot of which is shown at the end of this section. The boxes and usages for DSR and RLSD are similar to CTS.

      In the Display group in the box, you can determine show/hide of each quantity by the 4 check buttons collectively labeled as "Arguments". Internally SeriCon converts the selected quantities into a text using the format string specified in the Format window, like the C function printf converts arguments. The default format string contained in the window and the default argument selections ( which excludes Threshold), let you understand what you saw in the Getting Started chapter, if you are familiar with printf. For an introduction to printf, refer to the third paragraph in the section Text Functions in the Function Mode chapter.

      The default Divisor value 2 is very special, since Count/2 means the pulse count. Specify any Divisor value except zero, expressed in a decimal integer or a floating number form. For example, "20", "2.5", or "3.5e-3" (meaning 3.5*10^(-3)) are valid entries in the Divisor window. SeriCon converts the number expression you specified into a double precision floating number before dividing Count.

      All the quantities (arguments) are integers including Count/Divisor, unless you check "f(tL)" or "f(tH)" cuttons. If one of this button is checked, SeriCon uses a double precision float number "f(t)" instead of the duration as the argument, which is calculated by the following transformation of the duration t (tL or tH).

      f(t) = a0 + a1*t + aE*exp(-t/RC)
      You can specify the four parameters a0, a1, aE and RC using the windows located at the right of the button. Rules for valid number expressions are the same as those of Divisor. You can make use of this linear or exponential transformation according to what you are going to do. The 4th parameter name suggests that the transformation is useful when the target is a circuit with transient voltages generated by a resistor and a capacitor for example. The 4 parameters' default values 10, 0, -10, and 100 are chosen for a voltage meter application refered in the Introduction chapter.

      The exact number types of the quantities are mentioned in the previous paragraph, since it is important you should include the valid number formats in the Format string corresponding the quantities. For example, %d or %x are for integers and "%f" are for floats.

      Be sure to include the same number of number formats in the format string as the number of selected arguments (quantities), also in the same order as the order of the checked buttons, which don't need to be mentioned if you are familiar to printf.

    2. Event-Action for CTS/DSR/RLSD

      You are strongly assumed to read the previous section since many words or names come from paragraphs and the picture there.

      To enable the Event-Action mechanism, check the Enable button in the Event group. Then, after you close the box by the OK button, you will see that NotePad run as the default action, when Count/Div reach the default Threshold. Open again the dialog box by the menu, to learn customizing as follows.

      Check the Reset button, if you want Count/Div to be automatically reset to zero right after the event happened, in order to make it happen again and again indefinitely. Note that this automatic reset is not the same as pressing the reset button in the main window because tL and tH are not affected.

      Specify an integer value for Threshold. Not only decimal but also hexadecimal and octal expressions are allowed. How to express is the same as that in the first paragraph in the Binary Communication section of the Getting Started chapter.

      The 1st part of the status bar in the main window shows about the events. The first 3 characters after "Event: " in that part indicate the Cts, dSr and rLsd event states, respectively in that order. If an event is disabled the corresponding character is '0'. If it is enabled and has not happened yet, the character is the symbol of the bit (L for rLsd, for example). If the event has happened, the character reads ' * '.

      You might turn to the main window in the previous paragraph. Now return to the dialog box using the menu, and go to the next section to know how to change the action.

    3. How to Specify the Action

      This section absolutely assumes that you came from the previous section or the last section of the chapter.

      You can specify the "action" file to open/run on the event, in the second rows of the group. Use the Action button to browse an action. A program, a sound file or any other else will do. The selected action will be displayed in the window at the right to the button. Or you can specify it directly in the window. You can specify even a folder path, instead of a file, for the action (The folder window will be open on the event).

      The Parameters window lets you specify the command-line options or parameters of the action program. For example, if you can execute "notepad.exe filex.txt" in a command line, then "filex.txt" is called the command line option or parameter, while "notepad.exe" is the action if prefixed by its path. For example, you can select a sound file as the action without parameters, or instead you can specify a sound player program for the action and specify a sound file for the parameter.

      You can specify the parameter file's path in the Folder window, instead of including it in the file name in the Parameters window. If the path is neither included in the Parameters window nor specified in the Folder window, the action may use it's path to find that file. The action may neglect the path specified in the Folder window, if the Parameters window includes the path.

      The Test button lets you execute the action right now before closing this dialog box. You don't have to close the box and wait the event, just only to see if the action will be executed successfully as specified. Note that the Trial License allows you to execute any action by the Test button, although it does not permit you to close this dialog box by the OK button with the default action changed.

      The combo box at the right of the Reset button specify the action's window states(activation and size) when it is executed if it has a window. All the values are provided by the system's API function that SeriCon calls to execute an action. The default value named "Show Normal" is generally suitable for most actions. The other values are not tested enough to be described in this manual. The words "No Activ." in some values' names mean that, if the action is already executed (whether by SeriCon or not) and it's window is not activated, SeriCon does not try to activate it, while some other values including the default make SeriCon do.

    4. Output Automation Parameters

      Run the [Bit]->[rX,Outputs...] menu to pop up the dialog box as shown at the end of this section. In this box you can specify options, about processing the serial input & output data, and about automation parameters of the serial output and the 2 output control-bits. There are three groups of controls in the box. The first group is described in the next section. The first check-box in the Miscellaneous group is already described in the section Window and Canvas in the Function Mode chapter. For the other 2 rows in the group, refer to the What To Save section in the Option Files chapter.

      This section describes the Outputs Automation group. Each of 3 sets of options is in one line with the label indicating the output name. Each N is the number of cycles. Specify 0 if you want it to repeat infinitely. T is the period of Tx (serial output) sendings, in mili seconds. In case of RTS or DTR, the "base" time t in mili seconds is used to specify the period and the duty ratio. The period is t*(nL+nH), and the low and high level durations in a cycle are t*nL and t*nH respectively. If the output level is low just before the automation starts, each cycle begins with the low level, and if high it begins with high.

    5. Event-Action for Serial Input

      Enable the event-action mechanism of the serial input, by checking the Enable button in the first group in the dialog box popped up by the [Bit]->[rX,Outputs...] menu. The screenshot of the box is at the end of the previous section. Let's see what will happen with the default values in the group, by closing the box (OK button). Send from the target (Hyper Terminal for testing, for example) to SeriCon a character 'x'. Then filex.txt will be open by NotePad. Send 'y' instead. Then filey.txt will be open.

      Return to the dialog box by menu, to see how such Event-Action happened and how to customize. When any one of the characters you specify in the Characters window in the box is received, we say that an "event" happened. Specify characters without anythings (blanks, commas) between them, since even a blank can be an event character. The default is "xy", the result of which you saw in the previous paragraph.

      Go to the How to Specify the Action section to know about the second rows of controls in the rX Event group in the dialog box, and return here. There are more you need to know about the syntax in the Parameters window. When SeriCon reads the text specified in the window as the parameters to execute the action, it replaces any "%%" by "%", and skips any pair of "%" and a character other than "m" or "%", until it meets and replaces the first "%m" by the event character. This way, the default Parameters made SeriCon open different files depending on which of the two default characters is received, as you saw in the first paragraph.

      The last character of the events part in the status bar displays about the event. If the event is disabled it reads '0', if enabled but has never happened yet it reads 'R', and if at least any one event happened it reads 'r'.

  6. Option Files

    The option files and Sericon are similar to documents and a wordprocessor respectively and let's call the files "SeriCon option files" or "SeriCon document files".

    1. When to Save

      The main window's title bar shows the document name including the path. Any change in options (See the last paragraph in this section about exceptions) will make "*" appear in the head of the bar for you to recognize that options have been changed since loaded. We say that the internal "change-flag" is set in this case. If the options get saved to a file, "*" disappears. We say that the flag is reset.

      While you can save intentionally by menus, SeriCon also saves the present options if the title bar is headed by "*", when the program is about to terminate or when a new set of options is to be loaded. Check the [File]->[Ask Save] menu, if you want SeriCon to ask your comfirmation of saving in those cases.

      There are options whose change does not set the change-flag and are called "trivial", since they are so trivial that you don't want to be bothered by a save-confirmation dialog box if the [File]->[Ask Save] menu is checked. You may intentionally (by menus) save trivial options when you need. If nothing but trivial options are changed SeriCon will not try to save. Some options are trivial and some other are optionally trivial (i.e. their trivialities can be specified). See the last section for the lists.

    2. More Files

      "scs" is the file extension that SeriCon uses as the first filter in the file-open/save dialog boxes invoked by the [File] menus. In a folder window or folder explorer, you can double-click any file with that extension to execute SeriCon with the file loaded, if the installation was successful, that is, if the extension is associated with SeriCon (if not, press the right mouse button on any file and follow the system boxes to associate them. Refer to your OS manual for details).

      As you are recommended in the Getting Started chapter, you may created "simple.scs" in the SeriCon folder. If you are interested in using SeriCon with various option files edited specially for various hardwares, you may decide (It's your choice) to delete it, due to the following reason. If there is no file named so and you execute SeriCon by way of SeriCon.exe or a short-cut file derived from it (that is, not by way of any option file), then SeriCon starts without loading a file, setting all the options to the default values, with the title bar reading "New", like a wordprocessor. In this case the [File] menus' behavior is similar to that of wordprocessors. The [File]->[Save] menu pops up the file-save dialog box like the [File]->[Save As...] menu, where you can specify the file path and name, since the document is "New". Of course, The [File]->[New] menu also create a New document using the defaults.

      Note that the [File]->[New] menu and the [File]->[Open] menu both do the followings, before creating and loading a document. Firstly, they closes the port if opened. Secondly, the present document gets saved if the change-flag is set (i.e. if non-trivial options are changed). SeriCon does these two things also when the program terminates.

      There are 2 sets of defaults, which can be used to create a New document. If a file named "default.scs" exists in the SeriCon's folder, it will be used. In other words, you can customise the default by creating and modifying such a file. Otherwise, internal defaults will be used.

    3. What to Save

      This section lists the options which are to be saved. Most of them are introduced already to you in other sections or chapters, and some are not.

      Non-Trivial Options:

      • [File]->[Ask Save] menu's check-state
      • Port number, selectable by the [Port]->[Select and Run...] menu
      • Port configuration, customizable by the [Port]->[Configuration...] menu
      • [Port]->[Run On Start] menu's check-state
      • [Port]->[Ask Stop] menu's check-state
      • [Port]->[Tx On Open] menu's check-state
      • [Port]->[Rts On Open] menu's check-state
      • [Port]->[Dtr On open] menu's check-state
      • Options customizable by the [Bit] menus

      Trivial Options: Main window's size and location. Auto-step period.

      Optionally Trivial Options: The contents in the Rx text window and in the Tx window, the trivialities of which are also options that can be specified as in the next paragraph. Saving these texts may be useful to some users, but is not introduced elsewhere in this manual. Note that if the [Port]->[Run On Start] menu is checked, you cannot see the memorized Rx text since the window is cleared right after when the port is opened. In that case you can read the text by manually loading the option file using the [File]->[Open...] menu.

      Some options in the dialog box popped up by the [Bit]->[rX, Outputs...] menu are introduced not in the section for the menu but here as follows. The 2nd row in the Miscellaneous group defines whether the contens in the Rx text window and in the Tx window are trivial or not, by check-boxes. The 3rd row determines the initial check-states of the Rts and the Dtr buttons in the main window right after the option file is loaded.

    4. Port Options

      There is an aspect of the port configuration options not mentioned in the corresponding section, not so important in usual cases. If you make and use default.scs containing a port configuration, as the defaults to create a document, you can ignore this section.

      SeriCon does not suggest any internal default values for these options. When creating a New document, SeriCon sets all the other options using internal defaults while it does not even allocate the memory space for these options. SeriCon allocates and loads the options from the first port open since the New document is created. The change-flag is set in that case, although just the port is opened and you don't even use the menu to change the configuration, since this document from now on will open any port, initializing it with these options.

      There are exceptions in this rule which regards the existence of the port configuration data in a document as non-trivial. One of them is when a port is opened right after SeriCon started running with creating a New document (i.e. when you double-click not an option file but SeriCon.exe. Note that the internal defaults include the [Port]->[Run On Start] menu's checked state and the port number COM1). The other is when a file without the port-configuration data is loaded after any port has been open since SeriCon Started.

      You may create a file containing no port-configuration, by saving a New document without opening any port, in order to use the file to open ports (after loading the file) without touching the port's present configuration.

  7. Limits of Trial Version

    Here are the list of limits you experience unless you acquire a full license key.

    • The canvas size is bounded by 300x200. If a larger canvas is requested to be created by the target, the intersection of 300x200 and the requested size will be used to create.

    • A new tool can be requested to be created only once since the port got open. If one tool is requested to be created, the next request will be refused and will make SeriCon delete the canvas, stop processing the Rx data and display only a warning message until you close the port, whether the two requested tools are of the same kind (one of brush, pen and font) or not.

    • If Rx receives a number value other than the followings in the function packets for number-conversion, SeriCon will delete the canvas, stop processing the Rx data and display only a warning message until you close the port: All the 1-byte numbers, 2-byte numbers 32767 and -32767, 4-byte numbers 2147483647 and -2147483647, and 8-byte numbers 1.7e308 and -1.7e308. Therefore function packets for conversion of numbers longer than 1-byte are not practical and just for evaluation.

    • The actions for events cannot be modified for actual applications. But, it is allowed to test any action before closing the option dialog box for an event-action. If an option file with modified actions (created under the full license by other user, for example) is loaded, SeriCon will replace them by the default action.

    • The output automations are restricted as follows. Each N is confined to the range 1 ~ 60. Each t as well as T is limited to 2000 ms. Each nL as well as each nH is limited to 3. If an option file with values out of these ranges (created under the full license by other user, for example) is loaded, SeriCon will replace them by the nearest boundary values of ranges.

    • Only 1, 50 and 2000 ms are valid periods of Auto-Stepping.

    • Each of the 3 input control-bit display windows shows no text but a warning message if the count of level changes exceeds 60.

    The trial version also has an additional area in the main window to display advertising pictures, so that the working area is smaller than the one with a full license key for the same main window size. If the computer is connected to the internet, new pictures may be displayed.

  8. License Agreement

    Please read Agree.txt.

  9. History

    • Version 2.8: Apr 29, 2011

      The installer and the uninstaller are included.

      A bug in loading a file by association (for example when double clicking it), other bug in reading a file made by old versions, and other small bug are removed.

      The product is modularized, the result of which, the new file softbatt.dll gets installed into the system folder.

    • Version 2.7: July 22, 2009

      A new feature is added, to drive a stepper motor: RTS and DTR can pulsate in a fashion to drive the A and B signals into the motor. Manual, backward and periodic auto steps can be easily run and adjusted by newly added buttons and a spinner. A new menu [Bit]->[Stepper...] lets CTS, DSR, or RLSD to disable stepping, which is useful for the rotating body not to hit something.

    • Version 2.6: July 8, 2009

      Some limits of the trial version are expanded: The N of output automations and the count of input pulse changes both have 60 as the limit which was 7 in the older versions.

      Some default values are changed: N is 60, and nH is 1 the same as nL, which were 3 and 2 respectively in the older versions.

      Linear or exponential transformation of the input pulse durations can be displayed instead of the durations (tL, tH).

      A new section about the timing accuracy is added to the manual, which gathers old comments from other sections and contains new comments on the input pulses and on the internal mechanism for timing.

      The Baud argument's type in the function seric_InitCOM in pc.h is corrected into "long" from the wrong "int".

      Some parts of the manual are re-organized or re-written to be understood more easily.

    • Version 2.5: June 10, 2008

      The outline of protocol is modified. The new function mode does not return to the normal mode until the port gets closed and repeats receiving packets. Furthermore the new packet structure is more efficient.

      The text function packet PrintStr is defined, and the routine to receive and process it is implemented.

      The graphic function packets to receive and the mouse packet to send are defined, and the routines to process them are implemented. The internal "canvas" and "painting box" are also implemented to process them. The Rx graphic window, the G button and the canvas state window are added. A new option, Adjust & Freeze, to fit the canvas into the graphic window, is added to the Miscellaneous group in the dialog box of the [Bit]->[rX,Outputs...] menu.

      A library and main code examples, for dos targets to serially communicate with SeriCon, are included with source files. The two folders "include" and "examples" for them are added to the package. The library has the function routines to send the function packets to SeriCon. The examples, reflect.exe and demo.exe demonstrate what SeriCon shows using the defined packets and how to use the library.

      The view menus are added to show or hide controls in 3 ways: Serial, Control and All views.

      A problem in changing the port configuration in some OSes is removed.

      Fatal errors during serial communication in some OSes are removed.

    • Version 2.0: June 27, 2007