The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Help with script? Comand error
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

HAMOS

Portugal
3 Posts

Posted - 12/09/2012 :  1:08:46 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello there,
I try to run the following script but I keep getting a command error that starts in the marked section .. can somebody please help me out to find where the problem is?

//////////////////////////////////////////////////////////////////////


stringarray sa_state; //string array where all OC and ISC will be stored
stringarray sa_SC; // string array were the values of columns corresponding to the SC will be stored
stringarray sa_OC; //string array were the values of columns corresponding to the SC will be stored

int ii=count(Col(Potential/V),1); // count n of data values and set the maximum


for (jj=1; jj<ii; jj++) //Loop between those values
{

if (Col(Potential/V)[jj]*Col(Potential/V)[jj+1]<0) // short circuit condition
{
short_circuit$=$(jj);
sa_state.Add(short_circuit$); //add value to string array
//short_circuit$=;
};


if (Col(Current/A)[jj]*Col(Current/A)[jj+1]<0) // open circuit condition
{
open_circuit$=$(jj);
//open_circuit$=;
sa_state.Add(open_circuit$);
};
}; //EVERYTHING IS OK until here



for (kk=1; kk<=sa_state.GetSize(); kk++) //print the string array
{
%A= sa_state.GetAt(kk)$;
%B= sa_state.GetAt(kk+1)$;
int state= %A;
int state_1= %B;
//state=;
//state_1=;
}; //COMMAND ERROR STARTS when I run this part


//find conditions where short circuit condition is followed by an open circuit and determine short cicuit current and open circuit values

if (Col(Potential/V)[state]*Col(Potential/V)[state+1]<0 && Col(Current/A)[state_1]*Col(Current/A)[state_1+1]<0)
{
double ISC=Col(Current/A)[state];
double VOC=Col(Potential/V)[state_1];
string row$=$(state);
string row_1$=$(state_1);
//row$=;
//row_1$=;
sa_SC.Add(row$);
sa_OC.Add(row_1$);
};
};

for(int ll=1; ll<=sa_SC.GetSize(); ll++)
{
%C= sa_SC.GetAt(ll)$;
%D= sa_OC.GetAt(ll)$;
int sc= %C;
int oc= %D;
sc=;
oc=;

};
//////////////////////////////////////////////////////

HAMOS

Portugal
3 Posts

Posted - 12/09/2012 :  1:23:59 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ok already figured out what the problem was..
Go to Top of Page

doxera

2 Posts

Posted - 12/10/2012 :  11:02:23 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi!
Hamos, try this string in a new project, maybe it's an answer:
type -b %C;

and this too
type -b %D;

Also, I think it's not correct to give string to integer:
int sc= %C;
int oc= %D;

use the:
int YourInteger = %(YourArray.GetAt(ll)$);

Edited by - doxera on 12/10/2012 12:01:47 PM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000