SeriCon 2.5
Users' and Target Programmers' Manual

  1. Introduction

  2. Installation
    1. Upgrading
    2. System Requirements
    3. Trial Version
    4. Full License Key

  3. Getting Started
    1. Ports
    2. Serial Input
    3. Windows for Serial Input
    4. Serial Output and Automation
    5. Binary Serial Output
    6. Measuring Pulses: CTS/DSR/RLSD
    7. Pulse Generation: RTS/DTR

  4. Function Packets
    1. Library
    2. Text Functions
    3. Graphic Functions
    4. Example Target Codes
    5. Errors

  5. More Options
    1. Showing Pulse Measurements
    2. Event-Action for CTS/DSR/RLSD
    3. How to Specify the Action
    4. Output Automation Parameters
    5. Event-Action for Serial Input

  6. Option Files
    1. When To Save
    2. More Files
    3. What To Save

  7. Limits of Trial Version

  8. License Agreement

  9. History

  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:

    • The protocol is simple. SeriCon stops the normal character mode when it receives three 0 bytes, and turn into the "function" mode. Let your target send SeriCon, a "function type" byte and the "arguments" data. Then SeriCon converts them into texts, graphics, and other various works. There is a function that specifies the header of information that SeriCon should send to the target when the user clicks on SeriCon.

    • To help you program the target('s MCU or microcontroller) according to the protocol, 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.

    • Neither number-to-text conversion codes before sending, nor the reverse codes after receiving are needed in the target. Strings of characters, variously sized (1, 2, and 4 bytes) integers with various types (octal, hexadecimal, decimal expression), and double precision floating numbers (8 bytes) can be sent from SeriCon by the user just typing and selecting. The datum can be automatically sent with a variable period and number of times.

    • 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, can be displayed.

    • 2 control-bits RTS and DTR are also utilized to send static or dynamic signals with variable specifications (periods, level durations, and numbers of cycles) to your hardware.

    • 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 a situation where an input pulse count reachs a specified value or where receives a specified character.

    Therefore SeriCon can be used in many ways, in experiments, engineerings, or electronic hobby works. The first of the following paragraphs describes examples using the serial communication, while the second is about utilizing control-bits.

    Suppose that your hardware or device has a MCU equipped with an UART module to communicate serially with PC, and that you don't want to develope a special GUI PC program for it since it takes much time or you know nothing about PC programming but the printf function. Generally you can use a text communication program included in your operating system. In this case, you may need to spend much time in programming the MCU, if you want to make it and PC send each other a series of data including not only text characters but also numbers. Use Sericon. It frees your MCU from data conversion works, and provides a powerful text and graphic interface.

    If you are going to watch a signal from an apparatus, in order to count level changes, to measure durations, or to be alarmed by changes, you will be satisfied by SeriCon. As well as a pulse counter, SeriCon can be used as a pulse generator or a timer. 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 your work very easy.

    Of course, utilizing the control-bits is suitable only for low frequencies. High frequency system is recommended to include a MCU (and additional memories if needed) which controls the system and communicates with PC.

    Note that the input/output signal range of PC serial ports (not only the control pins but also the serial data pins RxD/TxD) differs from that of the TTL/CMOS compatible parallel ports. First of all, the low level is negative! In general, a level shifter is needed to use serial ports to interact with external hardwares, since generally the hardwares' signal is TTL/CMOS compatible. There are famous IC chips for level shifting, and instead you can make it easily by a tiny number of electronic components including transistors. Although this signal level issue somewhat bothers serial port users, the port outputs can provide power sources to the hardware, due to the output voltages and currents higher than those of parallel ports.

  2. Installation

    1. Upgrading

      If you have used the version 2.0, install this version as follows. Open the folder where the version is installed. Copy the "important files" into other safe place out of the folder, which may be the full license key (effective also for this version !) and your customized option files. Then delete all the files in the folder, install this version into the folder and restore the "important files". Skip the next sections.

    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 start to use one of the files, sericon.exe. Then the user now has the trial license. That is, there are restrictions on some functions, 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 folder in which the trial version is installed.

  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. For details about using option files, refer to the Option Files chapter. When it comes to saving options, all the contents in this manual except the chapter, assume that you are using SeriCon the way as suggested in the previous paragraph, not because the way is the best, but because comments related to the other ways may not make you concentrate on the material.

    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 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. Serial Input

      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. You might be using the Serial view, as in the screenshot in the Binary Serial Output section. 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.

      After receiving three successive null (binary zero) byte, SeriCon turn into a special state called the "function" mode. In this mode, all the data from the target must be successive "function packets", each of which has the following form.

      • 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.

      Various function packets are defined in SeriCon, as described in the Function Packets chapter. The chapter also describes the library included in the SeriCon package to help you program the target. 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.

      Some functions converts binary integers and floates into expressions according to the format string, like the C function printf does. The results will be inserted into to the Rx window. There is one more window behind this "text" window. Check the "G" button below the window label, to hide the 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. Some other functions draw texts, numbers or geometric objects in this window. The G button state and which window shows are changed not only manually, but also by functions.

      Hyper Terminal cannot be a target to test a function, since the function packet to be sent to SeriCon must consist of binary parts as well as characters. Other instance of SeriCon can be, after you learn how to let SeriCon send binaries in the Binary Serial Output section. See an example in the section. Surely, the final test is to program your MCU-equipped target to send SeriCon a function. If you have one more PC bootable with dos you can use it as the target to test various functions very easily, as described in the Example Target Codes section of the Function Packets chapter.

    3. Windows for Serial Input

      The Rx text and graphic windows are introduced in the previous section. Here follows more about how to use them.

      Actually SeriCon draws 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.

      The content in the text window is one of the items to be saved into the option file. But if the [Port]->[Run On Start] menu is checked, you cannot see the memorized 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.

    4. Serial Output and Automation

      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 it on. SeriCon will send the data after 1 second and repeat this cycle 3 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 where there are also comments on the period deviation. To stop it, uncheck the [Auto]->[Tx] menu. SeriCon unchecks the menu right after the specified number of times is finished. If you want the automation to start automatically right after when a port is opened, check the [Auto]->[Tx On Open] menu. Do NOT move the main window by dragging (or by the Move menu in the main window's system menu) after the automation starts, because the output will be delayed during the move.

      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.

    5. Binary Serial Output

      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.

      If you are running Hyper Terminal as the target to test SeriCon, you can test the Integer formats using ascii codes (you can see the corresponding characters in Hyper Terminal), but neither other integer values nor the Float 8. Run other instance of SeriCon as the target, to test them. The next paragraphs shows how to. Of course, the final test is to use a target which is programmed to receive such binary numbers to do something.

      Now, here follows a demonstration in which you can test both sending binary numbers and receiving a function packet. Not only to know what the latter means, but also to understand the demonstration procedure, you are assumed to have read the Serial Input section. You are also assumed to run other instance of SeriCon on the same or other PC, as the target.

      Send the target SeriCon three null bytes (i.e. select Integer 1 in the format combo and send 0 three times), to turn it into the function mode. Then, send byte numbers 8 and 4. The latter number is the length of the next data. Send the next data, "F=%e", using the Characters format. Finally send "1.7e308" using the Float 8.

      All the data after the three null bytes you sent from the host SeriCon as above constitute a function packet named "Print8f" which lets the target SeriCon convert a double precision float binary number into a text string using the format string "F=%e" like printf, and the first byte, 8, plays the key role to make SeriCon recognize what to do. The following screenshot shows the result. For other functions, refer to the Function Packets chapter.

      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".

      • 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", so that when receiving such a byte the target can (be programmed to) recognize that the corresponding button is clicked and wait the other parts of the mouse packet. Refer to the Graphic Functions section in the Function Packets chapter.
      • 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 Graphic Functions section in the Function Packets chapter. 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. 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 the screenshot in the next section.

      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 1. 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.

      Refer to the Showing Pulse Measurements section of the More Options chapter, to use the [Bit] menu for the followings. You can specify the threshold count value to define an "event", the "action" file to run/open on the event. Each display window's format can be customized freely like printf, and can include the threshold value. Furthermore, the count can be scaled down by the divisor you specify. You can also scale up so that not the pulse but the level-change count appears. The section comments also on the deviations of tL and tH from true values.

      If you don't have any target (a signal) to connect to a pin, by what are you going to test SeriCon? You may use a wire with an end connected to the pin, and with the other end switched between a high (about 10V) and low (about -10V) DC votages. But you don't have to. Just run other instance of SeriCon in the same or other PC and connect through a null modem cable. And then toggle the Rts or Dtr button in the other instance. Refer to the next section.

    7. Pulse Generation: RTS/DTR

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

      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. Do NOT move the main window by dragging (or by the Move menu in the main window's system menu) after the automation starts, because the output will be delayed during the move.

      Uncheck the 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.

      By what will you test these features? You may search your desk for a LED and a resistor to be soldered to the pin. You don't have to. Just run other instance of SeriCon in the same or other PC and connect through a null modem cable. Since the cable connects one port's RTS to the other port's CTS, the target SeriCon will show the following results.

      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 which also comments on the deviations of timings.

      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.

  4. Function Packets

    The definition of function packets and their basic common structure are stated in the Serial Input 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. 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 introduced in the previous section. 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 Binary Serial Output section for the mouse packet structure.

    4. Example Target Codes

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

      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 Serial Output 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.

    5. Errors

      There are two error messages which can be added in the Rx text window, other than "Invalid FTB" stated in the Serial Input. 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 variables introduced in the Measuring Pulses: CTS/DSR/RLSD section of the Getting Started chapter. There are 4 internal variables as follows.

      • Count/Divisor: The 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 variables to display and how to display them, using the dialog box popped up by the corresponding item 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 variable by the 4 check buttons collectively labeled as "Arguments". Internally SeriCon converts the selected variables 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 Packets 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.

      Note that all the variables (arguments) are integers so that only the integer formats (using %d and %x for example) are allowed in the Format string. Count/Divisor is also an integer, although Divisor is a floating number. Be sure to include the same number of integer formats as the number of selected arguments. Of course, the integer formats and the selected arguments correspond to each other in their orders.

      Note that tL and tH can differ from true values by several tens of mili seconds, due to multi-tasking features of your operating system. The differences may not be larger than that, unless you are running extraordinary applications simultaneously which spend much CPU time.

    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 Serial Output 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 Windows for Serial Input in the Getting Started 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.

      Note that, the period and durations in any cycle after one of the 3 automations starts can differ from the specified values by about several tens of mili seconds, due to multi-tasking features of your operating system. The differences may not be larger than that, unless you are running extraordinary applications simultaneously which spends much CPU time. Furthermore the overall long time of very many cycles may differ from the exact value just by that much, not by some large accumulated amount, since the timing is based on the very accurate (far below a micro second) hardware timer in the PC and it is the various delay from the timer to SeriCon through OS that causes deviations.

    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 you associates that extension with SeriCon in your system. Now that SeriCon is distributed in the form of zip file instead of installation execution file, you should do it yourself. It is simple. In a folder, double-click any SeriCon document with "scs" extension. Then your system invokes an dialog box to associate the extension with a program. 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

      Optionally Trivial Options: The contents in the Rx text window and in the Tx window, the trivialities of which are specified as in the next paragraph.

      Some options in the dialog box popped up by the [Bit]->[rX, Outputs...] menu are not introduced elsewhere in the manual. 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.

      There is an aspect of the port configuration options not mentioned in the corresponding section, not so important in usual cases. 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.

      Of course, if you make and use default.scs containing a port configuration, as the defaults to create a document, you can ignore this aspect described by the previous three paragraphs so far.

  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 ~ 7. 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.

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

    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

    SeriCon is Copyright(C) 2007-2008 http://www.softbattery.net.

    SeriCon consists of the trial version and the full license key.

    The compressed form of the trial version, which is a file with "zip" extension and in which this file (manual.htm) is contained as one of the components, can be freely copied and distributed as far as it is not modified.

    A copy of the compressed form of the trial version can be freely extracted into the component files and folders. All the files in the two component folders "include" and "examples" except base.h, and the file defad.txt can be freely copyied, modified or distributed. Any component else is NOT permitted to be de-assembled, de-compiled, reverse-engineered, modified, copied or distributed.

    A full license key is a file needed to upgrade the trial license to the full license, that is, to eliminate restrictions of the trial version's functions. A key is NOT permitted to be copied or distributed to be used in more than one computer, and is NOT permitted to be reverse-engineered, or modified.

    SeriCon is provided as is, without warranties of any kind. The copyright holder shall NOT be liable for damages of any kind.

  9. History

    • 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