07-13-2011 04:35 AM
I am running a control system on a compactRIO. Windows auto update rebooted the computer from which I launch the system this morning, and in principle the compactRIO should have continued to run. Instead, however, it froze and I had to manually restart it. Do you know what the reason might be? For your information, I will say that for the purpose of emailing alarms, we have some shared variables sitting on the computer and alias-linked to other shared variables sitting on the compactRIO. This is the only connection between the compactRIO and the computer during run time.
07-13-2011 05:27 AM
And how are you starting the program in the RIO? Is it a startup exe file ?
Are you handling error with the shared variable on the RIO?
07-13-2011 05:50 AM
Thanks for the quick reply.
This is not an exe file. There is a VI called slowcontrol-rev3.vi that is found under the cRIO in a project explorer window. I double-click on that file and launch the VI by clicking on the arrow.
I don't know what you mean by handling error with the shared variable. I'll try to explain again. There are two shared variables: one sits on the cRIO and gets written to during the main program. The other sits on the computer, is alias-linked to the one that sits on the cRIO and gets read by another VI that runs on the computer. Are you suggesting that I wire the error into and out of the step where I write to the variable?
I am attaching screen shots for ease of understanding.
1) Project.png shows you the project explorer, where you can see the shared variables called "Flow", one on the computer and the other on the cRIO, and the "slowcontrol-rev3.vi" (the main VI, which runs on the cRIO) and "Send-Mail-SMS.vi" (the auxiliary VI, which runs on the PC).
2) SendMailSMS.png shows the block diagram of Send-Mail-SMS.vi, in particular the step where we read from the PC shared variable "Flow".
3) WriteToFlow.png shows the main VI, "slowcontrol-rev3.vi", which runs on the cRIO, in particular the step where we write to the cRIO shared variable "Flow".
07-13-2011 06:22 AM - edited 07-13-2011 06:26 AM
Okay, first one "small" issue with your architecture.
When working with a cRIO, you normally DON'T see the vi's front panel that is running in the target.
It is an embedded target, and therefore no vi has front panels!
If you what to get some feedback from the controller, you transfer that data to a host vi on the PC with shared variable ( like you do for flow ) or some other network communication.
You will build a exe file to run on the target, this exe file you you can setup to be a startup program, that runs when the cRIO gets power.
When you are running the code like you are doing now, with a click on the vi, the PC is communication with target, letting it know the vi is has to run. But it is also doing a large job in trying to sync with the target to "update" the front panel of the vi. This is taking a lot of power on the communication and on the target.
When the PC loose connection to the target, with a reboot, the PC has NO idea of what code is running in the target, and therefore is can not sync any front panels. And as the target is already running a program, the PC can't ask the target to start another program, even if it is actually the same.
Have you take some of the Real-time courses?
Or looked here: http://www.ni.com/compactriodevguide/
07-13-2011 06:27 AM
And to answer you question, yes you need to look at the error cluster coming from the shared variable connector.
07-13-2011 06:31 AM
Thanks again for your very prompt reply. What you say is very interesting, I was not aware since I did not take any of the real-time courses. What I can say however, is that I remember having an exchange with an engineer from National Instruments who told me that even in the setup that I have, closing the front panel window should continue to have the VI run on the cRIO, and if I was then to right-click on the cRIO and select "Conect", the front panel would again come up and the VI would be still running. This was, however, at a time when I didn't have alias-linked shared variables on the PC and the cRIO. My question, then, is why it is not working any more, and whether it's because of the shared variables or not.