Simple Output Pulse
F7,T5,S1,O1,I0
F7,T0,S0,O1,I0
F3,T60
F2,S1
Conditional Example
F14,a*10
F16,T1,S100,I1
Pulse Counter Example
F17,T0,S1
F18,T30,O1,S10,I2Example: Output control
The following example demonstrates a closed-loop User Program that repeatedly switches a digital output ON and OFF using user-defined parameters and temporary storage.
The program:
- Uses user parameters to define ON and OFF durations
- Uses temporary storage to track the active output
- Uses a sub-program for conditional looping
- Runs continuously without explicit delay commands
User Parameters Used
| Parameter | Purpose |
|---|---|
| A | ON duration (seconds) |
| B | OFF duration (seconds) |
Temporary Storage Used
| Storage | Purpose |
|---|---|
| X | Output number to control |
Program Code
F15,T3,S1,O1 //sets temp storage to 1
F7,TA,S1,OX //switch on output with value from storage and waits A seconds
F7,TB,S0,OX //switch off output with value from storage and waits B seconds
F15,T1,S1 //increase value of storage +1
F16,T1,S4,OX,I1 //check if value in storage is larger than 4
F13,T2,S1,P1 //if above condition is true, go to line 1
F2,S2 // go to line 2
Notes on Timing Behavior
The F7 (Switch Output) function includes a time parameter (T).
This means the output remains in the selected state for the specified duration before execution continues.
Because of this, no separate F3 (Delay) command is required in this example.
INFO:
Using an explicit F3 delay instead of timing parameters inside F7 can improve readability in some programs but is not technically required.
