04-13-2022 10:47 AM - edited 04-13-2022 10:48 AM
I have an 8-channel multiplexer. I want to select each channel sequentially, say Input I0 and then I1 .... to I7. I am using an Arduino Uno R3 to select input lines by the select lines (S0, S1, S2). I have done that using Arduino. Now I want to select the inputs by using LabVIEW.
Can I use (upload) the Arduino codes/ scripts to select that? I couldn't find anything on that.
How can I select inputs in LabVIEW?
Pic1: A mux block diagram
Pic2: Displaying the S0, S1, and S2 values from Arduino code
I really appreciate any help you can provide.
Regards
04-13-2022 11:08 AM - edited 04-13-2022 11:12 AM
Well the simplest way would be to program the Arduino in its native language as there is no direct support for your MUX in LINX or the long since deprecated LIFA.
You will need to make up your own little "command set" to change the MUX by sending commands through the serial port using the serial monitor that is built in to the Arduino IDE or any other terminal program like Terra-Term
Once you have that working write a LabVIEW program to do the same thing with the Arduino using VISA just like any other instrument on a serial port.
04-13-2022 11:08 AM
Hello there,
There are multiples ways to do it.
I will explain 2 of them.
Way 1:
1. Make a Arduino code to read the serial integer data and take action as per the serial input.
You will need to use Serial.read or Serial.readString input.
2. Use VISA serial drivers of LabVIEW.
Initialize VISA, Use VISA write to send the integer data. Make UI as per your requirement.
3. Integrate. Working - whenever you will send data from LabVIEW, Arduino will read the serial data and accordingly it will select Mux. - Done.
Way 2:
1. Use MakerHub's LINX or LIFA
Reference links to learn.
https://www.labviewmakerhub.com/doku.php?id=learn:tutorials:libraries:linx:getting_started
https://forums.ni.com/t5/LabVIEW-Interface-for-Arduino/ct-p/7008
2. Upload pre-built firmware of Arduino by LIFA or LINX.
3. Write complete logic using The APIs provided.
NO Need to make any Arduino code for Way 2.
04-13-2022 11:26 AM
@RTSLVU wrote:
Well the simplest way would be to program the Arduino in its native language as there is no direct support for your MUX in LINX or the long since deprecated LIFA.
You will need to make up your own little "command set" to change the MUX by sending commands through the serial port using the serial monitor that is built in to the Arduino IDE or any other terminal program like Terra-Term
Once you have that working write a LabVIEW program to do the same thing with the Arduino using VISA just like any other instrument on a serial port.
On second thought I guess you could use LINX as I am guessing you are using a few of the DIO lines to address your MUX
So you could: