LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.CSV to motor via Labview

Solved!
Go to solution

Hello, Everyone!

 

I'm a 3D artist in the Game and film industry, so I'm finding it hard to use LabView to build a stop-motion camera rig.

 

 The VI takes a .csv file from Maya (single Axis animation data) and loads it into a graph and an Array (Please see images attached).

screenshot_1967.jpg 

 So the VI works so far. The file loads, I get the correct graph info. It's perfect!

 

Here LabView has taken the CSV file and loaded it into the graph and they match.

 

screenshot_1944.jpg

 

The stepper motor also sets up and is ready to go. All good.

 

What is missing is the connection from the string/array to the motor SetPoint input of (MA) Move Absolute.

I think I want all numbers in the string to go to that input on the motor. all I need is the string to load (is that possible?)

 

Here is the front panel and the data:

 

screenshot_1968.jpg

 

I will send: .csv file and the Vi file:

 

Maybe someone can point me in the right direction.

 

Many thanks for reading and hopefully you can help!

 

Mike

Download All
0 Kudos
Message 1 of 19
(4,724 Views)

What kind of input does the Move Absolute selection expect? Comma delimited X,Y,Z?

0 Kudos
Message 2 of 19
(4,639 Views)

I think it is Comma delimited X,Y Z. As in attached diagram. 

 

 

screenshot_1979.jpg

0 Kudos
Message 3 of 19
(4,628 Views)

Hi mpartist,

 

what is the command string expected by the MA vi?

I suggest to read the CSV file before the loop.

I also suggest to setup the motor before the loop.

In the loop you only need to send your MA parameters to the motor...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 19
(4,616 Views)

So, you can remove the case statement from around the Move Absolute part. It is hard-coded to be true so serves no purpose.  You can get rid of the nested for loop building a string array.  Its just extra work.

 

One option you have is to wrap the Move Absolute in a for loop, loop over the array of doubles an convert each row to a comma delimited string (Array to Spreadsheet String function)

 

for loop with array to string.PNG

0 Kudos
Message 5 of 19
(4,612 Views)

Thank you for this! I will have a go now.

 

Cheers.

 

I'm learning.

 

0 Kudos
Message 6 of 19
(4,566 Views)

Hello Mancho00,

 

I tried that just now. I don't have the motor connected, so it fails on that. BUT Everything else works as intended. Did I get I right?

 

Good stuff if it worked the first time!!

 

Please take a look and see if it's cool!

 

Thank you!

 

M

 

 

screenshot_1980.jpg

0 Kudos
Message 7 of 19
(4,558 Views)

Always one more wire.

screenshot_1981.jpg

 

Message 8 of 19
(4,555 Views)
Solution
Accepted by RavensFan

Looks good, but move the Close Port block out of the loop, otherwise it'll probably only work once.  Looks like you can remove the sequence frame as well.

Message 9 of 19
(4,550 Views)

Doing that.

Removing the frame, that works.

 

Moving the close port brakes it.screenshot_1982.jpgscreenshot_1983.jpg

0 Kudos
Message 10 of 19
(4,548 Views)