Command: ValueToChn
- Updated2024-09-12
- 3 minute(s) read
Command: ValueToChn
Command: ValueToChn
Possible spellings: ValueToChn, VariantToChn
Converts an array into channels.
Input Parameters
![]() |
Specifies the name of the variant that DIAdem converts into channels. |
![]() |
Specifies the base name of the new channels, which is used when the channels are converted from an array. |
![]() |
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
![]() |
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.
VBScript | Python |
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