Learn how to use the HAL Robotics Framework.

• documentation home
• decode
• Grasshopper SDK

• back to main site
• issues and bugs

4. IO

4.1. Create a Signal

4.2. Change a Signal State


4.1. Create a Signal

Objective:

In this tutorial we’ll create a Signal that can be programmed in the HAL Robotics Framework for Grasshopper.

Demo Files:

Create a Signal.gh

Requirements to follow along:

Background:

Electrical Input and Output (I/O) Signals are used to activate or deactivate Tools, trigger actions on remote machines or pass data between Sensors.

How to:

We can start creating a Signal by navigating to the HAL Robotics tab, Cell panel and selecting Create Signal. The templates of this component change between digital and analogue Signals, whilst the overloads switch between inputs or outputs. The only compulsory input on the component is the Alias which should exactly match the value assigned in your real Controller. If your Controller handles aliases then that could be something like DO_01 but if your controller only handle indices then this Alias could simply be 2. You can also change the High and Low voltage states of your Signal if you so wish or need. Once the Signal has been created, we can assign it to our Controller by dragging the Signal output to the Controller’s Signal input.


4.2. Change a Signal State

Objective:

In this tutorial we’ll change the state of a Signal at runtime in the HAL Robotics Framework for Grasshopper.

Demo Files:

Change a Signal State.gh

Requirements to follow along:

Background:

Electrical Input and Output (I/O) Signals are used to activate or deactivate Tools, trigger actions on remote machines or pass data between Sensors. The activation of these Signals needs to be triggered at the right time during program execution, something we can do easily with Signal Actions.

How to:

In our previous tutorial, we created a digital output Signal, assigned it an appropriate Alias and hooked it up to a Controller. We now want to change the state of that Signal during the execution of a Procedure. To do so we’re going to get the Change Signal State component from the HAL Robotics tab, Procedure panel. Just like the Create Signal component we can change between digital and analogue with component templates and swap between input or output by changing overloads. We can assign our previously created Signal to the component’s Signal input and choose what effect we want to have on the Signal by right-clicking on the Effect input. In this scenario we’re going to Set the state. As we’re setting the state, we need to pass in a State which, for a digital signal, is a Boolean value where true is equivalent to High and false is equivalent to Low. The output of this component is an Action which can be merged into any other sequence of Actions you may have. Once that’s merged, we can see in the Procedure Browser that we have some Motion, our Set DO_01 to high Action and then some more Motion to finish off the Procedure.


Continue to: 5. Advanced Programming