12-05-2017 09:02 PM - last edited on 03-14-2019 02:18 PM by NIadmin
I've run into an issue where if a network connection is interrupted between a cRIO client and a SystemLink server, tags being written to from the cRIO take a long time to update again, or seemingly stop working completely. Steps to reproduce:
The code attempts to reopen the tag for each write, which I would have expected would force it to recover from any network interruption. Is there something I'm missing, or is this a known issue?
Solved! Go to Solution.
12-05-2017 09:08 PM - edited 12-05-2017 09:24 PM
I've just noticed that the longer the cRIO is disconnected from the network, the longer it takes to recover. For example I had just disconnected the cRIO for about 3 minutes, and it took close to 30 minutes to recover. If I disconnect it for 15 seconds however, it recovers almost straight away.
Edit: It looks like the tag updates have died again, though the cRIO was connected the whole time since the 3 minute disconnect and 30 minute recovery. The tags were only up again for maybe 5 minutes.
Edit 2: Also worth noting that one of the CPU cores is stuck at 100% usage (on a cRIO-9067) all of the time, regardless of connection or tag state. If the Skyline VIs are removed, CPU usage is almost 0%.
12-06-2017 08:57 AM
Can you try using HTTP instead of using AMQP? This can be done by dropping an Open Configuration down before the tag write and connecting it to the tag writing VIs. It should also be available from the Skyline palette under "Configuration". AMQP is used by default.
12-06-2017 11:56 AM
I think 17.5 will help address some of these issues. I recreated your application and deployed it to an RT system. I shutdown my server for 30 minutes and when I powered it back up my target connected in less than 20 seconds.
The high CPU usage is a known issue when using AMQP. We have a background thread that is constantly trying to check for new messages that is running faster than it should, however it seems to yield if there are other things going on. In my cases it just looks worse than it actually is, but regardless we are working on a fix.
12-07-2017 12:05 AM
The HTTP config seems to have done the trick, both in terms of tag recovery and low CPU usage.
As a general rule, when would it make sense to use AMQP or HTTP as the config type?
12-07-2017 08:19 AM
The nice thing about AMQP is it uses the machine's credentials that are automatically created when you add the target to the server. HTTP requires you to hard code your username and password into your application, which makes it a lot harder to revoke and update in the future.
In general, we recommend AMQP for "managed" systems where you want to control where they data flows by registering the system to the server. It's great for headless systems like RT.
We recommend HTTP for client applications being used by a user. Like an application running on your laptop (most likely not managed by the server) that you may want to pull data from multiple servers and use the users credentials.
In addition, we only support asynchronous operations over AMQP, which is exposed in the Message and File APIs.
12-07-2017 06:37 PM
Thanks for the great comparison Joshua.
12-08-2017 08:29 AM
We have a fix for the high CPU usage when connected over AMQP and it will be included in the 17.5 release next week as well.