I want to execute a routine in slowsequence (in the program of CR1000) but when I put some values in public and so the routine start. Is it possible?
I think the below example code will answer your program. The Trigger variable is only ever set to True by a user manually changing it with connected software.
Public PTemp, Batt_volt Public Trigger As Boolean 'Main Program BeginProg Scan (1,Sec,0,0) PanelTemp (PTemp,60) Battery (Batt_volt) CallTable Test NextScan SlowSequence Scan (1,Sec,3,0) If Trigger Then Trigger = False 'Include this line if you want sequence to only run once 'Add other code here. EndIf NextScan EndProg
Thank you very much it is work.
An aditional question:
when I want the sequence starts and with some values like for example: hour=16 , day=05 , year=20 .
If Trigger AND hour AND day AND year Then Trigger = False 'Include this line if you want sequence to only run once 'Add other code here AND THIS CODE CONTAINS THE VARS HOUR, DAY AND YEAR. EndIf
Yes, you can combine conditions. I prefer to always add parentheses to make sure the order of operations is what I expect.
If (Trigger = True) AND (hour = 16) AND (day=5) Then