WinSPC Knowledgebase Home | Glossary | Favorites | Contact | Login WinSPC Knowledgebase Home | Glossary | Favorites | Contact | Login
Search the WinSPC Knowledgebase Browse by Category
How do I setup and use a serial device?
Article Details

Last Updated
21st of June, 2013

Applies to
WinSPC 8.0, WinSPC 8.1, WinSPC 8.2, WinSPC 8.3

     WinSPC has the ability to gather data from most serial devices.  A serial device is serial communication through a physical interface, usually a serial port, which information is transferred one bit at a time.  WinSPC can communicate with most devices that are RS-232 Compliant*.  Workstations without serial ports may require serial-to-USB converters to allow compatibility with RS 232 serial devices and a virtual serial port emulator.

     Setting up a serial device is accomplished in four easy steps.  This article will go through the four steps of Selecting the Serial Device Type, Setting up the Serial Device Connection tab, Setting up the Serial Device Reading tab, and Setting up the Serial Device Mask tab.

Selecting the Serial Device Type

  1. Double-click the Device you want to set up as a serial device from within the Contents pane of the Administrator screen.  This causes the Device Setup dialog box to appear with the Connection tab selected.   If the device is not yet created, complete the Creating a Device procedure by clicking on the following link:  How do I create a Device in WinSPC
  2. At Device Type, leave Serial selected.

Setting up the Serial Device's Connection tab
serialdevice_connection.jpg

  1. In the Serial Settings area of the Connection tab, enter the following settings that the physical device will use to communicate with WinSPC:
          m Port              m    Parity
          m Baud Rate    m   Stop Bits 
          m Data Bits      m Hand Shaking
    This information can be found in the documentation that came with the device, or sometimes the manufactures puts a sticker on the device with this information. 
  2. Check the Use Prompt String checkbox, if a prompt string is needed in order for the device to transmit data. Enter in the prompt string using the keyboard in the text box provided or you may select the listed string in the list box.  Prompt strings can consist of a combination of manually entered characters and strings from the list of strings.  To use a predefined prompt string, left-click the desired string then left-click the left arrow button. Please consult the device documentation for prompt string information.
  3. Check the Use Channel Number check box, if the device transmission includes a channel number that you would like to use to direct the data, to the correct characteristic, during data collection.  Select the Numeric radio option if the channel number format consists of only numbers or Alphanumeric if the channel number contains one or more letters or other special characters.

Setting up the Serial Device Reading tab

In the Readings tab, reading refers to the portion of the serial device's transmission that is to be processed by WinSPC each time a transmission is received. (This is different from the manner in which reading is used elsewhere in WinSPC.) Readings, as used here, usually contain one or more records and occasionally other information, such as header information. A record consists of a value for each variable and tag to be collected from the device.serialdevice_reading.jpg

  1. If the serial device is not directly connected to the WinSPC station you are using, click the OK button to exit and save the settings.  Go to a station that is directly connected to the device, log into WinSPC on that station, double-click the serial device you are setting up and complete the remainder of this procedure from that station. This step is necessary because the setup of a reading from a serial device cannot be tested from a station other than the one physically connected to the device and testing the setup of a reading is an integral part of setting up a device. This step is necessary because the setup of a reading from a serial device cannot be tested from a station other than the one physically connected to the device and testing the setup of a reading is an integral part of setting up a device.
  2. Click the Device Setup dialog box's Reading tab.   The purpose of this tab is to enable WinSPC to identify the beginning and end of a unit transmission, and, within a unit transmission, the beginning and end of a record. The purpose of this tab is to enable WinSPC to identify the beginning and end of a unit transmission, and, within a unit transmission, the beginning and end of a record.
  3. Get a sample transmission from the device. To do this:
    1. Click the Reading tab's Get Reading button. This causes WinSPC to send the Prompt String, if one was added from the previous section, then listen for a response.  The responding transmission will then be displayed in the top half of the tab.  If the actual physical device has a Send button, then press the Send button on the device.   Note: The Get Reading button will be replaced by the Stop Reading button.
    2. Click the Stop Reading button once at least one complete reading is received. 
    3. Identify the reading within the transmission. To do this, under Reading Settings, use one of these four options:
      • Terminator: If the reading has a terminator that unambiguously demarcates it, select this option and specify the terminator in the space provided. 
      • Lines: If the reading begins with the transmission's first line and ends a fixed number of lines later, select this option and specify the number of lines in the space provided.  When this option is selected, WinSPC populates a number into the Lines text box.  If this number is incorrect, overwrite it. The first line in the transmission, no matter what it is, counts as line one.
      • Length: If the reading begins with the transmission's first character and ends a fixed number of characters later, select this option and specify the number of characters in the space provided.  When this option is selected, WinSPC populates a number into the Length text box.  If this number is incorrect, overwrite it.
      • Time Out: If the reading is always received within a set amount of time after receipt of the transmission begins, 30 seconds for example, select this option and specify the number of seconds in the space provided.
  4. Define the header/body format for the reading. To do this, under Data Format, use one of these three options:
    • Header only: Select this option if the reading consists only of a header. Header, in this case, refers to that part of the reading which contains non-repeating content.
    • Body only: Select this option if the reading consists only of a body. Body refers to that part of the reading which contains repeating content; rows of identically structured records, in other words.
    • Header and body: Select this option and, in the Header Length text box, specify the length in lines of the header if the reading consists of both a header and a body.
  5. Define the body record format for the reading if, in the preceding step, the Body only or Header and body option was selected. To do this, use one of the following three options:
    • Terminator: If each record has a terminator that unambiguously demarcates it, select this option and specify the terminator in the space provided.
    • Lines: If each record is a fixed number of lines in length, select this option and specify the number of lines in the space provided.
    • Length: If each record is a fixed number of characters in length, select this option and specify the number of characters in the space provided.

