LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Arduino and Dallas DS1820 (one-wire)

Solved!
Go to solution

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

0 Kudos
Message 131 of 172
(1,146 Views)

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).

0 Kudos
Message 132 of 172
(1,146 Views)

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

0 Kudos
Message 133 of 172
(1,146 Views)

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.

0 Kudos
Message 134 of 172
(1,146 Views)

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.

0 Kudos
Message 135 of 172
(1,146 Views)

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

Immagine.jpg

0 Kudos
Message 136 of 172
(1,146 Views)

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?

0 Kudos
Message 137 of 172
(1,146 Views)

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

0 Kudos
Message 138 of 172
(1,146 Views)

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

0 Kudos
Message 139 of 172
(1,146 Views)

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

0 Kudos
Message 140 of 172
(1,146 Views)