03-16-2011 05:21 PM
Hello,
I'm trying to use IronPython through Visual Studio 2010 to build some automated tests of a PXI device I have. Most of my API (and Python) knowledge so far has been coming from this Iron Python thread. Although very helpful. I'm not able to get the Stimulus profile parts working. I do have basic control over the line forcing an output voltage from the DAQ, but I was hoping to use the far more high level control provide by VeriStand.
My methodology so far has been 1) Create a Stimulus Profile in the editor (something simple like an offset sine wave) 2) I don't specify a specific channel in the profile (because I want to use the same waveform across multiple channels, sequentially) 3) Save 4) Point the Python script at the sinewave.nivstest file 5) Run. Is there anything wrong with this process?
The problem is that 'running' doesn't really do anything. I'll have to investigate this further with my scope, but the output does something (it almost starts working!) but for something that should be ~20 seconds long, it ends immediately after the first 'blip'.
I'm using Iron Python 2.7, VS 2010 Shell. If it matters for any reason, I'm using a NI Custom Device, FPGA card, and DAQ. And as far as I can tell forcing SetChannelValue(X) works for all the outputs.
Thanks much!
Solved! Go to Solution.
03-17-2011 09:05 AM
It's probably because you're playing a stimulus that has no mapping. Does the same thing happen if you specify a mapping in the profile?
Unfortunately, there is no API in NI VeriStand in 2010 to change the mapping. So whatever you specify when you create it with the GUI is it. However, The nivstest file is actually just XML so you can use any XML parsing and editing API to change the mapping. If you don't want to use an XML editing API, you can try using the technique in the VI posted on this thread to change the mapping.
03-17-2011 09:47 AM
Stephen,
I added a stimulus mapping and you are right that does fix the problem.
From a high level I was trying to associate a stimulus profile with a channel so I could use the same profile on different channels for testing. Examining the code shows that I certainly didn't do that properly. I see your mention of the XML mapping... that might be a solution. I don't have access to LabView at the moment. Are those the only real possibilities? Should I be setting up stimulus profiles differently using a playback generator or would that still run into the same problem?
Also, I suppose the only reason I'm using the Python API is because I want to execute generators on specific channels sequentially, my tinkering with VeriStand only seemed to result in a massivly parallel test, do you know of any guides/user manuals that point out how to accomplish this? I looked through the existing VeriStand Help but didn't find anything. Should I be building procedures as well?
03-17-2011 09:51 AM
Unfortunately there is no way to have one profile be played on different channels.. Because the mapping is saved into the profile and cannot be changed with any API (other than XML editing the profile file). This is something we hear a lot and will be improved in the future. The same thing goes for running multiple profiles at the same time.
I don't know what you mean by massively parallel test. Your python script should execute sequentially. So if you set some values, then play a nivstest file, then play a different nivstest file.... etc... it should all go sequentially.
03-17-2011 10:01 AM
Also, I suppose the only reason I'm using the Python API is because I want to execute generators on specific channels sequentially, my tinkering with VeriStand only seemed to result in a massivly parallel test, do you know of any guides/user manuals that point out how to accomplish this? I looked through the existing VeriStand Help but didn't find anything. Should I be building procedures as well?
I should have been more clear, this question was directed at using vanilla VeriStand without the Python API.
10-01-2011 08:15 AM
04-21-2013 12:50 AM
Hi Jarrod, this looks like what I'm trying to do as well. In your previous post you provided a link, but it appears to come back to this same thread. Did you mean to put a link to a different post? Thanks.
04-22-2013 06:50 PM
I believe he was referring to steps 4 and 5 of this document.
The idea being that you can write a Real-Time Sequence and call it from multiple different Stimulus Profiles for different system definitions and channels.
04-23-2013 08:30 AM
h_yong,
I've since moved to VeriStand 2011 (and soon to 2012) and the new Stimulus Profile Editor is much more complete and feature rich than 2010. I gave up on this route trying of to control the Stimuls Profile API through Python because I would have had to edit xml files procedurally as I went through my custom sequence. Plus 2010 doesn't have the parallelism that I needed.
I know upgrading isn't always possible, but if you can, I'd recommend it. Hope that helps!
04-23-2013 10:05 AM
Hi,
Yes, I am on 2011 now too. Thanks.