08-13-2015 02:09 AM
HI,
I'm pretty new to writing script but am totally stuck on this.
I'm trying to write a spript to create a time channel based on sampe rate (the equation is simple) but the part where i get stuck is every time i load a different set of data my script is stiff refererencing "channel group2" so what i need is an input button/drop down box.....etc to sellect what channel group it should be using.
Any ideas?
Steve
08-14-2015 03:15 AM - edited 08-14-2015 03:25 AM
Hi Steve,
I am Ed from National Instruments Technical Support. I am happy to assist you with your request today. I'd just like to clarify, are you wanting to have this functionality in DiAdem rather than LabVIEW?
From what I can tell so far you could use a numeric control such as a dial, convert the numeric to string in your script and then concatenate this number to your channel name. You could also store your channel names as a string array and have a script acquire the string in the array at the given position, input from a numeric dial. Both methods can then be executed using a button. The input button is available under Visual -> Manual Instruments, which the numeric dial is also located in.
I hope that this is helpful and if you have any questions regarding your query please don't hesitate to ask.
Best Regards,
Ed
08-17-2015 10:56 AM
Hi Steve,
If you want to create a script that always adds a time channel for the most recently loaded data set, then you can use the "Active Group" in your script:
Set Group = Data.Root.ActiveChannelGroup Set TimeChannel = Group.Channels.Add("Time", DataTypeChnFloat64, 1) Call ChnLinGen(TimeChannel, 0, LastXvalue, XvalueCount, "s")
Brad Turpin
DIAdem Product Support Engineer
National Instruments
08-18-2015 02:38 AM
Thanks Brad,
That looks useful
08-18-2015 02:44 AM
Thanks Ed,
I'll give that a go this afternoon. and let you know how i get on