DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting a report.

Solved!
Go to solution

I've done the following steps:

Created a report (page) template.

    Each page has 4 charts

       1. X, Y , Z plot (accelerometer data)

       2. FFT transforms of (1). 

3 and 4 are the same for the next channel, and there are 5 channels total.

 

Looking at the Curve and Axis definition dialog, it shows the type, color, Y-Axis (which are all Y1), X-Channel (blank), and Y-CHannel (my data).

 

What I am trying to do with my script is get it to step through all of the data and plot it using the specified template.

Each channel is labelled "N X (Filtered)" where N is 1 - 5, and there is an X, Y , and Z.  The FFTs are labelled: "N X (Filtered) FFT" with the same set of channels.

 

Hope this makes sense. 

 

Thanks.

0 Kudos
Message 1 of 10
(6,357 Views)

Hi Worldtraveller,

 

Would you submit or email me (brad.turpin@ni.com) the data, TDR file and VBScript you have so far?  I have some code that I can adapt to sequence through your channels, but the adaptation will depend on the structure you have in the Data Portal and also the way you've laid out the graphs in the TDR file.

 

Brad Turpin

DIAdem Product Support Egnineer

National Instruments

0 Kudos
Message 2 of 10
(6,322 Views)

On its way.

 

The layout in the report isn't set in stone, if it's easier to do one channel and FFT per page than two, I can easily live with that when producing the final report.

 

 

0 Kudos
Message 3 of 10
(6,314 Views)

I've made some progress.

 

Using the 'Copy as Script' command in the report template, I have the following line:

 

Set o2DLine = o2DAxisSystem.Curves2D.Item(1).Shape

 

And it's giving me the following error:

 

The index "1" is outside valid range

 

Not sure if this is enough context to figure this out, but I don't understand enough of what the script is doing to know why I'm getting this error.

 

 

0 Kudos
Message 4 of 10
(6,254 Views)

Brad, can you verify you got my email? 

 

Thanks.

0 Kudos
Message 5 of 10
(6,247 Views)
Solution
Accepted by topic author Worldtraveller

Hi Worldtraveller,

 

I emailed the solution I created directly to you, yes.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 6 of 10
(6,214 Views)

It worked great! Thanks.

0 Kudos
Message 7 of 10
(6,198 Views)

Brad,

Thanks for your help. There appears to be an error (somewhere) with the script.

I am processing 6 data files. The script works great on 2-6, but for some reason the following happens in File1:

1) All of the report sheets in Diadem show with the names 'Sheet 1, Sheet2', etc, and not the channelgroup names.

2) The export to pdf exports the correct number of pages, but all of them are duplicates of page 1 (so I get 50+ pages that are identical).

I've tried the following troubleshooting:

1) Re-ran the script with just File1, same results as above.

2) Re-ran the script with just File2, same result.

I suspect, based on this, that there is a logic error (somewhere) that only affects the first loop. As a workaround, I will next run the script with a dummy file and the actual file1  to see if I can get a good result (I really need to get this report done and off to the customer).  I will take a look at the script later and see if I can figure out the error, but if you have time, I'd like your input. I can send you two files, or you can just duplicate the one I sent you and give the channelgroupss some different names to easily discern which is which.

Cheers.

0 Kudos
Message 8 of 10
(6,193 Views)

FYI. The workaround worked, so there's def something wrong with the logic in the first loop through. I have an idea, but it'll have to wait until I can get this report out to the customer and revisit the script.

 

Thanks again for your help Brad. This would have taken me weeks or more to script on my own (and months to do it manually....).

0 Kudos
Message 9 of 10
(6,192 Views)

Hi Worldtraveller,

 

Would you please email me that 6 test data set?  I'd like to look into this and get you off that workaround.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 10 of 10
(6,185 Views)