LabViewでArduinoから取得した複数のセンサ値のグラフをプロットする

環境はmacOS Sonoma, LabView 2023 Q3.

Arduino-LabViewのシリアル通信にはVISAを利用する
LabViewでLINXなしでArduinoと通信する(VISA使用) - how to code something

Arduinoからは1.0,2.0,3.0,...のような形の形式で文字列を送り、LabView側で「Spreadsheet string」ブロックを用いてパースする。

Arduinoスケッチ

void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
  float voltage = sensorValue * (5.0 / 1023.0);
  // print out the value you read:
  Serial.print(voltage);
  Serial.print(",");
  Serial.print(voltage+.1);
  Serial.print(",");
  Serial.print(voltage+.2);
  Serial.print(",");
  Serial.print(voltage+.3);
  Serial.print(",");
  Serial.print(voltage+.4);
  Serial.print(",");
  Serial.print(voltage+.5);
  Serial.println(",");
}

実行結果