HomeSmartRelay

Discussion for our SmartRelay controller.

Data log sample rate adjustable by touchscreen? Messages in this topic - RSS

mpgies
mpgies
Posts: 1

12/27/2019
I'm using a SmartAxis Touch and would like to be able to adjust the data log sample rate on the fly using the touchscreen instead of having to update it in the data log settings and then download the update to the IDEC. Is this possible?
0 link
Shane
Shane
Moderator
Posts: 334

20 days ago
What sampling method are you using currently? Fixed Period? If so, I would switch to "Event Bit" and then create an adjustable pulse with an M bit. Each time you change that bit from 0-1 it will take a sample. By adjusting the timing in seconds of that bit you can change the sampling rate.
0 link
DaDaDadeo
DaDaDadeo
Posts: 83

19 days ago
A user interface with adjustable options can be used. The remainder "%" function is helpful for these types of things. Below is a script that should work by adding it to the Global Script list and set it as "always on":

// DATALOG_INTERVAL = WORD (Adjustable setting)
// DATALOG_OPTION = BIT (Adjustable toggle on or off)
// CYCLE_TIMER_SECONDS = WORD (Cycle or system timer incrementing seconds)
// CYCLE_ACTIVE = BIT (Handled by cycle automation)
// DATALOG_TRIGGER = BIT (Used in Datalog setting as the "Event Bit")


RST([DATALOG_TRIGGER]); // Make sure the trigger is reset each scan

IF ([CYCLE_ACTIVE]){ // Is the cycle active?
IF ([DATALOG_OPTION]){ // Is the Datalog option on?
IF([DATALOG_INTERVAL] > 0){ // Is there a correct interval setting?

IF (([CYCLE_TIMER_SECONDS] % [DATALOG_INTERVAL]) == 1){SET([DATALOG_TRIGGER]);} // Does the remainder equal 1

}
}
}
edited by DaDaDadeo on 2/5/2020
0 link




Powered by Jitbit Forum 8.2.0.0 © 2006-2013 Jitbit Software