Main Content

Lamp

ランプでの信号値を反映した色の表示

  • Lamp block

ライブラリ:
Simulink / Dashboard

説明

Lamp ブロックは、接続している信号の値を示す色を表示します。シミュレーション中に必要な情報を示すように Lamp ブロックを設定するには、信号値と Lamp ブロックが表示する色を組み合わせた 1 つ以上の状態を指定します。Lamp ブロックをその他の Dashboard ブロックと共に使用し、モデル用にコントロールおよびインジケーターの対話型のダッシュボードを作成できます。

ランプ アイコン

いずれか 1 つの組み込みアイコンを選択するか、独自のカスタム アイコンをアップロードすることで、Lamp ブロックの外観を変更できます。組み込みアイコンには、基本的な形状、自動車関連のインジケーター ランプ、ワイヤレスのアイコンが含まれます。[アイコン] パラメーターを使用するか、ツールストリップ内のブロック タブを使用することで、Lamp ブロックのアイコンを変更できます。Dashboard ライブラリには、各アイコンに対してあらかじめ構成されたバージョンの Lamp ブロックをもつライブラリも含まれています。詳細については、アイコンを参照してください。

Lamp Icon drop-down menu showing basic shape icons, automotive indicator lamps, wireless icons, and the option to choose a custom icon

アイコンを選択するだけでなく Lamp ブロックの外観をカスタマイズする場合は、Customizable Blocks ライブラリの Lamp ブロックを使用して独自のインジケーター ランプを設計することを検討してください。

Dashboard ブロックの接続

Dashboard ブロックはモデル要素への接続に端子を使用しません。Dashboard ブロックを接続するには、接続モードを使用します。接続されていないブロックで接続モードに切り替えるには、接続するブロックをポイントし、[接続] ボタン をクリックします。接続されているブロックで接続モードに切り替えるには、ブロックを選択すると表示される省略記号 (…) をポイントし、展開されるアクション メニューで [接続] ボタンをクリックします。

Display ブロックをモデル内の信号に接続したり Display ブロックの接続を変更したりするには、接続モードに切り替えます。接続する信号線を選択します。表示されるリストから、接続する信号を選択します。次に、Dashboard ブロックをポイントし、[接続完了] ボタン をクリックします。接続されたブロックの値を Dashboard ブロックに表示するには、シミュレーションを実行します。

Dashboard ブロックの接続の詳細については、Connect Dashboard Blocks to Simulink Modelを参照してください。

Dashboard ブロックは Stateflow® チャートにも接続できます。詳細については、Dashboard ブロックと Stateflow との接続 (Stateflow)を参照してください。

次のアニメーションは、Lamp ブロックをモデルに接続する方法を示しています。

An unconnected Lamp block connects to the signal that a Ramp block sends to a Terminator block.

すべて展開する

Lamp ブロックを使用して、接続されている信号の値を示すことができます。たとえば、モデル lampStep には、時間 3 に値を 0 から 1 に変更する Step ブロックが含まれています。Step ブロックからの出力信号 StepSig が Lamp ブロックに接続されています。

The Block Parameter dialog box for the Lamp block

モデルのシミュレーションを実行します。StepSig の値が 0 の場合、ランプは緑色になります。StepSig の値が 1 の場合、ランプは青色になります。

Animation of the lampStep model during simulation

制限

  • Dashboard Scope ブロックおよび Display ブロックを除き、Dashboard ブロックは実数のスカラー信号にのみ接続できます。

  • コメントアウトされたブロックには、ブロック ダイアログの [接続] テーブルを使用して Dashboard ブロックを接続することはできません。コメント化されたブロックに接続モードを使用して Dashboard ブロックを接続した場合、ブロックのコメントを解除するまでは Dashboard ブロックに接続された値が表示されません。

  • Dashboard ブロックは参照モデル内のモデル要素には接続できません。

  • モデルの階層構造をシミュレーションすると、参照モデル内の Dashboard ブロックで更新は実行されません。

  • Dashboard ブロックは、ラピッド アクセラレータ シミュレーションをサポートしていません。

  • シミュレーション中に Stateflow のチャート データやステート アクティビティに Dashboard ブロックを接続することはできません。

  • プログラムで Stateflow のチャート データやステート アクティビティに Dashboard ブロックを接続することはできません。

  • アクセラレータ モード シミュレーションのためのブロックの削減または最適化により、一部の信号にはシミュレーションで使用できるデータが含まれないことがあります。Dashboard ブロックを使用してこのような信号を表示するには、信号をログ記録用にマークします。

