12-24-2013 12:12 AM
Hello,
I am a beginner in labview and I am trying to control a maxon motor and run a NIDAQ at the same time. Basically, I need to measure the pressures and the angles at the same time and record these.
The problem that I am facing is that when I execute the VI, the motor runs first and this is followed by the measurement. I have twiddled around with it a lot getting a lot of help from this community but I can't figure it out. No matter what I do the motor starts running first and after the motor has completed its movement then the DAQ takes the measurements.
Is there any way to run the motor and the sensors together? I can run the motor seperately and I can run the sensors separately in their own VIs but can't seem to run them sequentially.
Any help would be appreciated.
Aman
12-24-2013 10:39 AM
In LabVIEW, your wires between VIs (and structures like While Loops) determine the order in which things happen.
There are several approaches that you can take to de-couple the motor and DAQ processes. The most obvious would be to put the motor control in one while loop, and the DAQ in another. Yes, you can do this in LabVIEW. Just don't get too carried away. Each loop usually will go to a separate core to run.
If there is data that has to be shared between the loops, you can use local variables, or the Value property nodes of the controls and indicators of your VI.
12-27-2013 07:52 PM
Hi John,
Thank you for the reply. I changed the order of the VIs in the program and I am getting better synchronization between the motor and the DAQ assistant. Is there any way to make sure that they are both starting at the exact same time? As far as I can observe using the highlight option in labview, the DAQ assistant starts acquiring data slightly earlier than the epos VI that triggers the motor.
Thank you,
Aman
12-27-2013 07:55 PM
Sorry forgot to attach the image of the modified VI..
12-30-2013 08:23 AM - edited 12-30-2013 08:25 AM
For a simultaneous start, I would use the DAQmx Trigger VI for one channel. Then set the source to be the Start Trigger of the other channel.
Note: I see you are using the DAQ Assistant. There is a 'Triggering' tab in the DAQ Assistant properties. I'm not sure you can set the source to be the Start Trigger of another channel using DAQ Assistant.