This is an old revision of the document!
DW22WrCam
D = Device(CAMMING2, CAMMING3, CAMMING4)
W = Writing functions
* = Replaces the function DW20WrCam
The DW22WrCam function is used to write the fields to build an electronic cam. The function you will need to pass as parameters a pointer to start and end time they serve to identify the field where you want to start writing and the area where you want to stop. Function writes 40 sectors cam.
IMPLEMENTATION
DW22WrCam (cmCamma, aslParam, CodeG, CodeM, CodeQm, CodeQs, CodeQma, CodeQsa, Error)
Parameters:
IN/OUT | VARIABLE TYPE | EXAMPLE NAME | DIM | |
---|---|---|---|---|
IN | CAMMING2 CAMMING3 CAMMING4 | cmCamma | - | Type of device to which you can apply the function |
IN | ARRSYS | aslParam[1] | L | Sector number to start writing |
IN | SYSTEM | aslParam[2] | L | Sector number to end writing (valid only if 'aslParam[3]' is to 0) |
IN | SYSTEM | aslParam[3] | L | Number of sectors to write (optional if you want to use 'aslParam[2]') |
IN | SYSTEM | aslParam[4] | L | Number of array element from which to begin reading values (if set 0 it start with the first element) |
IN | ARRSYS | CodeG | W/L | Array containing Code G calculated |
IN | ARRSYS | CodeM | W/L | Array containing Code M calculated |
IN | ARRSYS | CodeQm | L | Array containing calculated space Master |
IN | ARRSYS | CodeQs | L | Array containing calculated space Slave |
IN | ARRSYS | CodeQma | L | Array containing Qma code (auxiliary code) |
IN | ARRSYS | CodeQsa | L | Array containing Qsa code (auxiliary code) |
OUT | SYSTEM | Error | B | Error var on the cam writing |
Use mode
The “aslParam[1]” parameter (starting sector) indicates the number of the field in which you want to start writing the cam, while “aslParam[4]” (initial array element) indicates the number of the element of the array (CodeG, CodeM, etc..) from which you will start to copy the values in the fields.
If the “aslParam[2]” parameter (ending sector) is not set to 0, writing the fields ends with sector of this number, If the parameter is to 0 the writing continues for the number of sectors set in “aslParam[3]” parameter (number of sectors to write).
Error
Once invoked the function if there are any errors the error variable takes certain values, the meaning of these values is described below:
0 - No error
1 - Indices of the start and/or end writing drivers
Example
MAIN: IF gfScrittCam gfScrittCam = 0 aslParam[1] = 1 ;He started writing from 1° sector of the cam aslParam[4] = 10 ;Start reading from 10th element of the array DW22WrCam (cmCamma, aslParam, CodeG, CodeM, CodeQm, CodeQs, CodeQma, CodeQsa, Error) IF sbErrore JUMP FINE ENDIF ENDIF