パラメーター

すべて展開する

Dashboard ブロックはモデル要素への接続に端子を使用しません。モデル内のパラメーター値に Dashboard ブロックを接続するには、接続モード、Simulink® ツールストリップ、または [ブロック パラメーター] ダイアログ ボックスの [接続] テーブルを使用します。接続モードの詳細とツールストリップを使用した接続方法の詳細については、Connect Dashboard Blocks to Simulink Modelを参照してください。

[接続] テーブルを使用して Display ブロックを接続したり Display ブロックの接続を変更したりするには、次のようにします。

  1. ブロックを選択します。

  2. ブロックを接続するには、プロパティ インスペクターの [パラメーター] タブで [接続] をクリックします。ブロックの接続を変更するには、代わりに [変更] をクリックします。

  3. 接続する信号線を選択します。

  4. テーブルで接続する信号を選択します。

  5. [適用] をクリックします。

Dashboard ブロックは Stateflow チャートにも接続できます。詳細については、Dashboard ブロックと Stateflow との接続 (Stateflow)を参照してください。

プログラムでの使用

ブロック パラメーター: Binding
型: Simulink.HMI.SignalSpecification
既定の設定: []

状態によって、表示色と接続している信号の値が一致します。各状態は、[状態] および [色] から構成されます。

  • 状態Lamp ブロックに指定した色を表示させる、接続している信号の値。

  • — 接続している信号の値が対応する [状態] の値に一致する場合のランプの色。標準色のパレットから選択するか、RGB 値でカスタムの色を指定できます。

[undefined] の状態は、接続している信号の値が [状態] テーブルで指定されたどの値にも一致しない場合の Lamp ブロックの色を指定します。[+] ボタンをクリックして、別の状態を追加します。

プログラムでの使用

Lamp ブロックの StateColor のパラメーターの値をプログラムで指定するには、次のフィールドを含む構造体の配列を使用します。

  • ValueLamp ブロックに指定した色を表示させる、スカラー double 信号値。

  • ColorLamp ブロックが表示する色を指定する 01 の間の値をもつ 13 列の [r g b] ベクトル。

lampState1.Value = 1;
lampState1.Color = [0 0 1];
lampState2.Value = 2;
lampState2.Color = [1 0 0];
lampStates = [lampState1 lampState2];
ブロック パラメーター: StateColors
型: 構造体配列
既定の設定: 構造体

ColorDefault パラメーターは、接続している信号の値が指定された状態のどの値にも一致しない場合の Lamp ブロックの色を指定します。ColorDefault パラメーターを値が 0 から 1 の間の、13 列の [r g b] ベクトルとして指定します。

ブロック パラメーター: ColorDefault
型: [r g b] ベクトル
既定の設定: [0.7529 0.7529 0.7529]

アイコンを使用して、モデル内での Lamp ブロックの外観を設定します。形状、自動車関連、ワイヤレスの組み込みアイコンから選択できます。または、独自のカスタム SVG ファイルをアイコンとしてアップロードできます。

アイコン オプションを表示するには、[アイコン] タブで [Icon Type] を選択します。独自の SVG ファイルをブロック アイコンとして使用するには、[カスタム][Icon Type] として選択し、SVG ファイルをアップロードします。Lamp ブロックの状態を示す色は次の SVG 要素に適用できます。

  • altGlyph

  • circle

  • ellipse

  • path

  • polygon

  • rect

  • text

  • textPath

  • tref

  • tspan

形状アイコン

アイコン基本形状のライブラリ ブロック名プログラムで使用する値

Lamp icon: a solid gray circle

