Brainboxes.IO 1.5.0.2

Official .NET API code package for communication with Brainboxes Ethernet-attached data acquisition and control devices, and is provided by Brainboxes Limited.
Design for Brainboxes Digital and Analog Remote IO and Ethernet to Serial devices including: ED-588, ED-516, ED-527, ES-246, ES-257 and the rest of the Brainboxes ED and ES range.
Targets .NET 4.0+ and Universal Windows Platform (UWP)
This means this package can run on Windows XP,7,8,10 and Server 2008, 2012, 2016 using .NET framework
Can also run on Windows IoT Core and XBOX using Universal Windows Platform
Can run on linux, raspbian or OSX using Mono framework or .NET Core

There is a newer version of this package available.
See the version list below for details.
Install-Package Brainboxes.IO -Version 1.5.0.2
dotnet add package Brainboxes.IO --version 1.5.0.2
<PackageReference Include="Brainboxes.IO" Version="1.5.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Brainboxes.IO --version 1.5.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
        //The following factory method will connect to any brainboxes ED device
        //and return the correct object instance for the device
        //The create method automatically open a connection to the device
        using (EDDevice ed = EDDevice.Create("192.168.0.158") )
        {
            ed.Label = "Pump Control in Cabinet 3"; //give it a label, useful for debugging

            //first 3 inputs are connected to button switches
            IOList<IOLine> buttons = ed.Inputs.Take(3).AsIOList();
            buttons.Label = "Console Buttons"; //optionally label group, useful for debugging
            
            //first 3 outputs are connected to lights
            IOList<IOLine> lights = ed.Outputs.Take(3).AsIOList();

            //attach event handler to falling edge of all buttons
            //when the button is turned on the corresponding light will come on
            buttons.IOLineFallingEdge += (line, device, changeType) => 
            { 
                Console.WriteLine("Button " + line.IONumber + " Pressed"); 
                lights[line.IONumber].Value = 1; //turn on light
            };

            //attach event handler to rising edge of all buttons
            //when the button is released the corresponding light will turn off
            buttons.IOLineRisingEdge += (line, device, changeType) =>
            {
                Console.WriteLine("Button " + line.IONumber + " Released");
                lights[line.IONumber].Value = 0; //turn off light
            };

            //initialise all lights off
            lights.Values = 0;

            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();

            //close connections after a key press, automatic disconnect and dispose outside of using block
        }
        //The following factory method will connect to any brainboxes ED device
        //and return the correct object instance for the device
        //The create method automatically open a connection to the device
        using (EDDevice ed = EDDevice.Create("192.168.0.158") )
        {
            ed.Label = "Pump Control in Cabinet 3"; //give it a label, useful for debugging

            //first 3 inputs are connected to button switches
            IOList<IOLine> buttons = ed.Inputs.Take(3).AsIOList();
            buttons.Label = "Console Buttons"; //optionally label group, useful for debugging
            
            //first 3 outputs are connected to lights
            IOList<IOLine> lights = ed.Outputs.Take(3).AsIOList();

            //attach event handler to falling edge of all buttons
            //when the button is turned on the corresponding light will come on
            buttons.IOLineFallingEdge += (line, device, changeType) => 
            { 
                Console.WriteLine("Button " + line.IONumber + " Pressed"); 
                lights[line.IONumber].Value = 1; //turn on light
            };

            //attach event handler to rising edge of all buttons
            //when the button is released the corresponding light will turn off
            buttons.IOLineRisingEdge += (line, device, changeType) =>
            {
                Console.WriteLine("Button " + line.IONumber + " Released");
                lights[line.IONumber].Value = 0; //turn off light
            };

            //initialise all lights off
            lights.Values = 0;

            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();

            //close connections after a key press, automatic disconnect and dispose outside of using block
        }

Release Notes

1.5.0.2 30/11/17
*Updated analog event handler to support a list of IOList objects
1.5.0.1 23/09/16
* Added support for .NET Core and .NET Standard
* Fixed bug with ED-549 event handling
1.5.0.0 15/09/16
* Added analog functionality including events for support for ED-549 (ASCII only) and ED-560 (ASCII and Modbus)
* Changed handling of isAvailble, now only checks for isAvailable if isConnected is false
* Changed handling of isConnected, is now locked so multiple threads cannot access this so it does not send multiple pings
* Fixed bug with deviceStatusChangedEvent
1.4.0.1 09/07/16
* Added Universal windows platform dll's to allow compatibility with Windows IoT Core, Windows Store and XBOX
* First official release to coincide with RS DesignSpark Youtube video demo of Brainboxes API's running on Windows IoT Core and Raspberry Pi 3
1.2.4.0 28/10/15
* Bug with ED-527 event handling reported by Frank Guchelaar and fixed
1.2.1.0 20/09/15
* Nuget release Ethernet to Serial devices with many stability and performance fixes
1.2.0.0 21/04/15
* Initial Nuget release to include Ethernet to serial
1.1.12.0 07/09/15
* Improved handling of IsAvailable for when a route to the device cannot be found, improved handling of IsConnected to determine if the connection is still open
1.1.11.0 28/08/15
* Corrected ISerialProtocol to implement IClonable so that assigning a protocol to a multiport product was handled correctly
1.1.9.0 02/03/15 - beta
* Added IsAvailable property to Device and Connection and a call back to be notified on change of device status
* Added factory method to Connection (Connection.Create)
* Change constructor for TCPConnection to include ConnectionTimeout parameter
1.0.5.0 22/12/14
* Added counter functionality to API for IOLines and change handlers
1.0.4.0
* Changed handling of network and serial streams, by wrapping them into a BBStream to make them work in a consistent way, stream is now flushed before every sendcommand
* Fixed issue with Timeout not being correctly set
* Fixed FactoryRest and Restart command

  • .NETCoreApp 2.0

    • No dependencies.
  • .NETFramework 2.0

    • No dependencies.
  • .NETFramework 4.0

    • No dependencies.
  • .NETFramework 4.5

    • No dependencies.
  • .NETStandard 1.4

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.
  • UAP 10.0

    • No dependencies.

Version History

Version Downloads Last updated
1.5.0.7 143 3/16/2019
1.5.0.6 348 9/21/2018
1.5.0.5 494 1/25/2018
1.5.0.4 299 12/14/2017
1.5.0.3 239 12/14/2017
1.5.0.2 246 12/6/2017
1.5.0.1 1,353 9/23/2017
1.5.0 204 9/15/2017
1.4.0.1 643 7/9/2016
1.2.4 535 10/28/2015
1.2.1 359 9/20/2015
1.2.0 443 4/21/2015
1.1.0 540 12/23/2014
1.0.5 469 12/22/2014
1.0.4 437 12/3/2014
Show less