D = Device(camming3, camming4)
C = Calculation functions
The DC10ChVelRat function execute the calculations needed in order to set and/or change the speed ratio RV (RV = Slave Speed/Master Speed) an electric shaft between a Master axis and a Slave axis.
You must pass values by reference speed of the Master, of the new speed ratio, the resolution is specified in the RV, the sampling time of the CAMMING device (or 4), the type of softening during speed changes. Function writes directly on the CAMMING3 (or 4) device sectors to run electric gearing with the new speed ratio. The function also returns the values on the “Error” variable, on the “Texec” variable and on “WrExec” flag.
If the function is executed with the cam is not in execution, the cam is programmed with the RV set. The next STARTCAM electric gearing attaches to the master with the RV.
If the function is executed with the cam in execution, activates a rewrite “on the fly” with the new RV cam that by the time “Texec” is carried out.
DC10ChVelRat (Cam, Vmaster, Rapp_SM, Risol, Tcamp, TipoAdd, Texec, WrExec, Error)
Parameters:
IN/OUT | VARIABLE TYPE | EXAMPLE NAME | DIM | |
---|---|---|---|---|
IN | CAMMING3 CAMMING4 | Cam | Device type to which you can apply the function | |
IN | SYSTEM | Vmaster | L | Reference speed of the master with which you perform calculations of space to be execute from the master and the slave (UM/sec, UM/min). It is recommended to insert the speed at which you are moving the master (see notes). |
IN | SYSTEM | Rapp_SM | L | Slave Speed/Master Speed ratio expressed in units, tenths, hundredths or thousandths depending on the Res. parameter |
IN | SYSTEM | Risol | W | RV resolution: greatness with which you can express the RV (0: tens, 1: tenths, 2: cents, 3: thousandths) |
IN | SYSTEM | Tcamp | W | Sampling time of the CAMMING3 (or 4) device expressed in S/1000. |
IN | SYSTEM | TipoAdd | B | Kind of softening during speed changes of the slave (0, 1, 2, 3, 4, 5). |
OUT | SYSTEM | WrExec | F | Flag to indicate that the writing of the cam was executed. |
OUT | SYSTEM | Texec | L | Time in s/1000 to execute the change of speed ratio. |
OUT | SYSTEM | Error | B | The function error |
After calling the function, the error variable can take on certain values, the meaning of these values is summarized below:
0: calculation executed without errors
1: Null sample time
2: Null speed ratio
3: Null Master Speed
4: Cam error
An example of using the function with a speed of the master of the real one is:
.... Rapp_SM = 1500 Resol = 3 Vmaster = 2750 ;Current speed of the master Tcamp = 2 TipoAdd = 1 DC10ChVelRat (Cam, Vmaster, Rapp_SM, Risol, Tcamp, TipoAdd, Texec, WrExec, Error) WAIT WrExec ;hold write occurred WrExec = 0 tmTim = Texec ;waiting change ratio of speed execute WAIT tmTim OR Error ....