03-20-2015 09:53 AM
Hello,
I'm having some trouble regarding the command to assign a unit to one of my channels which by default does not have an assigned unit. I attempted to use the script recorder function however it did not produce any code for that task. It would only work when converting to a new unit from an exixting one.
I attemted to use the below code with my channel [1]/Timechannel.
Any input would be appreciated.
Thanks
Dan
03-20-2015 06:46 PM
Hello Dan,
The code to assign a unit to a channel is:
Data.Root.ChannelGroups(1).Channels("Time").Properties("unit_string").Value = "V"
This would assign the unit Volt to the channel called "Time" in group 1.
You can also assign units to channels in a DataPlugin, which would have the effect of automatically assigning units to channels when you load the data, and making units searchable in the DataFinder.
I hope this helps,
Otmar
03-23-2015 01:09 PM
Thanks Otmar.
That is exaclty what I was looking for.