Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Upper case _Avg on CR3000 table name suffix


AMK Aug 15, 2013 08:50 PM

Hello Forum,
We just converted a CR23x program to a CR3000 and noticed that the variable names don't use a consistent case.

For example, the FSL from the CR23X was "AIR_150_AVG" and the output from the CR3000 is "AIR_150_Avg". The programmer is not specifying _AVG in the Alias definitions.

Our QC scripts are case sensitive so they see these two as different variables, but in fact, they are the same.

Is there a setting somewhere that I can tweak to make the table name suffixes from the CR3000 default upper case?


Dana Aug 15, 2013 10:31 PM

Hello,

You can use the FieldNames instruction to change the name. Here's a simple program. The second Average in the data table shows the use of fieldnames. The first Average will keep the default name, but the second will assume a new name:

Public Tref, TCTemp1, TCTemp2

DataTable (Table,True,1000)
DataInterval (0,60,Sec,10)
Average (1,TCTemp1,FP2,False)
Average (1,TCTemp2,FP2,False)
FieldNames("TCTemp2_AVG")'<<<<<<<<Rename output
EndTable

BeginProg
Scan (1,Sec,3,0)
PanelTemp (Tref,250)
TCDiff (TCTemp1,1,mV2_5C,1,TypeT,Tref,True ,0,250,1.0,0)
TCDiff (TCTemp2,1,mV2_5C,2,TypeT,Tref,True ,0,250,1.0,0)
CallTable Table
NextScan
EndProg

Dana


AMK Aug 18, 2013 02:28 PM

Thanks Dana,
Do you know if there is a way to define new field names if reps is more than 1?

ie:

Public Tref, TCTemp(2)
Alias TCTemp(1) = TEMP_150_CM
Alias TCTemp(2) = TEMP_250_CM

DataTable (Table,True,1000)
DataInterval (0,60,Sec,10)
Average (2,TCTemp,FP2,False)

FieldNames("TEMP_150_CM_AVG", "TEMP_250_CM_AVG" )'<<Would this work?


Dana Aug 19, 2013 07:52 PM

Hello,

Fieldnames for multiple outputs needs to be one quoted string for all reps; i.e.,

FieldNames("Name1, Name2")

as opposed to

FieldNames("Name1", "Name2")

Dana


JonathanT Sep 22, 2014 09:18 PM

Hi,

Is it possible to pass a public string into the FieldNames() function? For example:

///
Public PTemp, batt_volt, TcoupleTemp, ExampleData(40) As Float,
Public i,
Public fieldNameString = "ExampleString,ExampleString2"

DataTable (ExampleDataTable,1,-1)
Sample (1,batt_volt,FP2)
Sample (30,ExampleData(),IEEE4)
FieldNames(fieldNameString)
EndTable
///

The result of this code is fieldNameString as the first Example Data column header, not ExampleString.

All I'm looking for is a way to evaluate the argument used by the FieldNames() function before it's used by the FieldNames() function.


ryan42 Jan 13, 2015 12:57 AM

Hi Johnathan, Dana,

I'm trying to do the same thing as in the last post, passing a string into the FieldNames() function.

Const siteNumber = "123"
FieldNames("Battery_"+siteNumber)

Is this possible?

Cheers
Ryan

Log in or register to post/reply in the forum.