TL;DR: Any way to change or delete a variable's value right after a Table Call is made? (5-sec scan, 1-min table)
Hi,
Fairly new to CRBasic, so apologies if this is a silly or redundant question, but I'm having the following problem:
We're using SerialInRecord to grab a string, then SplitStr to parse it out into a number of variables. This is on a 5-second scan, the device outputs once/minute, and the variables are saved to a 1-minute table. The issue is that if the device stops reporting, the SerialInRecord output variable won't be overwritten, and we'll continue to record data (a series of identical entries).
In the past we've used If TimeIsBetween(5,10,60,sec) Then Variable = "" to solve this. However, as clocks drift (I assume), we get periods where new data is captured from SerialInRecord but then promptly wiped before the next Table Call. I tried putting SerialInRecord inside a If TimeIsBetween(10,60,60,sec) statement, but alas, this angered the compiler gods.
Is there any way or best practice to either delay SerialInRecord, or set variable(s) to a blank string/NaN right after a Table Call? Have also contemplated using flags or nested If loops to compare "new" vs last recorded data, or using sequential mode, just not sure what's cleanest and best for my limited sanity.
Thanks!