Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Real time and user interface disconnecting?

Solved!
Go to solution

I'm using a myRIO. Issue here is when I'm running the User Interface.vi the network stream connection between the RT and UI disconnects. It happens when there's an action prompted by the user in the UI. CPU is typically 80% when running this communication. I figure the CPU is a bit high but not 100% so I'm not sure if that's the issue. Initial thoughts/things to look for? New territory for me in general so please be constructive. . 

0 Kudos
Message 1 of 6
(2,768 Views)

Do you have high priority stuff like timed loops? I'd look there first since that can preempt other tasks. I would definitely do some testing to see if bringing down the CPU use helps your issue. Also, it's probably useful to look at both CPUs individually. Are both at 80% or is one at 100 and the other at 60?

0 Kudos
Message 2 of 6
(2,751 Views)

After I posted I saw an older post where someone messed with the timing of loops and that fixed it, so I'm going to be digging for that today. Both CPU are at 15/20% when nothing is happening then the first CPU is at 80% like I mentioned when an action is triggered on the UI and the second CPU is at 70/75%.

0 Kudos
Message 3 of 6
(2,730 Views)

Ok so I was monitoring the CPU values by continuously refreshing the remote system in NI Max. I assumed that was just updating the values on the screen, but oddly enough right when I hit refresh it spikes the CPU. So odd. I monitored the CPU from the code itself and it's normal at about 10-20 for both CPUs even when the program disconnects. 

Therefore the disconnecting is not due to the CPU spikes caused by me hitting refresh. I've been narrowing it down and it disconnects when the Real Time vi sends a single element to the User Interface vi. through the network stream. I've checked my network streams and from my understand they are set up correctly. Anything major I should be on the lookout that is causing this problem? Something to note, in the Real Time vi in multiple places it's writing(sending) data through the stream. My only guess for it crashing the stream would be it becomes over loaded with data too quickly. Let me know some thoughts. Thanks!

0 Kudos
Message 4 of 6
(2,695 Views)

What's your disconnect error on each side? Do you have high priority stuff like timed loops?

0 Kudos
Message 5 of 6
(2,684 Views)
Solution
Accepted by breezy45

So the CPU spike was actually caused by me physically refreshing the remote target in Max to monitor the CPU values....I'm not sure why I was doing that. Once I had it display the CPU value in the code itself there wasn't a problem. Therefore the issue wasn't a CPU problem. For the sake of it, the code typically has the CPU run 15-25ish on both.

The disconnecting problem was due to a error being thrown deep in the code which got picked up by the error handler which forces the disconnect. Now the error has been resolved so no more disconnect.

0 Kudos
Message 6 of 6
(2,633 Views)