Hello,
currently I’m experiencing some problems with the Script DAC Driver. It seems to me, that if the DAC scheme and the VBS script get a bit more extensive, the content of variables inside the script gets lost arbitrarily. They’re empty.
For example the following code saves a value into an array if a certain ChannelNumberP is processed. Any time later I can access this value Variable(42) and use it. Normally this works.
dim Variable(50) Sub SFD_ProcessChannel( ChannelNumberP, InputListV, ParamP, DataP, ErrorP ) ' ... some extensive code ... if ChannelNumberP <= 5 then Variable(42) = 5 ' ... some extensive code ... if ChannelNumberP = 27 then DataP = Variable(42) ' ... some extensive code ... end sub
But under some unknown conditions, it returns empty and not five. Just like the channel isn’t processed or the space in memory is erased.
If I change the script in the following way…
dim Variable(50) Sub SFD_ProcessChannel( ChannelNumberP, InputListV, ParamP, DataP, ErrorP ) ' ... some extensive code ... Variable(42) = 5 ' ... some extensive code ... if ChannelNumberP = 27 then DataP = Variable(42) ' ... some extensive code ... end sub
…it always works. Unfortunately this causes a huge disadvantage because lots of code is executed everytime SFD_ProcessChannel is repeated. When the code is more complicated than
Variable(42) = 5
it might even slow down the computer.
Has anyone else had a problem like this?