From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

save - monitor data problem

Solved!
Go to solution

hi .

i want to build a system that scan a 2D area with arduino mega (x-y dimension). system works like that; i enter total x and y lengts ( the edge of area that i want to scan) and the step lengts of x and y. i have 5 sensors. for examle 50 cm x length and 5 cm step length. motor runs for 5cm and stops 10 timesand  go a step at +y direction and go -x direction 50 cm at 10 steps and +y direction. this is a loop for me. i wrote a program that controls 2 stepper motor drivers. as you know driver has 3 inputs (enable/disable, forward/back and clock). motors and scanning system works well. and i can read all 5 data from voltage indicator. but i cannot monitor this data at ex table and save it to measurement file. i m working for it many weeks. i want to learn that how can i save data with x-y coordinates. if you help i will be happy.thank you. 

0 Kudos
Message 1 of 8
(4,856 Views)

One possibility is to calculate a running sum of the X and Y positions. In Documents there is a AdafruitV2MotorShieldStepperDriver example.  The example zip file contains a X Running Sum.VI and Y Running

sum.VI.  You may want to use these two VIs. You could then save the X Running Sum and Y running Sum values along with your sensor data.

hrh1818

0 Kudos
Message 2 of 8
(3,887 Views)

thanks for your reply, the main problem is saving data of 5 sensor for me. i m going to exaine these .vi's. thanks again.

0 Kudos
Message 3 of 8
(3,888 Views)

This link address your main problem.

<http://metrology.hut.fi/courses/S-108.3030/LabVIEW%20File%20IO.pdf>

herh1818

0 Kudos
Message 4 of 8
(3,888 Views)

dear hrh1818, if you download and open my program, you can see the main problem is where to put measurement file.vi, i know how to save data but dynamic data is flowing and i have to save them with coordinates. thanks for your help.

0 Kudos
Message 5 of 8
(3,888 Views)
Solution
Accepted by topic author fizikci

A sloppy but simple way to do it, I think, is to simply use the "Write to Spreadsheet File" VI.  Build a 1D array with the following elements:  X-iteration, Y-iteration, V1, V2, V3, V4, V5.  You can use this VI after every "measurement" with "Append to file" set to true.

0 Kudos
Message 6 of 8
(3,888 Views)

dear nathan,

thanks for your help, now i can save data.i want to ask you another and last question ; i want to draw every sensors 3d graph . i know x and y coordinates and sensor's values. how can i do this. my programs last version is attached. i watched videos but i couldnt do it.

thanks again.

0 Kudos
Message 7 of 8
(3,888 Views)

Given that you have <x, y, data> points, I think you are referring to a surface plot.  You can find the surface plot on the front panel palette:  Modern > Graphs > 3D Graphs > Surface

If you have issue trying to get this to work, you should post in the LabVIEW general forums becuase you will get much better support over there for LabVIEW features:  http://forums.ni.com/

Message 8 of 8
(3,888 Views)