LampDefault

Circle icon: a solid black circle

CircleCircle

Hexagon icon: a solid hexagon

HexagonHexagon

Pentagon icon: a solid pentagon

PentagonPentagon

Rectangle icon: a solid rectangle

RectangleRectangle

Square icon: a solid square

SquareSquare

Triangle icon: a solid triangle

TriangleTriangle

Check1 icon: a check mark

Check1Check1

Check2 icon: a check mark with slightly curved lines

Check2Check2

Check3 icon: the outline of a check mark

Check3Check3

Check4 icon: a check mark with a divot along its outline

Check4Check4

Ex1 icon: a cross mark

Ex1Ex1

Ex2 icon: a cross mark with one curved line

Ex2Ex2

Ex3 icon: the outline of a cross mark

Ex3Ex3

Ex4 icon: a cross mark with a divot along the outline

Ex4Ex4

Face icon: the outline of a face with a closed mouth in a straight line

FaceFace

Frown1 icon: the outline of a face with an open downturned mouth

Frown1Frown1

Frown2 icon: the outline of a face with a closed downturned mouth

Frown2Frown2

Smile1 icon: the outline of a face with an open upturned mouth

Smile1Smile1

Smile2 icon: the outline of a face with a closed upturned mouth

Smile2Smile2

Solid Face icon: a solid face with a closed mouth in a straight line

Solid FaceSolidFace

Solid Frown1 icon: a solid face with an open downturned mouth

Solid Frown1SolidFrown1

Solid Frown2 icon: a closed downturned mouth

Solid Frown2SolidFrown2

Solid Smile1 icon: a solid face with an open upturned mouth

Solid Smile1SolidSmile1

Solid Smile2 icon: a solid face with a closed upturned mouth

Solid Smile2SolidSmile2

自動車関連アイコン

アイコン自動車関連のインジケーター ランプのライブラリ ブロック名プログラムで使用する値

Adaptive Cruise Control icon: a speedometer with an arrow pointing to a tick mark and the silhouette of a car in the background

Adaptive Cruise ControlAdaptiveCruiseControl

Adaptive Cruise Control Failure icon: a speedometer with an exclamation mark next to it and the silhouette of a car in the background

Adaptive Cruise Control FailureAdaptiveCruiseControlFailure

Anti-Lock Brake System icon: a circle labeled "ABS" in a set of parentheses

Antilock Brake SystemAntilockBrakeSystem

Battery icon: the outline of a battery with a plus symbol on the positive pole, and a negative symbol on the negative pole

BatteryBattery

Check Engine icon: the outline of an engine labeled "Check Engine"

Check EngineCheckEngine

Check Engine2 icon: the outline of an engine with the silhouette of a lightning rod on it and the word "CHECK" underneath it

Check Engine2CheckEngine2

Cruise Control icon: a speedometer with an arrow pointing to one of the tick marks

Cruise ControlCruiseControl

Eco Mode icon: a solid leaf shape labeled "ECO"

Eco ModeEcoMode

Electronic Stability icon: a circle labeled "ESP" in a set of parentheses

Electronic StabilityElectronicStability

Engine icon: the silhouette of an engine

EngineEngine

Engine Coolant Temp icon: a thermometer with waves in the background

Engine Coolant TempEngineCoolantTemp

Engine Failure icon: the silhouette of an engine with an exclamation mark on it

Engine FailureEngineFailure

Engine Heating icon: the silhouette of an engine with three wavy arrows pointing upwards on it

Engine HeatingEngineHeating

Engine Oil icon: the silhouette of an oil can

Engine OilEngineOil

Exterior Bulb Failure icon: the silhouette of a glowing light bulb with an exclamation mark on it

Exterior Bulb FailureExteriorBulbFailure

Front Fog Light icon: the outline of a fog light lamp emitting rays of light to the left that are depicted as diagonal lines on top of a wavy vertical line that represents the fog

Front Fog LightFrontFogLight

Fuel icon: the silhouette of a gas pump with an arrow pointing left on it

FuelFuel

Hazards icon: the outline of a warning triangle

