Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to record numeric data at certain points

Brief description of what I am doing:

 

I have two sensors hooked, one for displacement one for laod. up to my computer going from rs232 to USB and a stepper motor control. I have my data coming in a converting it to numeric numbers. I have the two sets of data making a graph and writing to csv so no problems there.

 

What I need:

 

As the stepper motor moves and creates displacement, I want the displacement to reach a certain value and then write the data from both sensors but I need this for multiple points. What would be the best way to put in each of those individual points to command to take the reading and stop at the end.

 

Also I do not have any .vi to show.

0 Kudos
Message 1 of 5
(5,032 Views)

There are many designs for this requirement.  How about:

  • Read limit ranges from a configuration file.  For example, "RANGE_1 START 0mm STOP 1mm, RANGE_2 START 3mm STOP 5mm", etc.
  • Parse the log ranges into an array.  For example, [0, 1; 3, 5; etc.]
  • Check the displacement is in range of the limits.  For example, use an auto-indexing terminal for the condition array and latch true and abort the loop when any condition evaluates true.
  • Use the evaluation output to write to file.  For example, surround the write file VI by a case structure, and only write when a condition is true.

write_on_limits.png

-Steve K

 

0 Kudos
Message 2 of 5
(5,025 Views)

Pie

 

I'm not quite sure what that function is that your are showing, comparing the displacement to the limits.

0 Kudos
Message 3 of 5
(5,017 Views)
0 Kudos
Message 4 of 5
(5,016 Views)

When you see that type of picture, it's called a VI Snippet.  You can right-click the picture and save the .PNG to your computer.  Then open a VI and drag the .PNG file onto the block diagram.  It should create the code for you.  The White Paper says you can drag directly from the browser, but I've not had success doing that.

-Steve K

0 Kudos
Message 5 of 5
(5,014 Views)