白紙からBlinkプログラムを作って、Arduinoのように電源を入れたらBlinkが動き出すようにしたいですね。

Raspberry Piで動かすLabVIEWプログラムは「リアルタイムアプリケーション」と呼ばれているもので、PC上のLabVIEW開発環境下でVIを実行しているのとは少し違います。
まず、ファイルメニューからプロジェクトを作ります。

名前がついていないプロジェクトのプロジェクトエクスプローラーが開きます。

名前を付けて保存します。ここでは”rpi_blink.lvproj”としました。

My ComputerというのがLabVIEW CommunityをインストールしたPCのことです。Raspberry Piを追加しましょう。プロジェクトエクスプローラーの一番上のプロジェクト名を右クリックして、New >> Target and Devices..を選択しましょう。一連のスクリーンショットのように”Target Configuration”で作成したRaspberry Piが見つかるだろうと思います。





ここまで大丈夫だったでしょうか。うまく見つけてもらえない時にはTarget Device "Raspberry Pi"を右クリックして、プロパティを開きIPアドレスを入力することもできます。
Target Device "Raspberry Pi"にVIを作成し、my_blink.viという名前で保存します。


my_blink.viという名前で保存します。Filesタブを見ると保存されている場所を確認することができます。

Example.viのようにVIを作成します。
Arduinoと異なるのは"open.vi"です。


これで、Exampleと同じVIを作ることができたと思います。実行ボタンを押すとVIがRaspberry Piに配置されて、実行されます。プロジェクトエクスプローラーのターゲットraspberrypiにマウスカーソルをのせるとHelpウィンドウに「Raspberry piの中のリアルタイムOSで動いている」との説明書きが表示されます。

このままではPCのLabVIEWで実行や停止をしているので、リアルタイムOSで動いていると書かれても、信じていいのかどうかわかりません。
LEDが一定間隔でON-OFFするようにVIを改造して、my_blink_sloe.viとして保存します。停止ボタンやIO番号も定数にしました。

プロジェクトエクスプローラーのbuild specificationを右クリックして、New >> Real-Time Applicationを選択します。

build specificationのプロパティウィンドウが開きますので、Build specification name(ビルド仕様名)を書いて、ソースファイルを指定します。




できあがったビルド仕様blink_slowを右クリックしてrun as startupを選択します。
2回ほどOKボタンを押すとLEDが点滅を始めます。この状態でRaspberry Piが起動すると自動的に実行されます。
ところで、ビルド仕様を右クリックしたときにset as startupとrun as startupが選択できますが、この違いについてかかれた記事をリンクしておきます。
RTターゲットの「スタートアップとして設定」と「スタートアップとして実行」の違い
すこし端折ったところもあるかもしれませんが以上です。