10-10-2022 07:22 AM
Hi,
I am using DIAdem 2022 and trying to use two scripts together.
One is VBScript and another one is Python script. I want to call the VBScript as Python functions, which could pass parameters and return results.
Are there built-in functions that allow me to do that? I find article close to it, but it does not contain the solution I need. Calling VB and Other Scripts From Python Script in NI DIAdem - NI
Otherwise, one solution may use JSON to pass parameters.
10-11-2022 12:37 AM
Hello botbob,
„ScriptStart“ is the command to call a VBS function out of Python. The easiest way to exchange data between Python and VBS is a global defined variable.
Python Script:
dd.GlobalDim("myPara")
dd.myPara = 2
dd.ScriptStart("d:\\test\\vbstest.vbs", "CallPrint")
VBS Script:
sub CallPrint
select case myPara
case 1
msgbox "1. Hallo"
case 2
msgbox "2. Hallo"
end select
end sub
Greetings
Walter