NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

how to extract each value of the split array

hi,

 

I want example how to extract the each element form the spli array.

 

Rite now i am using

 

Set PSUChannel (1,10V,18VOVP,1ALimit,3AOCP,OutputON)

 

Where 1 represents locals.inputchannel, b represents locals.inputvolts......

 

Locals.arrayCommandsIn = Split (Parameters.DataInTabArray,{"    "} ), // Break out the tab spaced parameter & assigns to array of local variables (CommandsIn)
Locals.InputChannel = Abs(Val(Locals.CommandsIn[0], Locals.InputChannelIsANumber)), // PSU Channel to use
Locals.InputVolts = Abs(Val(Locals.CommandsIn[1], Locals.InputVoltsIsANumber)), // PSU Voltage to input
Locals.InputOVP = Abs(Val(Locals.CommandsIn[2], Locals.InputOVPIsANumber)),  // PSU OverVoltage Protection Value
Locals.InputCurrentLimit = Abs(Val(Locals.CommandsIn[3], Locals.InputCurrentLimitIsANumber )), // PSU Input Current Limit Value
Locals.InputOCP = Abs(Val(Locals.CommandsIn[4], Locals.InputOCPIsANumber)), // PSU Over Current Protection Limit Value
Locals.InputDesiredState = Locals.CommandsIn[5], // Is the PSU to be switched ON or OFF

Please let  me know how to extract the values locals.inputchannel, locals.inputvolts .......currently it is giving error

 

thanks,

CC

 

0 Kudos
Message 1 of 2
(2,991 Views)

When I use this command: Locals.temparray=Split("abc\tdef\tghi","\t")

I am able to access Locals.temparray[0], [1], and [2].

 

I am not sure what the data in your "Parameters.DataInTabArray" looks like, but if it's tab delimited like in my example, the second argument for the split function should be "\t".

 

Pulido Technologies LLC

0 Kudos
Message 2 of 2
(2,972 Views)