Programming without SFB 52 and SFB 53
D.4 FC CAM_CTRL (FC 1)
FM 352 electronic cam controller
Operating Instructions, 05/2011, A5E01071724-03
203
Jobs
Data exchange with the module other than the control and checkback signals is handled by
using jobs.
To start a job, set the corresponding trigger bit in the channel DB and provide the relevant
data for write jobs. You then call FC CAM_CTRL to execute the job.
If you use the FM 352 centrally, a read job is executed immediately. If you use the FM 352 in
a distributed system, a read job may take several cycles.
Due to the required confirmations from the module, a write job requires at least 3 calls (or
OB cycles). If you use the FM 352 in a distributed system, a write job may take more than 3
calls.
You can send several jobs at the same time, if necessary, along with control signals. With
the exception of the job for writing the function switches, the jobs are executed in the order of
the trigger bits specified in the channel DB. Once a job has been completed, the trigger bit is
canceled. The next time the block is called, the subsequent job is identified and executed.
For each job there is not only a trigger bit but also a done bit and an error bit. In their names,
instead of the ending _EN (for "enable"), these jobs have the ending _D (for "done") or _ERR
(for "error"). Done and error bits of the job should be set to 0 after they have been evaluated
or before the job is started.
If you set the JOBRESET bit, all the done and error bits are reset before the pending jobs
are processed. The JOBRESET bit is then reset to 0.
Function switches
The function switches activate and deactivate the states of the module. A job for writing the
function switches is only executed if changes were made to a switch setting. The setting of
the function switch is latched after the job has been executed.
Length measurements and edge detection must not be activated at the same time. FC
CAM_CTRL makes sure that when one of the function switches is activated, the other is
deactivated. The length measurement function is activated if you enable both function
switches at the same time (0 → 1).
Function switches and jobs can be used at the same time in one FC CAM_CTRL call.
As with the jobs, there are done bits with the ending _D and error bits with the ending _ERR
for the function switches.
To be able to evaluate the done and error bits, you should set these bits to 0 when you
change a function switch.
Startup
Call FC CAM_INIT at the startup of the module or CPU (see chapter "FC CAM_INIT (FC 0)
(Page 201)"). Among other things, this also resets resets the function switch
es.
FC CAM_CTRL acknowledges the module startup. During this time, RET_VAL and
JOBBUSY = 1.