I am having a lot of trouble using labview to read a thermocouple temperature through my arduino uno board. The setup is fine, I am just having trouble with the inferface. I started out with LIFA and it didn't work, now I am trying LINX. Is there some file or command I need to include in my arduino code? Ive tried the pre-built firmware under "tools", along with my custom code. Shouldn't a digitalread command display the temperature?
Thanks for the guide. I was wondering if there was a way to not recreate the whole SPI in labview since it is already created and working in the arduino code. Basically, can i add my code for the thermocouple SPI in this arduino file and then upload that to the board? That should allow for LINX compatibility right?
You can add your custom Arduino code implemented as a custom command if you don't want to use the LINX implementation or have large or significantly complex Arduino library/code that you don't want to re-implement. Another good reason to use a custom command is for speed if your code requires reliable short delays.
That means that the code inside of the custom command is taking too long to execute (or longer than the timeout you specified for the custom command VI). Without the INO file, that's all that we can say.
//*numResponseBytes=2; - arbitrary number. This allows me to get one reading from my thermocouple. //*numResponseBytes = numInputBytes; - this line of code makes it not work (i have no input in labview)
return 0; }
I purposely left out the for loop because I am not getting a response with it. Although I might need it for continuous readings.
Realistically you should only get a single reading each time you execute the custom command. If you are needing to eliminate noise or something like that, you could take several readings and take the average and then send that one value back. Also, things don't generally change temperature very quickly (things that change temperature quickly generally can't be measured with a thermocouple).
Also, realize that the time that this function takes to execute will be how long your LabVIEW code will be blocked (well, the parts that have this function as a data dependency).
What I am trying to do is take a temperature vs time and plot it in a waveform graph. I can get a singular reading plotted in the graph, but then the next reading overwrites that value. The plot does not scroll with time like it should. I tried putting the custom command in a while loop and that did not change anything. Here is a screenshot
Since I can't see your LabVIEW block diagram all I can say is to do some research on the difference between a waveform graph and a waveform chart. The Simple difference is that the graph requires you to pass all the data to it every time (a constant time interval is assumed) whereas a chart stores previous values internally so you only need to pass it a single value every time (this does not inherently have any timing associated with the X axis, just one data point for every time the indicator is executed).