04-01-2021 02:39 AM
Hello the forum.
I want to programmatically export the NI MAX configuration each time my application starts. To accomplish this task, I use the Export VI that belongs to the nisyscfg library.
This piece of code runs fine the most of the time, but it happens sometimes that the Export VI hangs and never returns. In this case the application is stuck and the only way to continue is to abort it and restart it.
I would like to add some code to automatically kill the process/service that causes the Export VI to hang and then run it again.
I did some tries:
1. I tried to implement this by invoking the sub-VI that contains the Export VI and then abort it in case of timeout, but this method doesn't work (a pop-up telling that the sub-VI is resetting appears, but it hangs infinitely)
2. I tried to manually kill the NI Configuration Service service by using the command prompt, but no luck, the Export VI continues to hang
Do you have an idea about how to solve this issue?
Please find attached the main VI and the sub-VI that I used.
Thanks
04-01-2021 09:13 AM
@aRCo wrote:
Hello the forum.
I want to programmatically export the NI MAX configuration each time my application starts. To accomplish this task, I use the Export VI that belongs to the nisyscfg
Don't do that! It will likely work fine most of the time but hang whenever MAX needs a save to apply configuration changes.
So, let's ask why you want to do this thing. There has got to be a reason and I bet you a kudos that there is another way to preserve the information you really want without creating a *.nce file that you can't read easilly without MAX anyway. Simpler and robust! Let's go thataway.
04-02-2021 03:13 AM
Thanks J?B for your answer.
For your information, the issue comes even when MAX is not opened at all (i.e. nothing to save or to apply).
The way I generated the issue was to just run continuously the MAX_ExportNIMAXData(simple).vi. This can be easily reproduced on no matter which PC having LabVIEW and MAX installed.
I think that the Export VI should be improved to avoid hanging and return an error if something goes wrong during the export process.
Concerning a workaround for this issue, do you have an idea?
Marco