Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

programatically configure PCI 7342

I need to configure motion controller card PCI 7342 programmatically. How about the configuration in MAX? Not sure how 7342 handle it, does it ingore the configuration in MAX?

Thanks.
0 Kudos
Message 1 of 6
(4,077 Views)
From MAX :
1) In MAX, right click on the settings you want to use.
2) Select Initialize Device

In the code :
1) In MAX, right click on the settings you want to use.
2) Select Initialization settings
3) Select Export settings ...
4) Save the configuration.
5) Use Initialize Controller.flx in your code.
0 Kudos
Message 2 of 6
(4,077 Views)
I tried according to what you said. But got error -78007, and show me Possible reason(s):
Motion: An invalid initialization settings name was specified.
I couldn't find this error number from online help.
Any clue?

Thank you very much.
0 Kudos
Message 3 of 6
(4,077 Views)
From the help of Initialize Controller.flx :

Settings Name is the name of the configuration settings as specified in Measurement & Automation Explorer (MAX). To use the current configuration settings, leave Settings Name unwired or pass NULL for the Settings Name parameter. The current settings are the setting that are configured in MAX.

So this error occurs when the configuration does not exist in MAX.

There can be 2 cases :

1) The application runs on the same computer than the one that was used for developement.
In this case it is not necessary to export the settings. Wire the name of an existing motion configuration to Initialize controller.flx to use one of the existing settings.

2) Once the developement is finis
hed, the application is installed and runs on another computer.
In this case, instead of retyping the whole configuration on the target computer, you can export it to a file. But what I missed to say is that you must then import it on the other computer. Than, same as 1).

Sorry for my incomplete previous answer.
0 Kudos
Message 4 of 6
(4,077 Views)
Hi JB,

Thanks for your reply.

I think I need to clarify my question. In my application, the controller need to be configured programatically because there are two control mode in my application, one is velocity control, another is torque control (Not in different computer). So the motor's primary feedback is encoder for velocity control and analog input for torque control. Once the motor finishes the running in volocity mode, it need to be reconfigured programmatically for torque control while the program is still runing, so it is impossible to do anything in MAX. I found the function confugure controller.flx in FlexMotion. But don't know how to use it. Do you have any example code?

I also tried to use Initialize controller.flx. What
I did is export two different configuration files and wired these two file names to Initialize controller.flx in different place in my program. But it didn't work. Only when Setting Name is empty, the program works.

Did I clear my question?

Thanks.
0 Kudos
Message 5 of 6
(4,077 Views)
There a numerous VIs in the motion library (Functions palette --> NI Measurements --> Motion --> FlexMotion).
They will allow to reconfigure your motion interface.

For example, use Configure Axis Resource.flx to switch the feedback from encoder to ADC.

The general idea is :
1) Disable the axis (Enable Axis.flx)
2) Configure the axis
3) Enable the axis
4) Run the task

Unfortunately I don't have a ready to use example that suits your need.

As a starting point, I recommend to :
1) Go through the VIs in the motion library
2) See the examples on ni.com
0 Kudos
Message 6 of 6
(4,077 Views)