LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

recording data from rotary encoder

Solved!
Go to solution

I am a veterinarian pursuing post-doctoral research in orthopedics. We are trying to use a rotary encoder to record angular position. I am running into several issues, we need continuous data however the sad code I've cobbled together only records the last value. I was also wondering how to get the recorded data into an excel sheet. I would appreciate any help, I have about zero experience in labview, coding etc. Thank you!

0 Kudos
Message 1 of 7
(1,229 Views)

Can you do a "Save for previous version" to save your VI as an earlier version?  I'm only using 2021, and many other forum users have stopped upgrading there or earlier, so if you could back save it to maybe 2018 or so then a lot more people can look at your code.

 

In the meantime, could you also post what hardware you are using to capture the data?

 

And for the part about getting it into an Excel sheet, there are several options.  A text file with values separated by tabs or commas is what I usually use.  You could look at the Write Delimited Spreadsheet File VI to start.

0 Kudos
Message 2 of 7
(1,212 Views)

Logging added.png

DAQmx Configure Logging (VI) will write a TDMS file

0 Kudos
Message 3 of 7
(1,163 Views)

Dear Confused,

 

     The reason to request a VI be saved as Previous Version is because we cannot open a LabVIEW 2023 VI with LabVIEW 2021.  We don't want to "see a picture of a block diagram", we want to be able to open the block diagram, study it, edit it, maybe execute it, and figure out where/why it is mis-behaving.  Please help us to help you by attaching LabVIEW code (not "pictures") so we can study your code.

 

Bob (frustrated) Schor

0 Kudos
Message 4 of 7
(1,119 Views)

2019 version for anyone wanting to take a look 

0 Kudos
Message 5 of 7
(1,105 Views)
Solution
Accepted by confusedveterinarian

Thank you for including the code.  I have good news -- your code is almost the same as the Example Code that ships with LabVIEW 2019 (go to Help, Find Examples, and Encoder).  What you seem to be missing is the Timing Settings (DAQmx Timing) that "clocks" the Counter.  I'm attaching a copy,

 

Bob Schor

0 Kudos
Message 6 of 7
(1,090 Views)

Thank you so much!

0 Kudos
Message 7 of 7
(1,043 Views)