LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Experimental aquaponics with Arduino and multiple sensors

ok, I know, this is not the way a pro would do it.... but I am not a pro 

So after trying for hours to work out a simple sketch..... and having all the time to deal with this orange line telling me that something was not declared or else...

I have opened and modified the original from Atlas Scientific (with their approval)...........

I have 8 sensors... so 2 Serial Port Connector

One on Serial2

one on Serial3

Added few things on the original Sketch like pins (4 and 5) and 'digitalwrite' to open change the level on the Pins that open the Channels on the two Serial Ports

Waiting to hear your opinion I am preparing the 2 solderless breadboards.

0 Kudos
Message 41 of 52
(1,867 Views)

Hello there,

I am trying to do data logging for the first 4 temperature sensor and the position on 4 switches.

This is what I came out with, I tried different 'Structures' but looks like all of them are making the program quite slow, also if the 'Wait" is for 1,000 ms.

Could you please let me know witch one would be the best Structure to use?

Thanks in advance

Andrea

Structure.jpg

0 Kudos
Message 42 of 52
(1,867 Views)

Sorry Nathan_B, Looks like I didnt send you the code for the 'single value reading':

Here it is

  All the best

Andrea

0 Kudos
Message 43 of 52
(1,867 Views)

Sorry that I've not been able to get to writing anything yet.  I'm quite busy at school right now making it hard to write code unlike when I've written before.

Regarding your "structure" question, I don't understand what you are asking.  Attaching the actual VI would probably be helpful along with a description of what you are wanting to happen (without any reference to the code).

0 Kudos
Message 44 of 52
(1,867 Views)

Hi Nathan_B,

Sorry, I didn't want to give you some pressure...... Just got the impression I didn't send the requested info.....

So here is where I am:

- All the previous part (Solenoids and Valves) are working fine (Thanks to you and hr1818)

- I have added at the VI the 4 temperature sensors (no more OneWire Thecnology but new one from Atlas Scientific, reading the signal on a normal Analog Input PIN);

File: Untitled 10_28.vi

- They are working fine (exept that the reading is going up or down by 1,5 degrees every time I send signals to the Ditial Pins to open or close the Relays, I will resolve this later)

- Now I would like to do some 'Logging' so I have created a new VI only for the temperature sensors and tried to write the values on a file ones per second.

- It is working but I have the impression that I am accieving something with the wrong approch.

File Read and Write 4 temps 28_10.vi

- Could you please give me the right "Structure and File I/O I will have to use to write a proper code?

Structure.jpgFile I_O.jpg

When all of this is up and runniong I can follow up the aquisition of the signals from the 'Serial Multiplexer' to the Arduino....... for now i didn't find clear info on the web about this subject.

All the best for your school project.

Thanks and regards

Andrea

Download All
0 Kudos
Message 45 of 52
(1,867 Views)

I don't see anything major wrong with the logging.  I'm sure there are several different ways to do it.  The only thing that you have to realize is that the maximum loop speed will be limited by the 1000 ms wait VI that you have in there.  So, somethings might not execute right away (your boolean switches for example).

Also, you typically can't read from a digital line that you have set as an output.  And, you should move your Set Pin Mode VIs in front of the loop since you don't ever change them.  This will help speed things up.

0 Kudos
Message 46 of 52
(1,867 Views)

Hi Nathab_B,

Thanks I did a bit of clean up in the VI.

I have found this link to a 'Discussion' about Serial1, do you think it would be of some help to write a LIFA or something to read the Multiplexer with the sensors ffrom Atlas Scientific?

I asked them if they have some experience with it but the answer was negative.

Greatings

Andrea

0 Kudos
Message 47 of 52
(1,867 Views)

So the 2 structures can not run at different speed?

If I want to record ones every 30 seconds, the all loop will have to wait 30 seconds?

Just to dont collect a massive amount of numbers that in my case are not needed.

0 Kudos
Message 48 of 52
(1,867 Views)

andreaspi wrote:

Hi Nathab_B,

Thanks I did a bit of clean up in the VI.

I have found this link to a 'Discussion' about Serial1, do you think it would be of some help to write a LIFA or something to read the Multiplexer with the sensors ffrom Atlas Scientific?

I asked them if they have some experience with it but the answer was negative.

Greatings

Andrea

Ops, forgot to add the Link:

https://decibel.ni.com/content/thread/16932

0 Kudos
Message 49 of 52
(1,867 Views)

andreaspi wrote:

So the 2 structures can not run at different speed?

If I want to record ones every 30 seconds, the all loop will have to wait 30 seconds?

Just to dont collect a massive amount of numbers that in my case are not needed.

You only have one loop structure so anything in that loop will essentially run at the same speed.  If you don't need a "live" feed of the data (display) then you can simply change the wait to 30000 ms.  If you need a live display then you need to have the loop run at your preferred live-feed rate and then check if 30 seconds has passed, if yes, write your data to the file.

Some more advice:  You need to have all Arduino VIs in-line, i.e. you need to have the error and resource output wires from one Arduino VI as the input to the next Arduino VI.  If you don't do this, it's possible that the serial communication could be corrupted due to two different VIs trying to send/receive data with the Arduino.

0 Kudos
Message 50 of 52
(1,867 Views)