I’m wanting to time stamp events in a plc and have them inserted into a sql table if they are active. I have attempted to setup a block group inside ignition to insert the events into SQL. I have it all working other than the time stamp. I have attempted to use the LINT, and String in the AB Compact Logix with various formatting. I’ve the Data type to DateTime, string with no success. Is there a recommended way of getting a date from the PLC Level into the SQL database using a transaction group of ignition?
What is the format of the time in the processor? Do you have a tag for each component of it (hour, minute, second), or one value for the number of milliseconds since some period?
I doubt you’ll be able to use the “date” data type. Instead, you’ll likely store it to the database in some integer format, and then convert it either on query, or automatically through some mechanism like a table trigger.
Also, does the date apply on a per-value basis, or for all values in that cycle? If it applies to everything, you might be able to use accessory items in the block group to convert the value.
If you give an example of what the timestamp looks like in the processor, I might be able to help a bit more.