05-04-2014 12:47 AM
Hi Nathan,
stop button missing at this time because i'm testing the vi, so use the abort button. You' re right using abort button I nedd to reset arduino every time i restart the vi, but stop button doesn't sove the problem. Uploading vi, sub-vi modified to read three temps, and LabViewInterface.ino modified to read three temps (three addresses on onewire bus) and lifa_base.
Regards
Riky
05-04-2014 02:24 AM
I don't see anything wrong with the code (LabVIEW or Arduino). More investigation will be required.
Here are a few questions you can answer to help the debugging process:
Does the temperature VI work in a loop (alone)?
Does the PWM function work in a loop (alone)?
Does the PWM function output the correct pulse train?
When you have both VIs in the same loop, does the order matter (one before the other and vice versa)?
Where does the error actually occure? After the PWM function or after the temperature function?
If you don't know how to determine this, you can simply use the "Hightlight Execution" button and watch the data flow through the wires on your block diagram.
My advice: When I am testing VIs (ones with loops), I will always have a stop button and have both the stop button and the error wire able to stop the loop. See that attached version of your VI for how I do this. This is beneficial because the loop will stop automatically when you get an error. You will generally never need to use the abort button (which will save you time during testing).
05-04-2014 06:32 AM
Hi Nathan,
I will test later your vi.
The temperature vi works correctly in a loop alone.
The same for PWM
The pwm output is correct.
When both subvi are present doesn't matter the order of placement.
I will youse Hightlight Execution to provide you more details, but if I remember i don't see errors the releaved temps are not corrects ( all three therms output is about 6000 C°),
Another info : at first loop temps are correct (about 22°).
riky
05-06-2014 12:33 AM
Hi Nathan,
problrm persists even if there's stop button.
As i remember theres no error, but Hilighting execution I see that reading bufferv in DS1820 get temp vi (changes adding bytes) after first loop iteration and so the temps go highter (5000 C°). It seems that digital write function alter the reading buffer in ds1820 get temp vi. If i run DS vi alone in loop the buffer changes if changes temps but in any case no additional bytes are added.
05-06-2014 07:43 PM
riky973 wrote:
If i run DS vi alone in loop the buffer changes if changes temps but in any case no additional bytes are added.
I don't understand this sentence.
05-07-2014 12:18 AM
Hi nathan,
if i run get temp vi alone i see in reading buffer something like this "nn nn nn" where nn are bytes changing if readed temp change.
In get temp + pwm vi in the reading buffer you can see something like this "nn nn nn0" and seems that this 0 cause the wrong temp reading.
Riky
05-07-2014 03:12 AM
If you change the order of the PWM and Temperature VIs, does that zero show up in a different spot or is there a different pattern?
05-08-2014 02:18 AM
Hi Nathan,
changed the order and the problem now is only at first loop operation, after the fisrt loop ( wrong temo are readed) , all works fine and temperature are correct.
Riky
05-08-2014 02:35 AM
riky973
I do believe I have the same hardware you have, If you attach a complete set of all files I can run them and maybe a help
when I compare the output of DS1820 on a serial output I see lines of data that need to be parced.
Can you uploade a folder with all modified files?
Barddya
05-14-2014 02:04 AM
HI barddya,
I see now your post. Thank you for your help, uploading all files for reading temps. Tell me if something is missing.
Regards