04-20-2020 11:18 AM - edited 04-20-2020 11:18 AM
Hello guys,
my most complex VI took too much CPU on my cRIO so I tried isolating the problematic code and what came out was really unexpected. I attached the test VI and would be glad to get some advice why is it happenning.
Two FIFOs. They have writing enclosed in case structure, which is connected to a control (!important). Both of the structures are enclosed in another case structure connected to a control. I have fifo1 and fifo2 set to FALSE permanently, so there is actual no writing. When the topmost boolean is set to TRUE, CPU usage is about 4, but when i set it to TRUE, the LV takes a lot of CPU (~ 40). No writing to FIFOs involved at all. Just pure LabVIEW unpredictability.
Tested on both cRIO and Windows 10, LabVIEW 2019. If you will play with the Numeric, you can adjust the CPU usage. 100 for cRIO and 5000 for PC worked fine.
04-21-2020 03:18 AM
Strange behavior indeed! It seems that it works normally if you force the two case structures to be executed serially. I would also like to know why this is happening.
04-21-2020 06:20 AM
Doesn't explain much, but for me at the moment, what you found is fine workaround, thanks! Should I report it as a bug?
04-21-2020 06:51 AM
Yes, please report it to NI support and post here the CAR number if you receive one.
05-18-2020 01:13 AM
NI reply (translated):
I escalated your question to my colleagues, we found no workaround but to serialize the Case Structure so they agreed to bug report. Its number is BUG 1027464. We can expect the solution in one of the following versions of LabVIEW. I have set the service request status to Closed.