Setting up the Serial Device's Mask

Mask (or Masking) is a way to identify the locations of the data values, tag values and channel number within the reading and to ignore (masking off) the rest of the reading that is unnecessary information. 

  1. Click the Mask tab.serialdevice_mask.jpg
  2. View As Text is the default view in the Mask Data area, but if you prefer to view it in a hexadecimal format, select the View As Hex option.
  3. Masking Header readings
    1. Channel Number - If Channel Number was selected on the Connections tab and the Header contains the channel number, then use the following steps to define the Channel Number mask.
      1. Click on the Header tab located in the Locations area.
      2. Single-click the in the Value cell for the Channel row and using the Locate By options, to the right, to unambiguously identify the location of the channel number in the header. For more information on how to do this, see Using The Locate By Options below.
    2. Tag Information - If the reading has one or more Tag values in the header, identify the location of each header tag value that WinSPC is to process. To do this:
      1. Select the Header tab from the Locations area (if not already selected).
      2. Select Tag from the Type dropdown box from the newly created row.
      3. Click in the Location cell and enter a name for the Tags location.  See Best Practice Tip:
      4. Click in the Value cell and, using the Locate By options to the right to unambiguously identify the location of the tag.  For more information on how to do this, see Using The Locate By Options below.
      5. Repeat this step for each remaining Tag located in the header.
    3. Variable Data - If the reading has one or more data values for variables, identify the location of each header variable that WinSPC is to process. To do this:
      1. In the Type column, select the Data option from the dropdown box.
      2. Click on the text Header Data under the Location column and enter a new Location name that the variable will reference in Data Collection. See Best Practice Tip:
      3. In the same row, single-click the Value cell.  Next select the needed Locate By options to the right and unambiguously identify the location of the variable. For more information on how to do this, see Using The Locate By Options below.  Select (or click depending on Locate By options selected) the field containing the value for this variable from the Header selection located in the Mask Data area box.
      4. Repeat this step for each remaining variable value located in the header.
  4. Masking Body readings

    1. Channel Number - If Channel Number was selected on the Connections tab and the Body contains the channel number, then use the following steps to define the Channel Number mask.
      1. Click the Body tab located the Locations area.
      2. Single-click the in the Value cell for the Channel row and using the Locate By options, to the right, to unambiguously identify the location of the channel number in the body. For more information on how to do this, see Using The Locate By Options below.
    2. Tag Information - If the reading has one or more Tag values in the body, identify the location of each body tag value that WinSPC is to process. To do this:
      1. Select the Body tab from the Locations area (if not already selected).
      2. Select Tag from the Type dropdown box from the row.
      3. Click in the Location cell and enter a name for the Tags location.  See Best Practice Tip:.
      4. Click in the Value cell and, using the Locate By options to the right to unambiguously identify the location of the tag. For more information on how to do this, see Using The Locate By Options below.
      5. Repeat this step for each remaining Tag located in the body.
    3. Variable Data - If variable data is located in the body section of the reading, then use the following steps to define the variable data:
      1. Select the Body tab from the Locations area (if not already selected).
      2. In the Type column, select Data from the dropdown box.
      3. Click on the text Body Data under the Location column and enter a new name for the location of the first variable data value in the body.  See Best Practice Tip:
      4. In the same row, single-click the Value cell and, using the Locate By options to the right to unambiguously identify the location of the variable. For more information on how to do this, see Using The Locate By Options below.
      5. Repeat this step for each remaining variable value located in the body.
  5. Once you've masked all the header and body locations that WinSPC is to process, click the Test button. This populates the Value columns on both the Header tab and Body tab with values from the reading. If any value is incorrectly populated, modify the Locate By selections for that location and retest until all values are correctly populated.
  6. To Add a new row for Tags or Variables, click the green plus sign ( + ), and a new row will be created.  Follow the above steps to set masking for the new row.
  7. To delete an existing row, select any field in the row click the red minus ( - ).  In the Confirm dialog that appears, if you are sure you want to delete the selected location, click the OK button.
  8. Click the OK button to save the device.  The text file device is now set up and collection plans can be set up to use it.

