LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading SPI of MAX31855

Solved!
Go to solution

There seems to be something more fundamentally wrong with the setup the last byte is in the front that why I always have to change the wireing in read Raw Data.vi and I don't know how to fix it I'm afraid. when I ran it with two units the error shows up to where one of the bytes from the first max chip is ending up in the data from the last chip

0 Kudos
Message 71 of 130
(5,065 Views)

I noticed after digging into the vi's REAL deep the Wait for bytes.vi is showing 5 bytes available but we only need/read 4. I am not sure where the extra byte is comeing from.

0 Kudos
Message 72 of 130
(5,065 Views)

I think I'll try to write it myself from scratch and see how far I get. Thanks for the help!

0 Kudos
Message 73 of 130
(5,065 Views)

ok let me know how it goes there is another thread https://decibel.ni.com/content/message/41627#41627 that has a v2 for multiple max chips if you wanna look at how that one was done. the communication to the max chip is good from the ardiuino it is when the data is sent from the arduino to labview that there is an error. like I stated earlier the arduino is making 5 bites available when it should only be making 4 avaiable per read. it seams like the first byte of the next chip is being stuck on the end of the reading imaging 4 bytes from the first read then one byte from the next to make the 5 bytes but labview seems to be reading the last 4 of 5 so it gets 3 from the first read and one from the last.

0 Kudos
Message 74 of 130
(5,065 Views)

Hi,

im also planning to use the max31855 in combination with arduino and lifa. at fist i was trying to get it working with the sandartd lifa spi vis but that seemed not to work. So i found this board and want to try it again with your custom firmware.

Is there any final version of the firmware and the lifa vis? i found a lot of different states of the software here in this board and i'm not sure which i should use.

i hope you can help me.

0 Kudos
Message 75 of 130
(5,065 Views)

I'm told that my library works with my custom firmware.  However, it is based on an earlier version of LIFA (back when it was called LVIFA) but you shouldn't have too much trouble making it work.

0 Kudos
Message 76 of 130
(5,065 Views)

Hey Guys - I know this is probably a very simple thing, but I'm having an issue using this setup. I have the aforementioned adafruit board and it works just fine using Arduino on its own, but I'm trying to impliment it into LabView (which I'm fairly new to) and it's not giving me the restults I would expect.

I downloaded Nathan_B's code (from comment 75) and tried PDE files in the custom firmware folder and the MAX31855 Example file from the examples folder. The results I'm getting are that the TC Temperature value is maxed out, over 100C and that CJC is jumping between ~90 and >100. I have Errors in the center and right indicators, and I'm not really sure where I'm going wrong.

pic.png

Thank you in advance!

EDIT: I have been playing with this for a while and reading/rereading the thread - I ended up doing the wire rearagement from comment 38 and it works now. I get a error on the third LED (open, I believe) very briefly from time to time, but I think the issue may be with my thermocoule. I say this because when I was runing it with just Arduino using the Adafruit code, I would get an error message intermitantly. I've been able to move the probe from hot to cold and back again and am getting realistic and stable results.

Message 77 of 130
(5,065 Views)

So strange.  I've had some people state that my code works as-is and others needing the byte re-ordering.  I wonder if there is some anomaly with the sensor.

0 Kudos
Message 78 of 130
(5,065 Views)

Possibly, or perhaps the issue is with the Adafruit board communication? Althought I don't think LeXLuther was using one of those.

I do have another question for you though, would there be a reason why when I tried to add other components into the Example VI that they wouldn't function correctly? I'm trying to read voltages off of a few other analog channels on the Ardunio (hooked up to pressure transducers and LM35s, for example) and I get erros that say either I was unable to connect to the Arduino, or if it goes through my values jump all over the place. For example, the room I'm sitting in is ~20 degrees C, so the signal that I'm getting from my LM35 will jump from .2 (represents 20C) to 60, then back down, then up to another value, and continue as such. I've tried moving around your two MAX3185 VI's (inside and outside of the loop, before and after my channel read VI, etc) and I'm not sure if there's a way to fix it.

Does the Init VI change the signal from the Arduino so much that other VI's, (like a read VI) aren't able to process the signal correctly? If so, is there a way to set up simultanious loops, where one works with the thermocouple and one does everything else?

I've attached a picture of the basic set-up I'm looking for - the hope is to be able to use the thermocouple to monitor a cruicble at about 300C, the LMs to measure the room temperature and that of some of the materials in the lab, and a presure transducer and solenoid to control gas flow.

program.png

Again, thank you very much for your help!

0 Kudos
Message 79 of 130
(5,065 Views)

There is no logical reason (that I can think of) that other Arduino VIs would be affected by the MAX31855 VI.  Trying to do two loops that both contain Arduino VIs will cause race conditions and should be avoided.

When you initialize the MAX31855 it does not change anything regarding the other Arduino VIs.

0 Kudos
Message 80 of 130
(5,065 Views)