LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Arduino Mega Serial1, 2 and 3 with Atlas Scientific sensors

Other kind of question........

If I would like tohave a txt message in case of alarm (High PH or temperature or a loss of power ), which module would you suggest me to find do this?

The all system is under Inverter that can support the pumps for ca. 1 hr.

So in case I am not at home I will have 1 hr. to get back and avoid to have too much water on the flow..........

Thanks again

Have a good Sunday

Andrea

0 Kudos
Message 11 of 25
(2,116 Views)

For the method that does not require modifying LIFA:

You would still only need a single debugger.  You would connect that to both Serial multiplexers and then enable/disable (E pin) and select which line (S0 and S1 pins) to use with Arduino.  Here is a really bad drawing of how you would wire it in this method:

Atlas-Sensor-Setup.png

This allows you to control the multiplexers with Arduino but then communicate via the debugger with the sensors.

*** The only thing I'm unsure about is the ground pins.  I'm assuming that the grounds will be implicitly connected through the USB grounds.

Psuedocode to talk to sensor on A_Y1 (second sensor of multiplexer A):

set E_B high

set E_A low

set S0 high

set S1 low

talk_to_sensor_with_LabVIEW()

With this set up, you only need to create serial communication VIs in LabVIEW (instead of in Arduino and LabVIEW by modifying LIFA).

0 Kudos
Message 12 of 25
(2,116 Views)

Hi Nathan_B,

it looks a simple way around.

why not!

I will order a Debugger immidiately so we can try this interesting solution.

Question:

The USB port from the Debugger to the PC is read directly by LabView?

If yes, I have to coordinate signals from the USB 1 connected to the Arduino and read the answer on the USB2?

Life is always full of new challenges!

But thanks, this debugger solution is giving me some hope.

will let you know when I have it here.

Best regards and thanks again

Andrea

0 Kudos
Message 13 of 25
(2,116 Views)

I only suggested this method because I thought you already had a debugger so that you could verify that the sensors were working.  You can do it either way but it's up to you regarding which method you feel most comfortable with.

The debugger should show up like any other COM port and can be used with the VISA drivers (See the Advanced Serial Write and Read.vi example).

For "coordination", you simply perform the pseudocode that I previously wrote (in that order) for you to execute the operation.

0 Kudos
Message 14 of 25
(2,116 Views)

Sending all serial signals through a debugger has promise.  However, as far as I know Labview can not support 2 serial read write ports concurrently..  Labview can read from one COM port and write to  a second.COM port. There is an example that comes with Labview that does this.  But no example of reading and writing to two COM ports concurrently.

After using Google to see if two copies of Labview can run simultaneously it looks to be possible but complex.

One possible approach is to not connect Labview to the COM port connected to the debugger.  Instead uses a separate program, for example Python, to read the data coming from the debugger's COM port and store the data in files with shared access.  Labview could then get the data from the files. Labview could be restricted to read only access thereby keeping the data from getting corrupted when two programs tried to write to the same file.

LINX will offer another approach when it is available.  Sammy says it will support Ethernet.  If Ethernet is available you could use Ethernet to control an Arduino Mega and the COM port to red the data coming from the debugger.

With regard to text messages see:

<http://digital.ni.com/public.nsf/allkb/5C55FAEDC7BF5C0C862570930054D39F>

Hrh1818

0 Kudos
Message 15 of 25
(2,116 Views)

hrh1818 wrote:

Sending all serial signals through a debugger has promise.  However, as far as I know Labview can not support 2 serial read write ports concurrently..  Labview can read from one COM port and write to  a second.COM port.

Hrh1818

This can't be true.  I've done it before with two Arduino Mega's connected simultaneously (and continuously).  Also, according to this document, you can have up to 256 serial ports (it refers to RS232 and RS485 hardware but shouldn't matter).

0 Kudos
Message 16 of 25
(2,116 Views)

Hello Nathan,

That is exciting news being to use LIFA to control two Arduino Megas.   Your approach is much more productive than the non LIFA approach I was piddling with.

hrh1818

0 Kudos
Message 17 of 25
(2,116 Views)

And here they are, just got the package from Atlas Scientific with the Debugger

Will slowly start to see how it horks.

Please some some directions......... (I got 2 so if I blow one.........)

Regards

Andrea

0 Kudos
Message 18 of 25
(2,116 Views)

Hello there,

first question:

I have to download the driver for the Debugger and they ask for: Virtual COM Port (VCP) drivers and direct (D2XX) drivers

apparently the driver is not the same....

Which one do I have to use to follow your schema?

Thanks

Andrea


0 Kudos
Message 19 of 25
(2,116 Views)