LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW-LINX Interfacing Issues

Solved!
Go to solution

I have written code which was supposed to work as a LINX custom command on Arduino and LabVIEW. The aim of the code was to take the input in integers from labview, multiply it by 100, and then use the product as a delay in blinking the on board Arduino Uno LED at pin 13 on and off. The code is as follows:

/****************************************************************************************  
**  This is example LINX firmware for use with the Arduino Uno with the serial 
**  interface enabled.
**
**  For more information see:           www.labviewmakerhub.com/linx
**  For support visit the forums at:    www.labviewmakerhub.com/forums/linx
**  
**  Written By Sam Kristoff
**
**  BSD2 License.
****************************************************************************************/

//Include All Peripheral Libraries Used By LINX
#include <SPI.h>
#include <Wire.h>
#include <EEPROM.h>
#include <Servo.h>

//Include Device Specific Header From Sketch>>Import Library (In This Case LinxChipkitMax32.h)
//Also Include Desired LINX Listener From Sketch>>Import Library (In This Case LinxSerialListener.h)
#include <LinxArduinoUno.h>
#include <LinxSerialListener.h>
 
//Create A Pointer To The LINX Device Object We Instantiate In Setup()
LinxArduinoUno* LinxDevice;
int del=10;
//Initialize LINX Device And Listener
void setup()
{
  pinMode(13,OUTPUT);
  
  int blinktest(unsigned char numInputBytes, unsigned char* input, unsigned char* numResponseBytes, unsigned char* response);
  //Instantiate The LINX Device
  LinxDevice = new LinxArduinoUno();
  
  //The LINXT Listener Is Pre Instantiated, Call Start And Pass A Pointer To The LINX Device And The UART Channel To Listen On
  LinxSerialConnection.Start(LinxDevice, 0);  
}

void loop()
{
  //Listen For New Packets From LabVIEW
  LinxSerialConnection.CheckForCommands();
  
  //Your Code Here, But It will Slow Down The Connection With LabVIEW
}

int blinktest(unsigned char numInputBytes, unsigned char* input, unsigned char* numResponseBytes, unsigned char* response)
  {
  del=input;
  del=del*100;

  digitalWrite(13,HIGH);
  delay(del);
  digitalWrite(13,LOW);
  delay(del);
  return 0;
  }

This code has been uploaded to Arduino. The other LabVIEW VI I have uploaded as well as the screenshots. Any guidance would be greatly appreciated.

Download All
0 Kudos
Message 1 of 4
(2,170 Views)

Hi Umerator,

 


@TheUmerator wrote:

I have written code which was supposed to work as a LINX custom command on Arduino and LabVIEW. 

Any guidance would be greatly appreciated.


"Any guidance" on what problem?

There is no question in your whole message!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,168 Views)

I can not get the Arduino code to compile.   I have rounded up all the .h & .ccp files.  the code will just not compile to use.  bummer.

0 Kudos
Message 3 of 4
(1,294 Views)
Solution
Accepted by topic author TheUmerator

Hey, thanks for giving it a try anyway, I ended up using a different medium than LabVIEW that suited my goals better at the time. Outdated libraries and whatnot. Thanks again!

0 Kudos
Message 4 of 4
(1,222 Views)