I'm very new to ignition and I'm trying to simulate the start and end of a process and logging the data in-between and exporting to a csv.
I have 2 buttons, one to start and one to stop. The start button assigns the current start time to a memory DateTime tag with the following script:
Please have a quick read of Wiki - how to post code on this forum and then edit your post using the pencil icon. All your indentation is lost otherwise. Thanks.
In the line, startDate = ["[IsoTreat]StartTime"]
you are supplying a string where a datetime is required. You need to retrieve that first as a separate operation.
Edit: Fixed the line startDate = tagStartDate[0].value
The readBlocking function returns a list with a qualified value for each tag requested. The qualified value includes the actual value, the quality and the timestamp. Since we only read one tag it will be returned as tagStartDate[0] and the value can be read using tagStartDate[0].value. Thank you @Ujwal_Wankhede.