Dataset help

How do I create and manipulate a dataset in a gateway script and display the dataset in a list box on the clients?

yes, I would also like to know. This is where I am coming from on my most recent post.

Could you give me some more information on what exactly you are trying to accomplish? You could technically do this with a client script that wrote to a client tag but that solution may not be what you’re looking for seeing that each client tag value would technically be unique to each running client.

we have a series of messages that originate on the gateway. Think of them as an audit trail. We write them down to a file for archiving, but it is sometimes useful for the most recent of those items to be viewed on the clients. We were looking into creating a dataset for this purpose that would be displayed in a list on the clients. The gateway fills in the dataset and the client displays them. Should be easy, but we are stumped.

why dont you just write the info into a table in the database? seems like it would be much easier and flexible to do that.

I agree, you should put that information into a database. Furthermore, we don’t have any tags that have a dataset type other than a client tag. You cannot write to a client tag from a gateway side script since it only exists in a running client and the value of a client tag is unique for each client.

The problem here is that the only way for you to make a dataset you build in a gateway script available to all of the clients that may be running would be to write it to a SQLTag. Only Client tags right now have the option for a dataset datatype. I would opt for the database solution as mentioned above. If you decide that using a Client tag would suit your needs then you could do something like the following.

You would place this in a Client Script and have a client tag that is a dataset data type called MyClientTag that you were writing the resulting

headers = ["name","value"]
rows = [["a",1],["b",2],["c",3],["d",4],["e",5]]
data = system.dataset.toDataSet(headers,rows)


Hope this helps

“[Client]MyClientTag” why does this work and what is the Client here?
I think I’ve been asking about this idea of arrayed tags…
Is that what you are creating here?
Could I use this for populating tags somehow?

“[Client]MyClientTag” is just what i used as an example of a client tag that I created in my project. The [Client] portion of the tag path tells you that it is a client tag. Client tags are technically unique to each client. Each client has its own instance of the tag. You could see this by adding a client tag to the client tag folder in your project called “NewClientTag” of type Int, binding an LED display component to the tag value, adding the following client timer script to your project and then launching multiple clients.

x = system.tag.getTagValue("[Client]NewClientTag")
system.tag.writeToTag("[Client]NewClientTag", x+1)

You’ll see that each LED display will read a different values.

The Client tags do support a dataset datatype which is just a dataset as used anywhere else in Ignition. Only Client tags support this datatype right now. For a more in depth description of the different tag types in Ignition take a look at the SQL Tags section in the user manual under the Project Design section.