HazardsHazards

Headlamp Leveling icon: the outline of a lamp emitting rays of light with an arrow pointing clockwise above them and an arrow pointing counterclockwise below them

Headlamp LevelingHeadlampLeveling

High Beams icon: the outline of a lamp emitting horizontal rays of light

High BeamsHighBeams

Hill Descent Control icon: the outline of a car driving down a slope

Hill Descent ControlHillDescentControl

Lighting Switch icon: the silhouette of a glowing light bulb

Lighting SwitchLightingSwitch

High Beams icon: the outline of a lamp emitting rays of light that run diagonally downward

Low BeamsLowBeams

Parking Assistance icon: the letter "P" next to a solid triangle, and the "P" emits a detection signal represented as three curved lines aimed at the triangle

Parking AssistanceParkingAssistance

Rear Fog Light icon: the outline of a fog light lamp emitting rays of light to the right that are depicted as horizontal lines on top of a wavy vertical line that represents the fog

Rear Fog LightRearFogLight

Side Lights icon: the outline two lamps emitting rays of light to the left and right

Side LightsSideLights

Stability Control icon: the silhouette of a car with wavy lines behind it

Stability ControlStabilityControl

Stability Control Off icon: the silhouette of a car with wavy lines behind it and the word "OFF" underneath

Stability Control OffStabilityControlOff

Tire Monitor icon: the outline of the cross-section of a tire with an exclamation mark on it

Tire MonitorTireMonitor

Traction Control icon: the outline of the cross-section of a tire with the label "TC"

Traction ControlTractionControl

Traction Control Off icon: the outline of the cross-section of a tire with the label "TC" and a diagonal slash through the whole image

Traction Control OffTractionControlOff

Traction Control Failure icon: the outline of the cross-section of a tire with the label "TC" and an exclamation mark next to it

Traction Control FailureTractionControlFailure

Turn Signal Left icon: a solid arrow pointing left

Turn Signal LeftTurnSignalLeft

Turn Signal Right icon: a solid arrow pointing right

Turn Signal RightTurnSignalRight

ワイヤレス アイコン

アイコンアイコン名プログラムで使用する値

Network icon: the wireless internet connection icon

NetworkNetwork

Network No Signal icon: the wireless internet connection icon grayed out,with a crossed-out circle next to it

Network No SignalNetworkNoSignal

Network Transmission icon: a wireless internet tower

Network TransmissionNetworkTransmission

Network3G icon: the wireless internet connection icon with "3G" next to it

Network3GNetwork3G

Network4G icon: the wireless internet connection icon with "4G" next to it

Network4GNetwork4G

Network5G icon: the wireless internet connection icon with "4G" next to it

Network5GNetwork5G

ヒント

  • ツールストリップ内のブロック タブを使用して、Lamp ブロックのアイコンを変更できます。

  • Dashboard ライブラリには、各アイコンに対してあらかじめ構成された Lamp ブロックをもつライブラリがあります。

  • アイコンを選択するだけでなく Lamp ブロックの外観をカスタマイズする場合は、Customizable Blocks ライブラリの Lamp ブロックを使用して独自のインジケーター ランプを設計することを検討してください。

プログラムでの使用

ブロック パラメーター: Icon
型: string | 文字ベクトル
既定の設定: 'Default'

ブロック ラベルの位置。ブロックがモデル内の要素に接続されている場合、ラベルは接続された要素の名前です。

プログラムでの使用

ブロック パラメーター: LabelPosition
型: 文字ベクトル
値: 'Top' | 'Bottom' | 'Hide'
既定の設定: 'Top'

ブロックの不透明度。0 ~ 1 のスカラー値として指定します。

例: 0.5

プログラムでの使用

ブロック パラメーター: Opacity
タイプ: スカラー
既定の設定: 1

ブロックの特性

データ型

Boolean | double | enumerated | fixed point | half | integer | single

直達

いいえ

多次元信号

いいえ

可変サイズの信号

いいえ

ゼロクロッシング検出

いいえ

拡張機能

バージョン履歴

R2015a で導入