Type Mismatch Error in Script With "Wfchntochn" Command in DIAdem 2019

更新しました Aug 28, 2023



  • DIAdem


I have a script that functioned fine in versions prior to DIAdem 2019.When I use the same script in DIAdem 2019, I get a Type mismatch error.
It seems that the part that uses the WfChnToChn() command in the script is related, but how can I resolve the error?


The WfChnToChn() command has changed slightly between DIAdem 2018 and before and 2019 and later.
  • Prior to DIAdem 2018... This function always returns an array.
  • As of DIAdem 2019... The function returns an array for multiple channels, but a scalar for single channels.
This alteration could have impacted the processing flow, potentially triggering errors. To address this, you might want to contemplate modifying the script. One strategy involves utilizing the IsArray() method to ascertain whether the return value is an array or a scalar. This way, you can implement distinct processing logic for each scenario.