SetCtrSV n, value
Purpose Change the Set Value (S.V,) of the Counter #n to value . This statement to allow the user to modify the S.V. of the PLC internal  counters without changing the source program. A TBASIC function can be written easily to make use of a few digital or analog inputs to modify the SV of these internals timers/counters. The new S.V is also stored in the program EEPROM and hence is non-volatile. (See sample program "set_TCSV.PC4")

n         -  between 1 and 128.
value  -  between 0 and 9999.

For F-series PLC the new S.V is stored in the onboard FRAM and hence is non-volatile. (See sample program "set_TCSV.PC4").

For Nano-10 and FMD PLC, the new S.V. are only stored on RAM-shadowed CPU flash memory and is normally volatile unless a RESET or SETSYTEM 252,0 command has been executed which forces a backup of the RAM shadow to the CPU flash memory. Programmer should therefore use this command sparingly. Note that TBASIC custom funciton can start a counter simply by setting its CTRPV[] variable to any integer value between -1 (reset counter) and 9999 so it is not necessary to change the counter S.V..

Examples SetCtrSV 10,1234
SetCtrSV 3, GetCtrSV(3)+10
Comments: Counter #10 will assume a S.V. of 1234..
S.V of Counter #3 will be increased by 10.

Related : The present values (P.V.) of counters can be read or written directly as integer variables   "CtrPV[n]". But the Set Values can only be changed by this function.

See Also GetCtrSV( ), GetTimerSV( ) , SetTimerSV

backbutton.gif (507 bytes)  Basic to TBASIC Reference Manual