Finding data type of Tag Path

Hi,

I am getting tag path from dataset column, then storing it to a variable.

data = event.source.data
tagPath = data.getValueAt(ClickedItem, “tagPath”)

For Eg. Value in tagPath variable will be like Pumps/Motor 1
Now I need to check that datatype tagPath variable (which has tag path).
Then I need to check that tagPath variable (which has tag path) is UDT or not?

tried few option like system.tag.read, system.tag.browseConfiguration & system.tag.browseTags but I was unsuccessful.

Hopefully Thank you.

It looks like system.tag.browseConfiguration() has what your looking for.

The example at the bottom of the link shows how to check the tag type.

Hi,

I tried this, It gives data type for all the sub tags comes under the provided path.

tagPath = data.getValueAt(ClickedItem, “tagPath”)
browsePath = system.tag.browseConfiguration(tagPath , False)

the above code gives tagPath for all its sub tags.

I want the data type of the provided path not its sub tags.
as i explained earlier my tagPath variable will be having value like "Pumps/Motor 1" (which will UDT mostly, some times it may not UDT also. This path is what I need to validate.)

I need to check that datatype tagPath variable (which has tag path)
I need to check that tagPath variable (which has tag path) is UDT Instance or not?

Thanks,

If you want the DataType

system.tag.read("path/to/tag.DataType").value

If you want TagType

from com.inductiveautomation.ignition.common.sqltags.model.types import TagType
v = system.tag.read("path/to/tag.TagType").value
print TagType.getTypeForValue(v)

4 Likes

Thanks a lot, Its Working.

along with it I was also trying the following code.

config = system.tag.read(assetTagPath + “.TagType”).value
print config

It gave me a output @console

10

I searched for online help document, But, I couldn’t able to figure out what does this 10 refers to?

from com.inductiveautomation.ignition.common.sqltags.model.types import TagType
v = system.tag.read("path/to/tag.TagType").value
print TagType.getTypeForValue(v)
1 Like

Thanks a lot, Kyle.
for your Immediate response.
I got what I was expecting.