Hello, I am working on a labview program for measurement and control of a simple pump test loop.
The VFD that controls the motor is connected to a pc with an rs232-usb connection and controlled via LabVIEW using the modbus library.
Sensors that measure pressure are connected to a NI-9203 module in a NI-9174 cDAQ chassis.
Please see attached vi for the control system. The current program lets me control the speed of the pump and will automatically shut down the pump should the pressure in the system increase or decrease, in addition to logging the data from the sensors and motor. Due to pressure pulsations I am using an averaging filter to smooth the data from the sensors.
My issues are that i would like pressure sensors to sample and log data faster than the execution time of the while loop (~160 ms). At the moment im using a 200 ms wait in the while loop and a sample rate of 5 for the sensors to sync them with the time stamp and data from the motor. I'm looking for a better way of doing this.
Another issue is that i sometimes get Error 56 - the network operation exceeded the user-specified or system time limit, which i guess is because the communication with the vfd times out. I have a suspicion that it might be the rs232-usb converter that is causing the problem.
With regards to solutions, purchasing different hardware or software is an option.
I was looking into using seperate loops but i read something about it was not possible to send data between them if they run at different speed, which I need for control of the motor.
I am relatively new to LabVIEW so I might have misunderstood.
Have had limitied time to work on the program lately but here is an update.
For now I've split it into three loops, one which control the motor, one which reads data from sensors and one which writes it to a file, using the Producer/Consumer architecture. I'm planning to use a consumer to use the sensor data to control the motor as well.
Now the motor control loop and the write loop is running at the same speed while the data gathering loop runs much faster. Is there a way to get the write loop to run faster than the motor control loop and just write the same data from the motor until it updates?
Is there a way to get the write loop to run faster than the motor control loop and just write the same data from the motor until it updates?
Hi, I changed my program to use notifiers instead and it works great if the motor control loop runs faster than the write loop, however if the write loop runs faster, the data is not written correctly, even though the timeout for the notifier is included.