LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW-LINX Interfacing Issues

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 2
(166 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 LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 2 of 2
(164 Views)