Login Page - Create Account

Support Board


Date/Time: Sat, 15 Mar 2025 15:53:23 +0000



Post From: How to get the values of over 100 sc study in one study

[2022-07-15 13:59:08]
JohnR - User831573 - Posts: 320
Looking at what you are trying to do, I think I was wrong in what you were trying to do. If you only want to keep the last value of each of the 100 sc studies from other charts or even within this chart, but a different study, then what SC support suggest is the way to go. you would just use the call for each to the 100 values you want into different variables or array elements.

fdouble& GetPersistentDoubleFromChartStudy(int ChartNumber, int StudyID, int Key);

example from SC docs
ACSIL Interface Members - Functions: Chart Study Persistent Variable Functions

SCSFExport scsf_GetStudyPersistentVariableFromChartExample(SCStudyInterfaceRef sc)
{
SCInputRef ChartStudyReference = sc.Input[0];

if (sc.SetDefaults)
{
// Set the configuration and defaults
sc.GraphName = "Get Study Persistent Variable from Chart Example";
sc.AutoLoop = 1;
ChartStudyReference.Name = "Chart Study Reference";
ChartStudyReference.SetChartStudyValues(1, 0);
return;
}
//Get a reference to a persistent variable with key value 100 in the chart and study specified by the ChartStudyReference Input.
float & FloatFromChartStudy = sc.GetPersistentFloatFromChartStudy(ChartStudyReference.GetChartNumber(), ChartStudyReference.GetStudyID(), 100);
}

To get the value of the 2nd study you want to get from another chart
float & My_2nd_value = sc.GetPersistentFloatFromChartStudy(Chart_2_Num, Study_Num, Index_Num)
then have a line for each of the rest of the 100 values you are trying to get into your study.
Then do your calculations / compares as you wish.

At leat this is my understanding,
JohnR