LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Performance issue of a standalone vi in Win7

Hi all,

 

I've created a project which is completely running in FPGA Target. After I created a standalone vi which resides under My Computer in project, I saw that loop rate become 100 ms. On the other hand, the loop rate was about 20 ms in RT side. All calculations and control mechanism work in FPGA Target so I thought that I may not need to use shared variables. I thought that I could send the input values that are needed by FPGA Target with using "Open FPGA VI Reference" only. Do you think that I can do this? 

 

Another question is that is there any option in LabVIEW to increase performance? Like use 4 core of processor or 4 GB ram?

 

Best regards,

 

 

Actor Framework rocks!
Emre TUZUNER
0 Kudos
Message 1 of 6
(2,496 Views)

Hi etuzuner,

 

too less information...

 

A project running in "FPGA target" that now runs as "standalone VI" under "My Computer"???

Why do you run a FPGA vi on PC?

Why do you compare loop times of different targets?

Where did you use shared variables?

OpenFPGA-VIReference does what it's names suggests: open a FPGA VI reference. How do you want to send "input values"?

Do you mind to share some VIs?

 

Yes, there are options to increase performance. There's a section in the context help on "memory usage and performance"! There are options in the FOR loop, explained in the context help! There are SCTLs on the FPGA! Read the manual...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(2,483 Views)

Hi GerdW,

 

First of all, thank you for your quick response.

 

Sorry, I couldn't explain it well. I've attached some screenshots of my work. (By the way I am a newbie. So I may know some ideas or structures not so well.)

 

* I've never tried to build application before. I've always studied in Real Time. I want to create an application (executable file) so that user can control the system independently from LabVIEW. When I was working in RT, I didn't have any problem with timing. I had timing problems after I started to work in PC. Is there anything that I miss or anything that I know wrong with this?

 

* As I said above, I always worked and created vi files in cRIO. I thought that there is no need to work in RT if FPGA Target does everything. So I created a vi under My computer and I used Open FPGA VI Reference. As you can see from the picture, IP number appeared on reference. Can I use this way, right?

 

* I have a lot of values as controls in FPGA. FPGA takes frequency, offset and amplitude for 4 different sine wave generation vi. There are manuel control inputs (setpoints, proportional gains, etc.). Anyway, there are about 60-65 variables which are needed to be sent to FPGA. (single precision, integer or FXP variables) After that there are few things to be done outside FPGA like counting cycles of sine wave, finding max values of variables (displacement, force, etc.). I wanted to these in FPGA but there is not enough space in Slices. (You can see from file in the attachment.) Do I need to use RT? Because if I have to use it, those variables should be shared variable, right?

 

If I'm not still clear, please let me know. I will try to share more information and file.

 

Thanks in advance,

Best regards,

Actor Framework rocks!
Emre TUZUNER
0 Kudos
Message 3 of 6
(2,458 Views)

Hi etuzuner,

 

I don't think you can call the FPGA directly from your PC.

 

- As you can see in the project the FPGA is located as sub-tree in the cRIO part. So the cRIO is responsible to talk to the FPGA: in the cRIO is the 'real' hardware connection and here you have to provide software for communication...

- You can create standalone executables for the cRIO too.

- You can create VIs/EXEs on the PC that talk to the cRIO...

- Using so many controls/indicators is not the right way to use the FPGA (IMHO). You already used the whole FPGA (100% of slices)... You could use arrays, FIFOs and so on to communicate from cRIO to FPGA.

- There are a lot of examples coming with LabVIEW. Did you ever notice them?

- There are some pre-made projects coming with LabVIEW. Some of them address all those RT targets and even provide a framework for FPGA communication. Did you ever notice (or study) them?

 

Read the help.

Go through all online courses offered by NI.

Read KB entries on the NI website.

 

Rethink your project...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(2,447 Views)

And just to add one more point.

In your main vi on the PC, you have not just one but 3 greedy loops fighting for the CPU time. That is very bad programming. 3 while loops like that need some kind of wait in them, i.e. with the use of the "Wait (ms).vi".

 

To get a better understanding of the cRIO, take a look here: NI LabVIEW for CompactRIO Developer's Guide

Message 5 of 6
(2,444 Views)

Hi GerdW,

 

In RT Host, everything works fine. Those vi's work very well individually. Also I had a vi which includes all Read/Write Control in RT Host and loop rate was about 20-23 ms which suits for me. Problem occurs when I want to create an executable vi. RT Host and PC Host vi's are identical. But directly reading/writing values from FPGA by using Open FPGA VI Reference slows down the procedure. So now I'm going to use shared variables to transfer values from RT Host to PC Host.

 

I really spent so many times to read getting started documents and forum discussion and I'm still spending. 🙂 But sometimes it is very difficult to understand the concepts in LabVIEW which may be very simple for advanced users like you. Again thanks for your help and advice.

 

dkfire,

 

Thanks for your advice. As I said above, the vi's that I call in those loops work fine individually in RT Host. They need to be together because they can be used anytime. When I press 25 kN which has "Latch when released property", it goes into that structure and then 25 kN.vi open directly. When I press stop button, it quits the loop. Anytime I want that to work, I can press 25 kN button and it opens with reinitialize valued values. The stop button of 25 kN.vi makes true a case structure that includes "Default.Vals.Reinit All" Invoke Node. After that it quits the loop. Do you have any suggestions to create a control like this without using 3 while loops as I did?

 

Best regards,

Actor Framework rocks!
Emre TUZUNER
0 Kudos
Message 6 of 6
(2,434 Views)