02-04-2009 01:37 PM
I'm building a generic test application for a customer. We use a configuration (XML) file format that is basically a big cluster of all the things we need, such as an array of channel configuration clusters (name, physical channel, calibration, etc.), an array of filter settings, sample rates, log file names, etc. The target VI starts and waits for a configuration. The main VI starts and prompts the user for the test configuration file. It's loaded in and sent to the target, which initializes all the devices and channels and starts running.
This is all fine a good, but right now the test criteria are hard-coded in the target VI and that ain't good. The customer wants to be able to specify arbitrary test criteria, which may vary from test to test. The test criteria could involve averaging, FFT, etc. so I had this crazy idea to use a separate VI to represent the specific test criteria. The config file would have the file name for the test criteria VI. The end user would develop the test criteria VI to suit the particular test needs. Then somehow, the VI would get to the RT PXI target and execute. I know how to reference the VI on the host and have developed a simple prototype of the concept, but I don't know how to get the VI to the RT target programmatically at run time.
02-05-2009 02:02 PM
02-05-2009 03:00 PM
How will it get all the dependencies? When I tell it to run, will it fetch the additional VIs it needs?
02-06-2009 08:36 AM
02-13-2009 11:10 AM
knicewar,
I wanted to give you a little bit more info about what happens when a program is deployed to a Real-Time Target. When you deploy a program to an RT target, the program is loaded into memory, not onto the disk of the target. In your situation you could FTP a VI onto a target in the c:\ni-rt\startup directory. Then in your main program you can use VI server to launch the VI you FTP'd to the target.
02-13-2009 11:17 AM
Hmmm....
No mention of a configuration file. Did you concider reading the config from a config file? The new config file could be palced where it has to be using FTP when it needs changed.
Just trying tohelp,
Ben
02-13-2009 11:21 AM
Hi Jon,
I wasn't aware that deploying a VI doesn't actually send a file. If that's the case, then I don't care about FTPing the VI over. All I want to do is deploy a VI (to the RT target) and the VI was specified in a config file that the host VI loaded at run-time. Am I going about this the wrong way?
02-16-2009 05:14 PM
knicewar,
When you deploy a program to an RT target, the currently running program is stopped. I think in your case your going to want to FTP the user made VI over to the startup folder and use VI Server to call this from the main VI running on the RT target.
02-17-2009 05:09 PM
BTW, this seems to work. I haven't built the full-up app yet but I tried a simple test. I FTP'd over a VI file then ran a VI on the target that opens this file by reference and calls it. It works even if the VI calls another VI. Somehow it figures out the dependencies and does the Right Thing. I did not have to FTP over the dependencies. <whew!>
02-18-2009 09:44 AM
I am trying to view the knowledge base article that you reference as I have the same question. However, every time I click on the link I get an error message that says you are not authorized to view this article. I have tried searching the article through MyNI page and though I find a reference to the article in the search I still get the same error.
Any idea as to why?
Jason