PTC provided SySim control blocks (SySim)
The SySim profile includes SySim Control Blocks that are generated as input and output .NET controls that you can use in your SySim model execution.
The PTC provided SySim Control Blocks are located in the SySim Profile::SySim ControlLibrary package. The names of the SysML Ports on the provided SySim Control Blocks must not be changed.
You may need to set properties of the generated Visual Basic control. For each control, properties of particular interest are mentioned.
You can create your own SySim Control Block that are based on the PTC provided SySim Control Blocks. Alternatively, you can create controls that use Visual Basic base classes, such as a TextBox for displaying text values. See
Creating your own SySim control blocks to model controls and behavior (SySim)
The following SySim Control Blocks are provided.
Graph
The Graph SySim Control Block appears as a plotter graph in a SySim model execution, which you can use for displaying data in a graph format.
To display data on the graph, the value must be sent to its Inp input port. The type of the Inp input port is Decimal.
The Speed Controller example model demonstrates how to create a custom SySim Control Block based on the Graph SySim Control Block that can display four input values simultaneously.
The following properties of the generated Visual Basic control are of interest:
• Lines - specifies the lines that appear on the graph.
After generating the graph, in Visual Basic you must add the lines you want to display to the graph: Select the Lines property, and then click the button in the value column. For each line you want to display, click Add and set the LineName property of that line to that of the associated SysML Port in Modeler.
• MaxLabel - specifies the label for the maximum value of the graph.
• MaxPeekMagnitude - specifies the maximum value of the graph.
• MinLabel - specifies the label for the minimum value of the graph.
• MinPeekMagnitude - specifies the minimum value of the graph.
Knob
The Knob SySim Control Block appears as a mechanical knob in a SySim model execution, which you can use for setting analogue output values.
To use the value that is set by the Knob, the value must be read from its Outp output port. The type of the Out output port is Decimal.
The following properties of the generated Visual Basic control are of interest:
• MaxValue - specifies the maximum value that is output by the knob.
• MinValue - specifies the minimum value that is output by the knob.
• StepValue - specifies the increase in value that is made by each step of the knob.
• Value - specifies the output value of the knob, as set through the Outp output port.
LedBulb
The LedBulb SySim Control Block appears as an LED bulb in a SySim model execution.
To illuminate the LED bulb, True must be sent to its Inp input port. Sending False extinguishes it. The type of the Inp input port is Boolean.
The following properties of the generated Visual Basic control are of interest:
• Color - can be used to set the color of the LED bulb.
• On - specifies whether the LED bulb is illuminated or not, as set through the Inp input port.
LedDisplay
The LedDisplay SySim Control Block appears as an LED display that can display text strings as scrolling text in a SySim model execution, which you can use to display output text.
Important:The LED display does not display lowercase letters; lowercase letters will appear as spaces in the LED display.
To display text on the LEDDisplay, the value must be sent to its Inp input port. The type of the Inp input port is String.
The following properties of the generated Visual Basic control are of interest:
• BackColor - specifies the background color of the LED display.
• ForeColor - specifies the text color of the LED display.
• Scroll - specifies whether the displayed text scrolls.
• Text - specifies the text that is displayed in the LED display, as set through the Inp input port.
Meter
The Meter SySim Control Block appears as a mechanical meter in a SySim model execution, which you can use to display output values.
To display a value on the Meter, the value must be sent to its Inp input port. The type of the Inp input port is Decimal.
The following properties of the generated Visual Basic control are of interest:
• Min Value - specifies the minimum value for the meter.
• Max Value - specifies the maximum value for the meter.
• ScaleDivisions - specifies the number of primary divisions.
• ScaleSubDivisions - specifies the number of divisions between primary divisions.
• Value - specifies the value that is displayed by the Meter, as set through the Inp input port.
NumericSlider
The NumericSlider SySim Control Block appears as a mechanical slider in a SySim model execution, which you can use to set input values.
To read the value that is set by the NumericSlider, the value must be read from its Outp output port. The type of the Outp output port is Decimal.
The following properties of the generated Visual Basic control are of interest:
• Maximum - specifies the maximum value that is output by the slider.
• Minimum - specifies the minimum value that is output by the slider.
• Orientation - specifies whether the slider is horizontal or vertical.
• Value - specifies the output value of the mechanical slider, as set through the Outp output port.
PushButton
The PushButton SySim Control Block appears as a push button in a SySim model execution, which you can use to set a Boolean value while the mouse button is pressed down.
To read the value that is set by the push button, the value must be read from its Outp output port. The type of the Outp output port is Boolean.
Because the value of the Outp output port is set to True only while the mouse button is pressed, you need to capture the event. In the Traffic Lights - SySim example model, you can see how this is captured on the 'SySim Custom Controls::Controller.Controller.Controller' State Diagram. The Running state has an Event Action Block that is triggered when its InputFromButton port (connected to the Push Button) is set to True, this Event Action Block then sets the ped_wait variable to True to record that the push button has been pressed.
The following properties of the generated Visual Basic control are of interest:
• State - specifies whether the push button is pressed or not.
SevenSegmentDisplay
The SevenSegmentDisplay SySim Control Block appears as a seven segment display in a SySim model execution, which you can use to display numeric values.
To display a value, the value must be sent to its Inp input port. The type of the Inp input port is Decimal.
The following properties of the generated Visual Basic control are of interest:
• ArrayCount - specifies how many digits are displayed.
• ColorBackground - specifies the background color of the display.
• ColorLight - specifies the color of the digits.
• DecimalShow - specifies whether a decimal point is shown on the display.
• Value - specifies the value that is displayed in the display, as set through the Inp input port.
Switch
The Switch SySim Control Block appears as a mechanical switch in a SySim model execution, which you can use for setting a Boolean value.
To read the value that is set by the switch, the value must be read from its Outp output port. The type of the Outp output port is Boolean.
The following properties of the generated Visual Basic control are of interest:
• State - specifies whether the switch is on or off, as set through the Inp Input port.
Parent topic