From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to control the data acquisition card by stepping motor with LabVIEW

Hello everyone, I am a labview beginner. Recently the lab needs to write a VI that controls both the stepper motor and the data acquisition card. Solebo stepper motor is used to control the motor to complete a series of operations by setting ActiveX control methods and properties; The data acquisition card comes from MCC, and the VI of the control data acquisition card is written by the ULx provided by MCC. 

My preliminary idea is to set the MoveHome of the stepping motor and the scan interval, use the GetPosition method of ActiveX control to get the position, and then use these values as the signal of the data acquisition card to start or finish the sampling work.

However, I encountered some problems at the very beginning.When I use an ActiveX control, the stepper motor completes a movement event (e.g., from 220mm to 200mm), and the getPosition method gets the value but cannot pass it to the next control immediately. The value will only be passed to the next control after all the movement events are completed.

Not only that, during the completion of the stepping motor movement, other data flow is also affected.If a series of random numbers are generated in the program, and displayed with an oscilloscope, and a key is used to control the movement of the stepper motor and the generation of random numbers, then there is a problem. When the key is pressed, the oscilloscope cannot display the generation of random number in real time when the stepping motor is moving. The generated data can only be displayed after the stepping motor is moving.

My problem is how to use these methods of the ActiveX control to control other parts of the control without affecting them. Also, can LabVIEW communicate with and control two hardware devices at the same time? I am looking forward to your help. VI will be attached later.

 

Kiki1999

0 Kudos
Message 1 of 2
(733 Views)

Hi Kiki,

 


@kiki1999 wrote:

Solebo stepper motor is used to control the motor to complete a series of operations by setting ActiveX control methods and properties; The data acquisition card comes from MCC, and the VI of the control data acquisition card is written by the ULx provided by MCC. 

 

My problem is how to use these methods of the ActiveX control to control other parts of the control without affecting them. Also, can LabVIEW communicate with and control two hardware devices at the same time?


Yes, LabVIEW can handle two (or more) devices at the same time!

But: the hardware and their drivers need to support that…

Can you provide links to manuals for your hardware?

 

When using those ActiveX methods you rely on that 3rd party software: you cannot change their behaviour from LabVIEW!

You could only minimze the impact of that 3rd party software on your own VI. (One way would be to create two independent executables to handle each hardware (Solebo and MCC DAQ) seperately: have them communicate using network functions to decouple them…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 2
(671 Views)