Open Serial Port


Node Information
Opens the specified Serial Port.
General Information
• This node has other options, you can view them by clicking on the info button, this also means according to the node you might be able to add more ports than what is already listed.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Open IN RUN MULTIPLE FALSE FALSE
SerialPort IN SerialPort ONE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.IO.SerialPort
{
    [IsNode("Open")]
    public class Open : Node
    {
        Port open = new Port(PortType.IN, typeof(RUN), AcceptsLinks.MULTIPLE, "Open");
        Port serial = new Port(PortType.IN, typeof(System.IO.Ports.SerialPort), AcceptsLinks.ONE, "SerialPort");
        public Open()
        {
            Name = "Open Serial Port";
            AddPort(open);
            AddPort(serial);
            OptionsAvilable = true;
            Information = "Opens the specified Serial Port.";
        }
        public override void UpdateResults()
        {
            if (!serial.IsConnected)
            {
                ErrorMessage = "No Serial Port is connected.";
                Status = NodeStatus.ERROR;
            }
            else
            {
                Status = NodeStatus.OK;
            }
            open.Instructions = GetValue(serial) + ".Open();";
        }
    }
}