DIAdem Help

Content Type
Programming Language
Current manual
Table of Contents

Command: ValueToChn

Display all  Hide all

Command: ValueToChn

Possible spellings: ValueToChn, VariantToChn

Converts an array into channels.

ReturnValue = ValueToChn(SrcVariant, ChnBaseName, [TransposeMatrix])

Input Parameters

SrcVariant Specifies the name of the variant that DIAdem converts into channels.
ChnBaseName Specifies the base name of the new channels, which is used when the channels are converted from an array.
[TransposeMatrix] Specifies whether DIAdem transposes the matrix, which means DIAdem exchanges the rows and columns. The default value is FALSE which means that DIAdem does not swap the rows and columns.

Return Parameters

ReturnValue Specifies a channel list as a vector in the script environment. The return value is a ChannelList type.
Note  Write ValueToChn instead of VariantToChn.

VBS scripts only recognize Variant data types. A variant variable can contain various subtypes, such as integer, long, or string. In VBS scripts you can use only variant variables. However, exchanging data with other applications may involve data that is not a variant data type. DIAdem channels also have a defined data type. Use the ValueToChn command to exchange data with other applications that return type-safe arrays and save the data type-safe in channels.

Example

The following example starts a VI in LabVIEW and assigns the results to an array. DIAdem converts this array into channels and returns the list of generated channels in the ChnLst variable.

VBScriptPython

 

Dim sgRunTimeVersionT : sgRunTimeVersionT = ""
LVRuntime.Init sgRunTimeVersionT
' Load "Test.VI"
Dim objVI
Set objVI = LVRuntime.LoadVI(AutoActPath & "Test.vi") 
Call objVI.Run(true)
varArray = objVI.GetControlValue("OutPut1")
ChnLst = ValueToChn(varArray,"DatafromLV")
' Clean up
Set objVI = NothingLVRuntime.DeInit

Related Topics

Command: ArrayToChannels | Command: ChannelsToArray

Was this information helpful?