Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

motor code

Solved!
Go to solution

CKH,

 

So how are you planning on connecting your switch. There are a few ways you could do it, but basically you would have to tie the event of the switch changing values to changing the value of the motor velocity. Are you planning on using a DAQmx device, or using I/O lines on your motor controller?

Ravi A.
National Instruments | Applications Engineer
0 Kudos
Message 11 of 25
(3,305 Views)

Hi Ravi,

 

I think I will just leave the switch part away for now. I have few question that I want to ask.

 

1. Is there anyway I can export the data from the waveform chart diagram into excel, I know I can righ click on the chart and export, but is there any easier way to do so?

 

2. I will be working  with a force plate, the plate it self come with a program that can do all the data acquistion work, and export into a excel file, if I want to put both the motor data( velocity vs. time) into the same excel file, is there any way to do it?

 

Thank you

 

CKH

0 Kudos
Message 12 of 25
(3,297 Views)

CKH,

 

You can use the "Write to Spreadsheet File" VI to write your data to a spreadsheet. You will have to get the data into the form of a 1-D or 2-D array. I recommend looking at Auto-Indexing to collect all the data and then write it to a spreadsheet file. If you have the Report Generation Toolkit (an add-on you might or might not have license for depending on what kind of LabVIEW suite you've purchased), you can make the writing to an Excel file process much easier with other VIs. As for whether this data can be combined with data from another program, it depends on if they are running simultaneously and what this other program is.

Ravi A.
National Instruments | Applications Engineer
0 Kudos
Message 13 of 25
(3,293 Views)

Hi Ravi,

 

I'm struggling on getting the auto-indexing,but still not exactly sure how to use it. So, I made another way to export the data into a file, somehow, I can not make the data stored into the file I wanted. Could you take a look the code and tell me where I made a mistake.

 

Another question, I wanted to use a type of trigger to connect both control together, which means I can click that trigger/button, then when I adjust motor 1 it will also adjust motor 2 simultaneously; if I click the trigger/button again, I can separate both controls. Is there a way to do this job?

 

Thank you,

 

CKH

0 Kudos
Message 14 of 25
(3,283 Views)

Hi Ravi,

 

I tried to use case structure to create using 1 control to control both motors, but this did not work. It make sense to me that I just need to switch axis 1, I should be able to control both 1 and 2 motor. Here is the code.

 

Thank you,

 

CKH

0 Kudos
Message 15 of 25
(3,279 Views)
Solution
Accepted by topic author CKH

Hi CKH,

 

In your VI, it looks like you are not writing the input values to the second axis. I've attached a modified VI. Basically, you will just have those inputs for Motor 1 wire to both Motor 1 and 2, or (in the other case) have the respective inputs wire to the respective motors.

Ravi A.
National Instruments | Applications Engineer
0 Kudos
Message 16 of 25
(3,265 Views)

can you save previous version .i'm beginner LV .i want to learn from your code. i use labview 2009.

thank you

0 Kudos
Message 17 of 25
(3,248 Views)

Hi supersputnikk,

 

To upconvert and downconvert VIs, we like to point folks to the Version Conversion Forums.

http://forums.ni.com/t5/Version-Conversion/bd-p/VersionConversion

 

The example code provided with LabVIEW is an excellent place to learn about how to build code for applications.

LabVIEW >> Help >> Find Examples.

Then, Browse according to: Task >> Hardware Input and Output >> Motion Control >> NI 73xx.

 

In the folders that lie here, you'll find many VIs here that show you how to code properly for motors with NI-Motion. 🙂

Ravi A.
National Instruments | Applications Engineer
0 Kudos
Message 18 of 25
(3,242 Views)

Thank you very much

0 Kudos
Message 19 of 25
(3,240 Views)

Hi Ravi,

 

Just wondering if I can just put my code into this start_stop vi. I tried but failed.

 

Thank you,

 

CKH

0 Kudos
Message 20 of 25
(3,220 Views)