12-06-2012 03:18 PM
All,
As part of a larger "application", we generate a number of measurand vs time graphs of data from our testing. We are now trying to add several additional graphs of this type, but this time including signals (curves) on each of the additional graphs, and the graphs need to be created exclusively by a script. The desired results are shown in the attached file ("Desired output_script generated 2-curve plot.jpg"). However, after executing the attached script ("Report Generation Script_2 Curves.PDF"), it appears that there are no curves displayed on the resultant graph, as shown in the attached file ("Actual output_script generated 2-curve plot,jpg").
The bulk of the code for creating the graph was captured using the "ctrl-A" method on the "Curve and Axis Definition" dialog box after manually setting up the desired graph. After transferring the captured code to the script, additional lines were added to create the various objects (axes, curves, etc.) as new objects (since the final graph will be generated "from scratch"). I have used this method before with very good success.
This problem seems similar to one I had previously encountered (and posted information about) when trying to add a constant (horizontal line) to an existing measurand versus time graph. Because of this similarity and the resolution to the previous issue, I have added the PicDefByIdent = 1 directive into the scripts, but the same behavior results whether this directive (and the associated "name-oriented" curve definition) is included. Also, PicUpdate is called at the end of the script.
We are using DIAdem 11.3 (with TDM Service Pack 1).
Any assistance anyone can provide with this issue will be greatly appreciated.
Regards,
Bill Evans
720-988-3436
Solved! Go to Solution.
12-07-2012 04:29 PM
Bill,
I'm looking into your issue and researching it a bit, but I have a few things to try right now.
First, once you run the script, could you try refreshing the Report screen? PicUpdate should take care of that, but it certainly doesn't hurt to rule that out as a possibility.
Second, I found this example on our site about creating a new graph and plotting to it: https://decibel.ni.com/content/docs/DOC-3994
And one thing I notice about this example is that they assign the channels with D2CChnXName and D2CChnYName rather than D2ChnX and D2ChnY, so here's an example of what their channel definitions look like:
D2CChnXName = "EXAMPLE/Time"
D2CChnYName = "EXAMPLE/Speed"
I would suggest changing that within your own code and seeing if it makes a difference. It's possible that setting the "name" variables instead of just the X and Y will resolve the issue.
If these steps don't solve the problem, feel free to post back, and I'll be happy to work on the issue further and help you figure out why this isn't working.
12-10-2012 07:58 AM
Daniel,
Thanks for the information. "Manually" refreshing the Report screen did not make any difference in the results I am seeing (PicUpdate apparently did refresh screen as expected).
However, using D2CChnXName and D2CChnYName to specify channels instead of D2CCHNX and D2CCHNY DID produce the expected graph with both curves we desired plotted on it. I used D2CChnXName and D2CChnYName with the appropriately formatted channel references as shown below:
D2CChnXName = "[6]/" & Data.Root.ChannelGroups(6).Channels("TIME-LumbarSpineShearForce_IARV").Name
D2CChnYName = "[6]/" & Data.Root.ChannelGroups(6).Channels("LEVEL-LumbarSpineShearForce_IARV").Name
Thank you very much for your assistance and the information which resolved our problem.
Regards,
Bill Evans
720-988-3436