Channel.ListAll() Question


Recommended Posts

Sorry for all the questions I've posted lately but I just purchased DF Pro and trying to do things that I've done in other HMI packages.

Had a uestion about getting the list of tags using the following code that is located in a sequence that Auto Starts...

Global tagList

Global numTags

tagList = Channel.ListAll()

numTags = NumRows(tagList)

System.MessageBox (Number of Tags = " + numTags + CHR(13) + CHR(13) + "First Tag = " + tagList[0])

When this code is executed, I get the message box and it displays the number of tags as 491 and the First Tag as NaN.

I know NaN is "Not a Number" but should I not get the text for the tag using tagList[0]?

Thanks...John

Link to comment
Share on other sites

Because you didn't declare tagList as a string, and when it tried to convert the tag name into a number, it was invalid and so returned NaN. DAQFactory has only two data types, numeric and string. To declare a string, just add the word string:

global string tagList

Link to comment
Share on other sites

Thanks for the quick response. I knew it was something simple.

DF is the greatest HMI software and I am so glad that I found you guys!

I will be posting HMI screens that I have done for a Geothermal turbine that I am currently working on in the Philippines.

John

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.