LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with code! NI-9174, NI-9237, NI-9264, NI-9375

Hi All,

Please help! 

 

Goal:

To write a labview program that will control 4 oriental motors(4IK25UGV-UA) motors to run independently while reading torque data from 4 torque analyzers(BMX-50i). The torque wrench is a click type wrench. I need to be able to measure the peak value then count that as 1 iteration. To get the peak value I must compare the last reading with the next reading, if the value is increasing then the compared value will be used to compare against the next reading and so on until the value is decreasing in which case the last high value will be used as the peak value. Then when the readings drop below 50% of the target value it should repeat until the # of cycles has been reached. 

 

Status:

I am able to control the motors, but not independently. Unless I break my vi's up into 4 different vi's which I would rather not due. I can read from 1 analyzer at a time but when I try to read from 4. I get the resource has been allocated error. Please see example below and any help would be greatly appreciated.

 

Code:

 motor controlmotor controlsensor readingsensor reading

Download All
0 Kudos
Message 1 of 3
(2,629 Views)

smokes,

 

I'd like to ask a few clarifying questions. First, what is the main issue you're running into right now? Is it that you can't read from all four analyzers at the same time?

 

Second, could you give me more details on your hardware and how you're trying to measure the torque? Are you trying to measure 4 torque readings simultaneously using 1 NI cDAQ module? Are you using 4 modules?

 

Also, could you explain your VI's in more detail? It appears that inside each case structure of the "MainController.vi" you are calling a subVI which reads the torque. Is the "1 controller.vi" that you have attached this subVI?

 

It's hard to tell without more context, but just by looking at your MainController.vi I can see that you are not controlling the sequence of execution. It could be that multiple case structures are trying to run at once, using the same DAQmx resource name, giving you the error you mentioned.

 

If you're able to provide me with more information I will gladly give you more detailed recommendations.

Patrick O.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 3
(2,593 Views)

Hi Patrick,

1. The main issue I am having is not being able to read peak torque value from the sensors. And after acquiring that peak I would like to use that as a count for iterations. Also when I duplicate the 1 controller.vi for 4 sensors I get a resource is already reserved error.

2. I am using the NI-9237 module with a NI-9174 Cdaq chassis to measure torque. Full bridge configuration.

3. In the MainController.vi calls out station controls for the motor mainly. That works fine so far I am using a NI-9264 and NI-9375 in the same Cdaq NI-9174. 

I hope this answers your questions and your help is great appreciated.

0 Kudos
Message 3 of 3
(2,582 Views)