Benchtop Measurement and Test
Distributed Measurement and Control
Systems Engineering Software
Perspectives showcases how NI sees what’s next in the world of test and technology.
You can request repair, RMA, schedule calibration, or get technical support. A valid service agreement may be required.
Provides support for NI data acquisition and signal conditioning devices.
Provides support for Ethernet, GPIB, serial, USB, and other types of instruments.
Provides support for NI GPIB controllers and NI embedded controllers with GPIB ports.
Support use of relative path for image file pathname in message popup step options.
Relative paths make reuse and maintanence easier for me.
Image file pathnames are the only part of my code that breaks when I rename my project directory.
While I don't disagree that this is a good idea, juat as an FYI, one option would be to import the image into the step itself (File Source >> Step). However, this does of course reduce code reusability a little.
The step type already supports relative paths by using the search directories, so if the image file is in the same directory as the sequence file, and default search directories settings are used, the file will be found at run-time. Can you clarify what additional options that may be wanted for this ideas exchange item?
It would be nice to simply use
as the File Pathname.
For now, I'm using the "File By Expression" with the following expression:
Left(RunState.SequenceFile.Path, Find(RunState.SequenceFile.Path, "\\", 0, False, True)) + "\images\expansion_module\connect_wires.jpg"
As Scott said, it should already work exactly like you are asking (At least in recent versions of TestStand). If the path "images\expansion_module\connect_wires.jpg" is relative to the sequence file or one of the other search directories then that is all you need to specify. See the screen shot with Scott's post above for details.
Hi Dug9000 and Scott
For popup image paths, relative paths like "images\wires.jpg", do not work as they do in every other case. WHY?
Of course, if the file is in a search path, and you specify as "wires.jpg", TestStand finds it.
I strictly avoid adding paths to the Search Directories because I want to avoid using any file from an unintended location. I like to specify relative paths to each module.
For popup image paths, I use something like Jeroen's solution, which is relative to SequenceFile.Path.
Relative paths for images should work the same way they do everywhere else in TestStand. You can specify folders too like you are wanting "images\wires.jpg". TestStand's algorithm is not restricted to simple file names. If your path is relative to the sequence file, then, with the default settings for teststand, it should work. If it's not working for you please provide more details and I will help you determine the cause.
Also, you might have some misunderstandings about how search directories work. Please see the following forum thread for more details (especially my posts near the end):
I agree that "Relative paths for images should work the same way they do everywhere else in TestStand."
But they don't; I wish they did; that is the point of this idea.
For other steps, I can select relativepath:
For Message Popup steps using file in relative subdirectory I do not get that option:
It seems to find it at runtime though.
What version of TestStand are you using? Did you perhaps remove or disable the search directory for the "Current sequence file directory"? I am not able to reproduce this problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What do you need our team of experts to assist you with?
We'll be in touch soon!