Tajima Serial Connection Windows

Registration

-->

The Windows.Devices.SerialCommunication namespace defines Windows Runtime classes that a UWP app can use to communicate with a device that exposes a serial port or some abstraction of a serial port. The classes provide functionality to discover such serial device, read and write data, and control serial-specific properties for flow control, such as setting baud rate, signal states.

Download PuTTY. PuTTY is an SSH and telnet client, developed originally by Simon Tatham for the Windows platform. PuTTY is open source software that is available with source code and is developed and supported by a group of volunteers.

The namespace also supports devices that belong to the USB CDC device class. This includes ports exposed by Serial-to-USB adapters and internal USB to serial bridge chips like those used in Arduino Uno R3s. See note below on compatible IDs.

System-internal or on-chassis serial ports may be enumerated by DeviceInformation.FindAllAsync(), but cannot be opened by SerialDevice.FromIdAsync() because they currently are not supported. However, serial ports connected over USB, such as on USB-to-Serial cables are supported.

It is possible that the DeviceInformation collection returned by DeviceInformation.FindAllAsync() may have a serial device whose DeviceInformation.Name property is set to the machine name. This is by design and may occur when enumerating an on-board serial port. Apps should handle this case by either:

  • Filtering such serial ports from the user's view, so that the user will not be able to interact with such an unsupported serial port at all.
  • If the app decides to let the user interact with such a serial port, then note that when the app calls the DeviceAccessInformation.CreateFromId() function, an exception with the message: 'The system cannot find the file specified. (Exception from HRESULT: 0x80070002)' will be thrown. The app should handle such an exception and let the user know that the port is unsupported.

Serial devices that use the following compatible IDs can be supported by the in-box Windows 10 usbser.sys driver; these are automatically supported by Windows.Devices.SerialCommunication. In addition, USB serial devices that use other compatible IDs are supported through a vendor-supplied driver.

  • USBClass_02&SubClass_02&Prot_01
  • USBClass_02&SubClass_02

Serial device capability usage

Your UWP app must include certain device capabilities in its App package manifest. The capabilities identify the device and its purpose. Here are the required elements in hierarchical order:

  • <DeviceCapability>: The Name attribute must be 'serialcommunication'.

    • <Device>: The Id attribute must specify the device identifier. If you are using a Serial-to-USB adapter, Id must specify vendor/product identifiers or can be 'any' to allow access to any device that matches the function type.

      • <Function>: The Type attribute specifies the device function. For serial devices this must be 'serialPort'.

Serial device capability example

Here is an example for defining serial device capabilities. It allows the app to access the serial port through a Serial-to-USB adapter.

Bilton

Classes

ErrorReceivedEventArgsErrorReceivedEventArgsErrorReceivedEventArgsErrorReceivedEventArgsErrorReceivedEventArgs

Represents the object that is passed as a parameter to the event handler that is invoked when error occurs on the serial port.

PinChangedEventArgsPinChangedEventArgsPinChangedEventArgsPinChangedEventArgsPinChangedEventArgs

Represents the object that is passed as a parameter to the event handler that is invoked when the state of a signal line changes on the serial port.

SerialDeviceSerialDeviceSerialDeviceSerialDeviceSerialDevice

Represents a serial port. The object provides methods and properties that an app can use to find the port (in the system).

Enums

SerialErrorSerialErrorSerialErrorSerialErrorSerialError

Defines values for error conditions that can occur on the serial port.

SerialHandshakeSerialHandshakeSerialHandshakeSerialHandshakeSerialHandshake

Defines values for hardware and software flow control protocols used in serial communication. The values are used by Handshake property on the SerialDevice object.

SerialParitySerialParitySerialParitySerialParitySerialParity

Defines values for the parity bit for the serial data transmission. The values are used by the Parity property on the SerialDevice object.

SerialPinChangeSerialPinChangeSerialPinChangeSerialPinChangeSerialPinChange

Defines values for types of signal state changes on the serial port.

SerialStopBitCountSerialStopBitCountSerialStopBitCountSerialStopBitCountSerialStopBitCount

Defines values that indicate the number of stop bits used in a transmission. The values are used by the StopBits property on the SerialDevice object.

See also

This is a demonstration of the wireless stick on a Tajima graphical control panel.
You can see back here, there is a wireless stick plugged into it, there is an USB port in the back and this stick pretends to be an USB stick and it plugs into any USB port, now this is a supposed to be a convenience device it is something that you plug into your machine and it will connect wirelessly to one of your windows computer if you have a machine normally you’d have a brunch of USB sticks and if you have to change the file once per hour or once every half hour or you’re continually and putting sticks in taking them out your sticks are sometimes damaging or blowing up for whatever reason little USB stick stopped working it’s a pain for your operators it’s a little stressful on the mechanicals of your machine so the idea behind this is that you would just plug it in and leave it there permanently let me plug it back in here there is a demonstration windows computer it`s a little Windows tablet it’s about the same as an ordinary computer it has a folder on it which is shared here’s my shared folder et me open this minimized that and there we go and right now there is one file on this shared folder and it’s called fish let’s check the USB stick now there is an estry for USB on the model and it set and he read the stick and there’s one file on there called fish okay let’s make a team so whenever you change the file on here the lights will blink too so there is a biotransfer so let me drag another file here into this ordinary shared folder the lights are blinking here back here exit and let’s load it again and there you go there are now two files here fish and G Zero Zero Five which is the file we dragged in there and okay let’s do that again drag that like that drag that they’re all in the shared folder now and what the life would have been blinking you probably missed it let’s reload it and there you go you have a bunch of files on here let me take all of them out if the point of this is that you can keep on loading and unloading all day so they are all out and give it a second I should show you the linking look at it again and it is all empty I dragged everything out of all the Tajima files and it has in a short order.