Interfacing with LArVA

Hello all I am currently working on a project using a march pump, water heating element, and rtd sensor. Two relays are used for the pump and heater. And the rtd read in circuit has been designed well and gives me an accurate temp reading. My code runs the pump off a millis timer and my heater is contolled using the PID library. The rtd read in is on analog 0. I have downloaded the LArVA Labview software from Below is the link to this design reading in an rtd. This works fine and well. However, when I use my code the software doesn’t work and when I use the software the code won’t run. Obviously both of these applications are trying to run on the same COM, but once my code is uploaded to the board, the board should be self sustaining. So I don’t know why the LArVA shouldn’t work with it? Anyone have experience with this or have any general ideas on how to get this to work. It would be great if i could get a nice graph showing my PID loop working. Thanks for any responses



#include <PID_v1.h>

//*******************************    Pump Setup       *************************************

const int pump = 12;                                                 //save pump pin
int pumpState = LOW;                                               //initialize pump as off
unsigned long previousMillis = 0;                                  
unsigned long interval = 10000;                                   //interval pump will cycle on and off

//******************************  PID & Heater Setup  *************************************

const int heat = 8;                                                   //save heat pin
int Input;                                                               //digital read from rtd
double TempSet, Output, TempIn;                              //Define Variables for PID
PID myPID(&TempIn, &Output, &TempSet, 5, 2, .25, DIRECT);            //Specify the links and initial tuning parameters
unsigned long WindowSize = 5000;                                   
unsigned long windowStartTime;

void setup()
  pinMode(pump,OUTPUT);                                        //initialize pump as output
  pinMode(heat,OUTPUT);                                          //initialize heater as output
  analogReference(INTERNAL);                                   //set ref voltage 0 - 1.1 V
  windowStartTime = millis();
  TempSet = 110;                                                     //insert desired temp
  myPID.SetOutputLimits(0, WindowSize);                    //tell the PID to range between 0 and the full window size
  myPID.SetMode(AUTOMATIC);                                  //turn the PID on automatically

void loop()
  Input = analogRead(A0);                                          //reads in digital value
  TempIn=(.1959*Input)+28.39;                                  //converts digital read to temp based on my linear calibration 
  myPID.Compute();                                                 //Turns relay on/off based on temp read in

  unsigned long now = millis();
  if(now - windowStartTime>WindowSize)
  {                                                                       //timer for SSR based on PID OUTPUT value
    windowStartTime += WindowSize;
  if(Output > now - windowStartTime) 
  unsigned long now1 = millis();
  if(now1 - previousMillis > interval)                              //timer for pump
    previousMillis = now;
    if (pumpState == LOW) 
      pumpState = HIGH; 
      pumpState = LOW;
    digitalWrite(pump, pumpState);     

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

So I don't know why the LArVA shouldn't work with it?

I assume LARVA expects output of the Arduino over Serial ...

No it does not need serial. The larva communicates over the COM port. It needs to upload firmware to the arduino to start, does this override the program I don't know. But I feel as though once the reading starts, the Arduino should be able to run the program no problem.

No it does not need serial. The larva communicates over the COM port.

The last time I looked COM ports used serial ...

I have not read the larva documentation but from your description

"It needs to upload firmware to the arduino to start

I assume it places a "sort of proxy" program on the Arduino which is able to read the digital and analog inputs.

In pseudo code:

void loop()
  command = readCommandFromSerial();
  result = executeCommand(Command);