Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Delay of PXI control with AI Single Scan

Hello,
I'm using a PXI to measure an analogue signal (force) and control a servomotor (with digital outputs). It is a very simple sequence: move the servomotor forward until the Force reaches the maximum value, and then stop the motor and send the servomotor to the basical position. Repeat this secuence n times.
The problem I have is that the first time the PXI controls the value of the force correctly (for example for 500 N the PXI stops the motor at 500 N). But the following times, there is a delay in each "cycle". The next time the servomotor is stopped at 510 N, the next time at 530, etc.
 
I'm using LabView 7.1. I have two applications: the PXI application controls the servomotor and the PC application shows the measured values (acquired with a PCI board that measures the same force as the PXI) and manages the parameters (Force, servomotor speed, etc) and send them to the PXI.
 
I use a 1031 PXI with a 6025 E Multifunción I/O Board.
The PXI measures at 1 kHz, and the "cycle" time of the PXI application is 1 milisecond.
 
I am using non-buffered acquisition.
 
I can send you my .vi in order to look for the error, if you think the problem is in the software.
 
How could I (with LabView 7.1) debug the PXI application "online" and at the same time run the PC application? I would like to see if the PXI is "seeing" the right Force value or is seeing a wrong value and therefore the PXI doesn't stops the servomotor at the right force value.
 
Thank you in advance,
 
Eugenio
0 Kudos
Message 1 of 5
(4,151 Views)
Hi Eugenio,

Well, there is a way to debug both vis. This is nothing official but sometimes it works fine. You can create a copy of the Labview.exe file and must rename it (eg. LabviewRT.exe). Then you can launch labview once with the original exe and run there your host application. Now you can launch the LabviewRT.exe and load there your VI on the RT-System.
This way it should be possible to debug both systems at the same time.

The llb you attached, was the one for the RT-system? You have code included that is not nescesary and normaly especially with RT-systems everything should be programmed very efficent. Maybe you check the code and simplify it. Its also very hard to understand what the code actually does.

I hope this helps,
RMathews
Ramona Lombardo
Applications Engineer, NI Germany
Certified LabVIEW Developer
0 Kudos
Message 2 of 5
(4,141 Views)

Hello,

I have already tried this way with the two Labview.exe (renaming one of them) but the result I got was that the PXI code didn't seem to run: It seemed that the Ethernet connection with the PXI (for the online debugging) used all the resources for this connection and therefore the PXI code was too slow (this is only my interpretation). Anyway, I couldn't achieve what I needed: to debug both codes at the same time.

Yes, the code I attached is the one running in the PXI.

It works this way:

"A&M_rt_1.1.vi" is the main .vi. The Single Scan is made in this .vi. As you see, the main loop is running in 1 ms steps.

In "Hard setings.vi" the AI Task is configured. I will ask you to check if the setting parameters are right (I want to run a non-buffered acquisition with 1kHz sampling frequence). In the "A&M_rt_1.1.vi", in the "RT Control.vi", the actual value of the analogue input (force) will be compared with the set value and when the force reaches the set value, some digital outputs will be written and the controlled servomotor will be stopped. This is a rough description of the VIs functioning.

Thank you in advance,

Eugenio Acevedo

 

 

0 Kudos
Message 3 of 5
(4,138 Views)
Hi Eugenio,

I am sorry but I cant help you with that. What you want to do seems to be very simple, but your application is very complicated. It is impossible to debugg this for a person who has not written it.
On the other hand I have never worked with trad. DAQ. So I dont know the functions very well.
For me it seems that you have a great deal to much code programmed. I am sure this can be done much easier.
I think you have to debugg it yourself or simplify your code, so its better to understand.

Sorry I couldnt heip you!
RMathews
Ramona Lombardo
Applications Engineer, NI Germany
Certified LabVIEW Developer
0 Kudos
Message 4 of 5
(4,118 Views)

Thank you for your answer. I have found the problem.

I have just changed the acquisition mode to "read newest samples" and it works. The PXI controls now the force "on line" and there is no delay.

 

Thank you anyway,

Eugenio

0 Kudos
Message 5 of 5
(4,008 Views)