10-08-2015 12:28 AM
Hi,
i am currently working with NI DIAdem tool, using VBScript.
i want to parse the content inside the text file to the Data Base using DIAdem TDM.
i want to create one variable as a global variable and use that variable thoughtout my script, i declared my variable using Public but it is not working, please guide me how do i create and use global variable in VBScript
thanks,
kalpana
10-08-2015 10:51 AM
Hi kalpana,
You'll have to be more clear with your first question.
The answer to your second question is to use the "GlobalDim" command.
Brad Turpin
DIAdem Product Support Engineer
National Instruments
10-12-2015 12:55 AM
10-12-2015 01:49 PM - edited 10-12-2015 01:50 PM
Hi kalpana,
You didn't mention you were creating a DataPlugin. You can only use the GlobalDim command in a DIAdem VBScript or SUDialog. This command is not available (or necessary) in a VBScript DataPlugin. You can make any variable global simply with the Dim statement, as long as you declare the variable above the Sub ReadStore().
As best I can figure from your run-on posted code above, this is the line you say you get the "type mismatch" error from, is that correct?
oChannel.Properties.Add "DateTime", sTimeValue
I'm wondering where this oChannel variable comes from. If you try to assign a string variable value to a datetime property (or vice-versa) you will get an error like this. How often does the oChannel variable change-- every line, or less often?
Brad Turpin
DIAdem Product Support Engineer
National Instruments