How to: Use Serial Device DirectIO

The Direct IO method is available via WebAPI. This is done by sending an HTTP request to the Hardware Station.

We recommend using an API testing tool like Postman when testing and setting up WebAPI requests.

Direct IO

You can use the DirectIO function to interact with a scanner or any device connected to a serial port (not OPOS). You can also use the function for any customized functionality that needs to use a DLL or a 3rd party functionality that cannot be implemented in LS Central. The customized serial device does not have to communicate with an actual device, but can do anything that can be implemented in C#.

The URL for the request is structured like this:

  • {http(s)}://{hotstname}:{port}/api/serialdevice/{serialDeviceID}/directIO

Note: Replace the value in the curly brackets with your own parameters.

DirectIO takes a JSON object in the body of the request in the same form as the SignalR version does as parameters. The object is formatted like this:

{

Command: int,

Data: int,

DataString: string,

}

DirectIO also returns a JSON object in the body of the response. The object is formatted like this:

{

Data: int,

DataString: string,

}