LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Abnormal behavior observed in real-time executable.

Solved!
Go to solution

Hello,

 

I'm having an interesting problem. I've been developing an embedded Real-time/FPGA application for cRIO 9024, and come across an issue I don't understand. I have working FPGA and RT top-level and subVIs, proven individually and together when run interactively. When I build and deploy a real-time executable as startup, however, the behavior changes. I have posted code below, which I will explain briefly:

 

I have a state machine architecture with 5 states. "Initialize" and "Shut Down" are encountered exactly once every time the device is rebooted, and the cycle between them is Wait > Pretest > Wait > Run Test, and repeats as many times as desired. Measurements are taken by FPGA and passed to real-time by DMA FIFO, and are then recorded to TDMS file by the real-time. Everything else is just interface. 

The problem comes the first time the program enters the Run Test case. The FPGA sends measurements like normal, and they are stored in a growing array buffered in the fixed-point shift register shown below.

 

Problem Loop

 

Running interactively, this method successfully reads, buffers, sorts, and writes all data to the file. However, in the real-time executable, only data collected in the first iteration (147 elements total, as initialized by the integer shift register) is recorded, the rest seems to remainsin some buffer ?? until the next TDMS Write function is called, which is in the following Pretest case. 

 

I am unable to debug the real-time executable, probably because of the FPGA references or some other diagram components. I have tried to replace the current buffer with a real-time FIFO, a shared variable with RT FIFO enabled, and tried writing inside the loop. The FIFOs don't improve the situation, and when writing inside the loop, the loop does not run quickly enough to keep up. 

 

The problem does not occur when I run the VI interactively from my computer, only when I attempt to deploy the entire embedded application, all of which works (as far as I can tell) except this one spot. 

 

Any ideas to solve, or workaround solutions?

 

Ryan

0 Kudos
Message 1 of 5
(3,250 Views)

Also, I have tried replacing the TDMS write function with a Spreadsheet write function, which produced identical results.

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

Another attempt today used a local variable to store the data, rather than the shift register, but the loop does not run fast enough. I also tried writing to the local variable after the loop, instead of in the loop, but get identical results as with only the shift register. Somehow, the first iteration data are stored completely separately from the rest.

0 Kudos
Message 3 of 5
(3,220 Views)
Solution
Accepted by topic author rjmartinator

Tech support helped me resolve the issue, the loop condition caused early loop termination, although I still don't understand why behavior was different as an executable, because the loop condition worked fine in interactive mode, so if anyone has ideas as to why, I'd still like to know.

0 Kudos
Message 4 of 5
(3,217 Views)

You should make this thread as solved.

Tim
GHSP
0 Kudos
Message 5 of 5
(3,214 Views)