Using The Locate By Options

The Locate By options are listed in hierarchical order. This means that each option other than the first option functions within the context of any checked option above it. For example, if a location has only the Offset and Length options checked and the offset is set to 10 characters while the length is set to 4 characters, the location occupies character positions 11-14 in the reading. In many cases, it is necessary to use multiple Locate By options to unambiguously identify the location of an element (i.e. channel number, variable or tag).

  • Line: Select this option if the header or footer contains multiple lines and the element always appears on thtext device locate by.jpge same line in the header or footer. Once selected, click the line containing the element. This causes the line number to appear in the Location area to the right of the Locate By options.
  • Delimiter: Select this option if a specific character, such as a comma or semicolon, is used exclusively to separate the fields in a line and the element always occupies the same field. Once selected, enter the delimiter in the space provided and then single-click the element. This causes the field number for the element to be displayed in the Location area.  Note that the length of the fields themselves is irrelevant.  The unit of data that precedes the first delimiter in a line is field one; the unit of data that precedes the second delimiter is field two, and so on.
  • Prefix: Select this option if a specific character or set of characters consistently precedes the element; for example, the letters CH.  Once selected, enter the character(s) in the space provided. This option commonly requires another option to demarcate the end of the element.
  • Offset: Select this option if the first character of the element is always offset the same number of positions from the beginning of the reading, the beginning of a line that has been defined, a delimiter that has been defined or a prefix that has been defined. Once selected, click the first character of the element. This causes an Offset number to be populated in the Location area. If the Prefix option is selected, this Offset number indicates the  number of positions the first character of the element is offset from the end of the prefix. If the Prefix option is not selected but the Delimiter option is, this Offset number is the number of positions the first character of the element is offset from the delimiter that precedes the field. If neither the Prefix nor the Delimiter option is selected but the Line option is, this Offset number is the  number of positions the first character of the element is offset from the beginning of the defined line. If neither the Prefix option, the Delimiter option nor the Line option is selected, this Offset number is the  number of positions the first character of the element is offset from beginning of the header or footer.
  • Length: Select this option if the element is always the same number of characters long.  With this option selected, highlighting the element in the text area by clicking-and-dragging over it will capture the length and display it in the Location section. The hierarchical logic explained for the Offset option above extends to this option.

Notice that as you work with these different options, the highlighted portion of the reading in the Mask Data area changes.

*           RS-232 (Recommended Standard 232) is a series of standards for serial binary single-ended data and control signals connecting between a DTE (Data Terminal Equipment) and a DCE (Data Circuit-terminating Equipment).

Attachments
No attachments were found.
Related Articles
No related articles were found.
Visitor Comments
  1. Comment #1 (Posted by Michael Montgomery )
    Can this communicate via a RS-232 hub?
  2. Comment #2 (Posted by WinSPC Product Support )
    Michael: Yes, WinSPC can pull in data from an RS-232 hub as long as the format of the output is the same for every reading and the output can be masked using the steps outlined in this article.
  3. Comment #3 (Posted by Bill Kincaid )
    Can this work through USB and if so, how?
  4. Comment #4 (Posted by WinSPC Product Support )
    Bill: There are two methods of communication that most USB devices can employ to communicate with WinSPC. The first method is where the USB device acts as a keyboard emulator, and sends readings as if it were a keyboard. This is the simplest method because it requires no additional setup in WinSPC. The second method is where the device driver creates a virtual com port so that it can communicate like a serial device using the RS-232 protocol. With this method, WinSPC would communicate with it as a serial device, and you would follow the steps outlined in this article to set it up.
  5. Comment #5 (Posted by Donal Cronin )
    Is there any issues with setting up serial devices on Windows 10 with WinSPC 8.3. Having difficulty setting up a multiplexer connecting to a Windows 10 machine, I could send data when connected to a Windows 7 machine.
  6. Comment #6 (Posted by David I Tooker )
    When I try to get the reading the system sends WinSPC .ex error,. Why?
Post Comment for "How do I setup and use a serial device?"
To post a comment for this article, simply complete the form below. Fields marked with an asterisk are required.
   Your Name:
   Email Address:
* Your Comment:
* Enter the code below:
 

All Content ©2010-2021 DataNet Quality Systems. All Rights Reserved.