07-20-2017 09:18 AM
Hello Community,
Does anyone know the syntax off the top of their head to reference a curve channel in Report 2D-Axis label? I'm trying to label the X-axis with the Waveform x-unit using:
@@Data.GetChannel("[18]/WindupFFT_tag_5.00").Properties("wf_xunit_string").Value@@
But instead of "[18]/WindupFFT_tag_5.00" , I would like to use a generic channel reference to the curve channel. Can't seem to make this work using the same syntax that works in a script...
Thank you.
Solved! Go to Solution.
07-20-2017 10:07 AM
Hey,
What exactly do you mean with "generic channel reference"?
Where and how do you want to define the channel that is used?
You can create a new axis system, add any waveform channel to the axis system, double click the x-axis label and you will get this "generic" reference:
@@ChnName(CurrChnNo)@@ [@@ChnDim(CurrChnNo)@@]
If you drag and drop the waveform unit property to a script you can get its VBS code equivalent that can be copied to the x-axis label like you already explained it. This will also work but will be fixed to a specific channel whereas my previous example with CurrChnNo will use a channel that matches the axis position.
07-21-2017 11:49 AM
HI Christian,
Thanks for your response. What I didn't realize was that when graphing a waveform channel, using the label
@@ChnDim(CurrChnNo)@@
for the Y-axis gabs the "Unit" property of the curve channel, whereas applying
@@ChnDim(CurrChnNo)@@
to the X-axis label grabs the Waveform x-unit. I thought this syntax was referring to the same curve and thus would return the same value in both instances, but that is not true.
Is there some way to generate a MsgBox or debug output when applying @@<code>@@ in a report so that you can see what the code actually references? The way I had to figure this out was to assign @@ChnDim(CurrChnNo)@@ to both axis labels and then look at the list of properties for the curve channel to see what property it was actually referring to...
Thanks for your help.
Chris