LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I record a numeric output values and then use them?

So at the moment I just have a numeric value being display with a numeric indicator. I want to record this value somewhere for later use. Such as doing calculations. I want to store many numeric values that are outputed to this single indicator at different times and then pull them from the stored place and use them. I don't know much about arrays and storage stuctures in labview.  Can someone give me some directions please? Thanks

0 Kudos
Message 1 of 8
(3,385 Views)

You can save them in a file, if you don't care too much about performance loss (even if in a low scale).

Also you can use arrays, as you said.

Look at the example finder too see array examples. They're essencial in most of your LabVIEW applications.

Mondoni
0 Kudos
Message 2 of 8
(3,379 Views)

Can you actually give me any guidance?  I don't understand how i can save the value to an array without the value in the array being changed when the value in the numerical indicator is changed.

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

post your code so we can help on something "tangible" i'll be more efficient

🙂

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

I've searched for some useful stuff for you.

Take a look at these links:

File IO VIs and Functions

Array Functions

Moving Data From LabVIEW to Excel

 

Spreadsheet Basics VIs

Write to Spreadsheet file

Read from Spreadsheet File

 

As Nihil said, post some code too. It will filter your needs.

Mondoni
0 Kudos
Message 5 of 8
(3,349 Views)

So there isn't really anything related to the question yet in may code.

My code shows movement control for a motor.

I have a forwards button which increments +1 for every iteration of the loop. Each loop sends a pulse to the motor to move it.

I have a backwards button which increments -1 for every iteration of the loop. In this loop i have just placed the direction pulse which tells the motor to turn the oposite way.

these increments add onto a counter which is shown as the numerical indicator, used to show the position of the motor.

I also have a reset button on this motor. To change the position to zero.

 

So now what i want is to put the value of the position of the motor into an array which will then stay at that value in the array even when the position moves again. So i can record different positions.

I then want to use these values. so i want to know how to get them from the array to the Number of iterations for a For loop so i can move the motor by that amount.

 

Your help is appriciated, ive already spent so much time getting to this stage.

 

 

 

 

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

Hello,

 

Looking at your code and explanation above,i guess you are trying to move a motor for single axis and you need to run the motor for a particular no. of steps forward/backward or path. You can save the position data in a file (text/binary format) and later read the logged position and use them.

 

Below is the example to save the position in .csv format.

Motorsteps.png

 

you can try some other formats too.

 

 

Regards,

Bijay

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

Your code has a number of errors.

1. You are not wiring your Forward, Backward and Set to Zero controls to their corresponding case selector terminals, but instead to their own independent terminals.

2. Your while loops are not achieving anything, and nor is the conditional terminal wired to anything - why are they there?

3. Presumably line1 is used to define the direction of motion in your motor? You need to set an input to the Digital Write function for this task.

4. If you use a single toggle switch to define Forward / Reverse, and use this on line 1 you can avoid having to duplicate your line1 code for the Backward step.

5. Since the write functions to the line0 task are the same, combine the two halves of your code into one for each required output pulse.

6. The two numerics that pass through both the upper and lower case structures will always be either +1 or -1 for each. Did you mean to use Shift Registers on the while loops to store their values?

 

You are asking about building an array of values. The simplest method is to call the Build Array primitive which you will find in the Array functions palette.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


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