Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Controls Guy on June 11, 2014, 10:35:17 PM

Title: Detecting data change
Post by: Controls Guy on June 11, 2014, 10:35:17 PM
Given a table of data values, what's the simplest way of detecting a change?

Is there a mass compare where you can compare the table against an archive copy to see if there have been any changes?  AB has FAL (File Arithmetic and Logic) instructions that work on a table, splitting the work over many consecutive scans.

Or just compare one value at a time, continuously, but put the comparison in a low-time-slice task, so only a few comparisons get done each overall scan?

I realize Do-More is so fast, you could probably do all the comparisons every scan and it wouldn't hurt anything, but old habits die hard.
Title: Re: Detecting data change
Post by: LWgreys on June 11, 2014, 10:48:24 PM
Try "CHECKSUM" function.
Title: Re: Detecting data change
Post by: franji1 on June 11, 2014, 11:18:39 PM
I would definitely do it in a Task, then you have complete control over speed of calculation vs. scan time at runtime via the Task's .TimeSlice member.

Do you also need to know WHICH value is the one that changed, or just that A value changed?  Regardless, do it in a Task.
Title: Re: Detecting data change
Post by: Controls Guy on June 11, 2014, 11:21:21 PM
Just detecting A change should be adequate, though there will no doubt be apps where I'd want to know which value.

LWGreys, CHECKSUM works awesome.  Very cool idea.  Thanks!