From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

read through COM value and 30 second averaging simultaneously

Hi all, 

 

So I am building a user interface for a model wind turbine I have built and am having some trouble with the control. The rotational rate of the turbine needs to track the varying mean velocity of the incoming flow (top while loop in the VI). This is done by reading pressure values through a DAQ assistant and taking a 30 second average to then set the appropriate turbine rotational rate once every 30 seconds (through AO channel on my USB6211 to the motor drive). 

 

While this is going on, I want to be reading (as quickly as possible) the torque and velocity of the turbine (servo motor) through the COM port, but I am having trouble as the system doesnt seem to be able to send the analog output to the motor to set the speed.. maybe because it is busy taking the torque and velocity values? Any help on this would be greatly appreciated.

 

See attached. 

 

~ SBC

0 Kudos
Message 1 of 4
(2,281 Views)

I can't view your code (using LV 2016), but what do you mean "through the COM port"? Is this the USB 6211 DAQ device you mentioned earlier or something else? 

 

Different DAQ devices has different requirements and capabilities related how you set up your tasks. Definitely consult your manual to find out what is allowed for your device.

0 Kudos
Message 2 of 4
(2,247 Views)

Thanks for the reply gregoryj,

 

Yes I read the manual. The COM port is the COMmunication port which is the USB to RS232 cable which runs to the servo motor drive. This is separate hardware to the USB6211 which is a NI data acquisition board which is outputting the analog velocity command value to the servo drive...

So the COM port is used to read values from one port on the Parker Compax3 servo drive, while the USB6211 is attempting to write a voltage to a different port on that same servo drive, however it is not writing the value... I believe this is due to some sort of timing conflict where the reading of values through the COM port is stopping the USB6211 from sending the voltage to the drive... 

Best, 

~ SBC

0 Kudos
Message 3 of 4
(2,244 Views)

You need to start with a few tutorial about dataflow. Your stop button in one loop wired to the termination condition of another loops will generate a data dependency such that the second loop cannot start until the first loop has completed. At this point the boolean is true and the second loop will stop after one iteration.

You need to decouple the two loops so they can run in parallel.

 

Constipation.png

 

 

To take a 30 second average, use "mean ptbypt" with a history size depending on the data rate to get 30 seconds worth.

Message 4 of 4
(2,239 Views)