LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Viewing the Serial Monitor

In my arduino program, I am reading a load cell through viewing the serial monitor. Is there a way to view this in the labview environment? I'll attach the arduino file.

0 Kudos
Message 1 of 7
(8,878 Views)

You can use the Continuous Serial Write and Read.VI example that comes with Labview to to transfer load cell data to Labview.  Hwever, It can not continuously read data like the Arduino IDE's Serial Monitor.  Instead with Labview you need to send a command to Arduino to get a reading, configure your Arduino sketch to send  the requested data and then read the data with Labview.  You will need to continuously poll Arduuino for a reading.

Your existing sketch is not compatible with Labview's Contnuous Serial Write and Read.VI.  You will need to revise your sketch.

hrh212

0 Kudos
Message 2 of 7
(7,709 Views)

There is no requirement to write to the Arduino, he can simply continuously read from the serial port (using a delimiter) and then parsing the data appropriately.

0 Kudos
Message 3 of 7
(7,709 Views)

Would I just use the Visa commands in labview to access it?

0 Kudos
Message 4 of 7
(7,709 Views)

Yes.  Take a look at the example that hrh212 suggested:  Continuous Serial Write and Read.vi.

0 Kudos
Message 5 of 7
(7,709 Views)

No.  You do not use VISA commands.  Instead use something simple like a character.  In your example a command will act like a trigger. It will trigger one data acquisition read print cycle.  In Labview you send the trigger character to Arduino each time you wanted to collect a new load cell reading. 

Here is an example that demonstrates the use of a trigger.

char inComingChar = 0;   // for incoming serial data

void setup() {
        Serial.begin(9600);     // opens serial port, sets data rate to 9600 bps
}

void loop() {

        // read data only when data,is available
        if (Serial.available() > 0) {
                // read the incoming character:
                incomingChar = Serial.read();

               if ( inCommingChar == 'r') {  // I arbitrarily used r for a trigger

               // Place your code for reading the load cell signal and using

               // Serial.print and Serial.println to send the data  to Labview here.

                }

       }
}


0 Kudos
Message 6 of 7
(7,709 Views)

Got it to work using the "Continuous Read and Write" example and just took out the "read" part and made it it's own VI. Thanks for the help!

0 Kudos
Message 7 of 7
(7,709 Views)