Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:software:devices:counter3 [2017/01/18 16:17] – [2. Declaring the device] qem103 | en:software:devices:counter3 [2020/07/13 14:49] (current) – qem103 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== THE COUNTER3 DEVICE ====== | ||
+ | |||
+ | ====== - Introduction ====== | ||
+ | The COUNTER3 device is used to acquire information from a two-way counter. Its main characteristics: | ||
+ | |||
+ | * conversion of pulses to selected unit measures | ||
+ | * position updating with recovery of unit measure fractions | ||
+ | * position capturing on activation of an interrupt digital input | ||
+ | * comparison between measured position and an activation threshold of digital outputs. | ||
+ | |||
+ | |||
+ | ===== - Declaring the device===== | ||
+ | |||
+ | To use the device it has to be declared in the INTDEVICE section of the configuration unit. | ||
+ | |||
+ | <code QCL> | ||
+ | INTDEVICE | ||
+ | <device name> COUNTER3 < | ||
+ | </ | ||
+ | |||
+ | Where: | ||
+ | ^Field name^Description^Example^Notes^ | ||
+ | |<device name> | ||
+ | |COUNTER3|Keyword identifying the two-way count device|-|-| | ||
+ | |< | ||
+ | |< | ||
+ | |< | ||
+ | |< | ||
+ | |< | ||
+ | |||
+ | ** Example: ** | ||
+ | <code QCL> | ||
+ | INTDEVICE | ||
+ | Count COUNTER3 | ||
+ | </ | ||
+ | |||
+ | ^: | ||
+ | |||
+ | |||
+ | ===== - Execution Description ===== | ||
+ | A block chart of the device:\\ | ||
+ | {{: | ||
+ | |||
+ | === - Factors === | ||
+ | The " | ||
+ | The " | ||
+ | |||
+ | === - Acquisition of the actual position on an interrupt digital input === | ||
+ | |||
+ | The //INTENBL// and //INTDSBL// commands enable (// | ||
+ | |||
+ | === - Comparators === | ||
+ | The device also provides two comparators that can be used to compare the actual value of the //posit// parameter with two values (// | ||
+ | There are two outputs available (as seen in the the device declaration and block chart) and there is a good level of personalisation: | ||
+ | The //mode1// parameters (controlling comparator 1) selects the activation or disattivazione policy of the corresponding output according to given rules. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | The figure shows examples of the different execution modes: | ||
+ | * mode 0: the output stays in its status | ||
+ | * mode 1: the output is activated when the position in pulse fronts is greater than the setpoint; | ||
+ | * mode 2: the output is disactivated when the position in pulse fronts is greater than the setpoint; | ||
+ | * mode 3: the output is activated when the position in pulse fronts is less than the setpoint; | ||
+ | * mode 4: the output is disactivated when the position in pulse fronts is less than the setpoint; | ||
+ | * mode 5: the output is activated when the position in pulse fronts is greater than the setpoint and is disactivated when the position in pulse fronts is less than the setpoint; | ||
+ | * mode 6: the output is disactivated when the position in pulse fronts is greater than the setpoint and is activated when the position in pulse fronts is less than the setpoint. | ||
+ | * | ||
+ | === - Delta Actual position === | ||
+ | The device always gives the absolute position of the axis. The count change can also be performed by directly writing the new value of the | ||
+ | //posit// parameter.\\ | ||
+ | If 100 unit measures are subtracted from the count:\\ | ||
+ | <code QCL > | ||
+ | Count.posit = Count.posit - 100 | ||
+ | </ | ||
+ | An error is introduced because it sets the position //posit// = -100, when the axis may have an intermediary position between one unit measure and the next (e.g. 100.3). This fraction (0.3) is lost and if repeated can cause a build up of a significant error.\\ | ||
+ | For this reason there is the DELCNT command that can change the posit by a value set by the //delta// parameter.\\ | ||
+ | For instance, if //pulse// and //measure// are configured to express the position in tenths of a degree and //posit// expresses the angular position. For this to always fall between zero and 360 degrees, the following code must be added: | ||
+ | <code QCL > | ||
+ | IF Count.posit GE 3600 | ||
+ | Count.delcnt = -3600 | ||
+ | Count.DELCNT | ||
+ | ENDIF | ||
+ | </ | ||
+ | |||
+ | For the command execution conditions see its specific description. | ||
+ | Execution of the DELCNT command is ensured even if a unit measure cannot be expressed as a finite number of pulse fronts. For instance with parameters measure = 1000 and pulse = 1024, the value 3600 of the previous example corresponds to 3686.4 pulses. A complex internal algorhythm allows the device to consider the decimal part of this value and by internal accumulators, | ||
+ | ** Example: **\\ | ||
+ | If //pulse// = 10, //measure// = 1, the axis position reading is 2 and it is found at point A. | ||
+ | |||
+ | To add two unit measures to the //posit// position. | ||
+ | The instructions : | ||
+ | <code QCL> | ||
+ | Count.posit = Count.posit + 2 | ||
+ | </ | ||
+ | take the axis to the new position B. | ||
+ | The instructions: | ||
+ | <code QCL> | ||
+ | Count.delta = 2 | ||
+ | Count.DELCNT Asse | ||
+ | </ | ||
+ | take the axis to position C.\\ | ||
+ | |||
+ | If //posit// is modified directly without using the //DELCNT// command (as in the first example) an error is introduced. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ^:info:^To send a sequence of //DELCNT// commands, it is best to calculate the size of the addition and only send the command once. If this is not possible great care must be taken to avoid sending a sequence of commands not separated by a read instruction on the device parameter.\\ Example:\\ <code QCL> | ||
+ | Count.DELCNT | ||
+ | WAIT Count.delta | ||
+ | Count.delta = 40 | ||
+ | Count.DELCNT | ||
+ | </ | ||
+ | |||
+ | ===== - Errors management ===== | ||
+ | |||
+ | The presence of an error in device is reported in the state // | ||
+ | When // | ||
+ | If the device is in error, to resume production you need to erase the state through the command //RSERR// | ||
+ | |||
+ | ===== - Warnings management ===== | ||
+ | |||
+ | The presence of a warning in device is reported in the state // | ||
+ | When // | ||
+ | |||
+ | ^Code^Priority^Description^ | ||
+ | |1|0|Command not executed| | ||
+ | |||
+ | To clear the status // | ||
+ | |||
+ | |||
+ | ===== - List of Parameters ===== | ||
+ | |||
+ | ===measure=== | ||
+ | {{template> | ||
+ | |shortdescr=Reference measurement for the calculation of the conversion factor between pulse fronts and unit measures| | ||
+ | |dim=Long| | ||
+ | |default=Retentive| | ||
+ | |accesstype=Read - Write| | ||
+ | |um=Um| | ||
+ | |id= - | | ||
+ | |range=1-999999| | ||
+ | |wrcond=-| | ||
+ | |longdescr=Indication of the distance, in unit measures, travelled by the axis to obtain the pulse fronts set in the pulse parameter. This parameter is used to calculate the conversion factor between pulse fronts and unit measures.\\ | ||
+ | //posit// = //encoder// * //measure// / //pulse// \\ | ||
+ | The //measure// / //pulse// ratio must be between 0.00935 and 1.}} | ||
+ | |||
+ | ---- | ||
+ | ===pulse=== | ||
+ | {{template> | ||
+ | |shortdescr=Number of pulse fronts for the calculation of the conversion facter between pulse fronts and unit measures | | ||
+ | |dim=Long| | ||
+ | |default=Retentive| | ||
+ | |accesstype=Read - Write| | ||
+ | |um= - | | ||
+ | |id= - | | ||
+ | |range=1-999999| | ||
+ | |wrcond=-| | ||
+ | |longdescr=Indication of the number of pulse fronts that the two-way transducer will generate to obtain a movement equal to measure. This parameter is used to calculate the conversion factor between pulse fronts and unit measures.\\ | ||
+ | //posit// = //encoder// * //measure// / //pulse// \\ | ||
+ | The //measure// / //pulse// ratio must be between 0.00935 and 1.}} | ||
+ | |||
+ | ---- | ||
+ | ===posit=== | ||
+ | {{template> | ||
+ | |shortdescr=Actual position in unit measures| | ||
+ | |dim=Long| | ||
+ | |default=Retentive| | ||
+ | |accesstype=Read - Write| | ||
+ | |um=Um| | ||
+ | |id= - | | ||
+ | |range= - | | ||
+ | |wrcond=-| | ||
+ | |longdescr=The actual position value of the axis in unit measures.\\ | ||
+ | //posit// = //encoder// * //measure// / // | ||
+ | |||
+ | ---- | ||
+ | ===encoder=== | ||
+ | {{template> | ||
+ | |shortdescr=Actual position in pulse fronts| | ||
+ | |dim=Long| | ||
+ | |default=Retentive| | ||
+ | |accesstype=Read - Write| | ||
+ | |um=Pulse fronts| | ||
+ | |id= - | | ||
+ | |range=-| | ||
+ | |wrcond=-| | ||
+ | |longdescr=The actual position expressed in pulse fronts.}} | ||
+ | |||
+ | ---- | ||
+ | ===delta=== | ||
+ | {{template> | ||
+ | |shortdescr=Variation of instant position for using the DELCNT command| | ||
+ | |dim=Long| | ||
+ | |default=Retentive| | ||
+ | |accesstype=Read - Write| | ||
+ | |um=Um| | ||
+ | |id= - | | ||
+ | |range=-999999-999999| | ||
+ | |wrcond=-| | ||
+ | |longdescr=The value added to the instant position when a DELCNT command is sent. Moreover the position in the //delta// parameter is memorised when using the acquisition on activation of an interrupt digital input.}} | ||
+ | |||
+ | ---- | ||
+ | ===axetype=== | ||
+ | {{template> | ||
+ | |shortdescr=Type of axis| | ||
+ | |dim=Flag| | ||
+ | |default=Retentive| | ||
+ | |accesstype=Read - Write| | ||
+ | |um=-| | ||
+ | |id= - | | ||
+ | |range=-999999-999999| | ||
+ | |wrcond=-| | ||
+ | |longdescr=Selection of the type of axis being commanded: | ||
+ | * 0: linear axis | ||
+ | * 1: circular axis (angular). The count starts again from zero after reading the //measure// value.}} | ||
+ | |||
+ | ---- | ||
+ | ===capture=== | ||
+ | {{template> | ||
+ | |shortdescr=Position capture mode on activation of an interrupt digital input| | ||
+ | |dim=Byte| | ||
+ | |default=Retentive| | ||
+ | |accesstype=Read - Write| | ||
+ | |um=-| | ||
+ | |id= - | | ||
+ | |range=0-2| | ||
+ | |wrcond=-| | ||
+ | |longdescr=The parameter defines the capture mode for the position in pulse fronts on activation of an interrupt digital input: | ||
+ | * 0: disabled, | ||
+ | * 1: One-shot on down front. The instant position is captured in pulse fronts on the first down front of the interrup digital input signal after activation of // | ||
+ | * 2: One-shot on up front . The instant position is captured in pulse fronts on the first up front of the interrupt digital input signal after activation of // | ||
+ | |||
+ | ---- | ||
+ | ===tbf=== | ||
+ | {{template> | ||
+ | |shortdescr=Frequency meter sampling time| | ||
+ | |dim=Byte| | ||
+ | |default=Retentive| | ||
+ | |accesstype=Read - Write| | ||
+ | |um=-| | ||
+ | |id= - | | ||
+ | |range=0-5| | ||
+ | |wrcond=-| | ||
+ | |longdescr=Definition of the frequency meter sampling time: | ||
+ | * 0: 240 ms, | ||
+ | * 1: 480 ms, | ||
+ | * 2: 24 ms, | ||
+ | * 3: 120 ms, | ||
+ | * 4: 960 ms, | ||
+ | * 5: 1200 ms. | ||
+ | The device, for calculation of the signal frequency input at the two-way counter (frq parameter), counts the number of pulses received in a time period defined by the //tbf// parameter and calculates an average value. The lower the sampling time, the faster the update of the //frq// parameter, however take care at low frequencies because the sampling time may not be long enough to sample.}} | ||
+ | |||
+ | ---- | ||
+ | ===frq=== | ||
+ | {{template> | ||
+ | |shortdescr=Input signal frequency| | ||
+ | |dim=Long| | ||
+ | |default=0| | ||
+ | |accesstype=Read| | ||
+ | |um=Hz| | ||
+ | |id= - | | ||
+ | |range=-| | ||
+ | |wrcond=-| | ||
+ | |longdescr=It' | ||
+ | |||
+ | ---- | ||
+ | ===mode1=== | ||
+ | {{template> | ||
+ | |shortdescr=Output command mode indicated in selout1 by the comparator| | ||
+ | |dim=Byte| | ||
+ | |default=Retentive| | ||
+ | |accesstype=Read - Write| | ||
+ | |um=-| | ||
+ | |id= - | | ||
+ | |range=0-6| | ||
+ | |wrcond=-| | ||
+ | |longdescr=This parameter defines the activation and disattivazione rules for the output indicated in the //selout1// parameter by the comparator.}} | ||
+ | |||
+ | ---- | ||
+ | ===selout1=== | ||
+ | {{template> | ||
+ | |shortdescr=Output commanded by comparator 1| | ||
+ | |dim=Byte| | ||
+ | |default=Retentive| | ||
+ | |accesstype=Read - Write| | ||
+ | |um=-| | ||
+ | |id= - | | ||
+ | |range=0-1| | ||
+ | |wrcond=-| | ||
+ | |longdescr=Indication of the output is commanded by comparator 1: | ||
+ | * 0: Out1, | ||
+ | * 1: Out2.}} | ||
+ | |||
+ | ---- | ||
+ | ===setpoint1=== | ||
+ | {{template> | ||
+ | |shortdescr=Comparation threshold for comparator 1| | ||
+ | |dim=Long| | ||
+ | |default=Retentive| | ||
+ | |accesstype=Read - Write| | ||
+ | |um=Um| | ||
+ | |id= - | | ||
+ | |range=-999999-999999| | ||
+ | |wrcond=-| | ||
+ | |longdescr=Definition of the threshold setpoint for comparing with the instant position value in pulse fronts. The modified output is indicated by the //selout1// parameter.}} | ||
+ | |||
+ | ---- | ||
+ | ===timer1=== | ||
+ | {{template> | ||
+ | |shortdescr=Activation delay time of selout1 output| | ||
+ | |dim=Word| | ||
+ | |default=Retentive| | ||
+ | |accesstype=Read - Write| | ||
+ | |um=ms| | ||
+ | |id= - | | ||
+ | |range=-999999-999999| | ||
+ | |wrcond=-| | ||
+ | |longdescr=Definition for the output indicated in // | ||
+ | |||
+ | ---- | ||
+ | ===mode2=== | ||
+ | {{template> | ||
+ | |shortdescr=Output command mode indicated in selout1 by the comparator| | ||
+ | |dim=Byte| | ||
+ | |default=Retentive| | ||
+ | |accesstype=Read - Write| | ||
+ | |um=-| | ||
+ | |id= - | | ||
+ | |range=0-6| | ||
+ | |wrcond=-| | ||
+ | |longdescr=This parameter defines the activation and disactivation rules for the output indicated in the //selout2// parameter by the comparator.}} | ||
+ | |||
+ | ---- | ||
+ | ===selout2=== | ||
+ | {{template> | ||
+ | |shortdescr=Output commanded by comparator 1 | | ||
+ | |dim=Byte| | ||
+ | |default=Retentive| | ||
+ | |accesstype=Read - Write| | ||
+ | |um=-| | ||
+ | |id= - | | ||
+ | |range=0-1| | ||
+ | |wrcond=-| | ||
+ | |longdescr=Indication of which output is commanded by comparator 2: | ||
+ | * 0: Out1, | ||
+ | * 1: Out2.}} | ||
+ | |||
+ | ---- | ||
+ | ===setpoint2=== | ||
+ | {{template> | ||
+ | |shortdescr=Comparation threshold for comparator 1| | ||
+ | |dim=Long| | ||
+ | |default=Retentive| | ||
+ | |accesstype=Read - Write| | ||
+ | |um=Um| | ||
+ | |id= - | | ||
+ | |range=-999999-999999| | ||
+ | |wrcond=-| | ||
+ | |longdescr=Definition of the setpoint (i.e. threshold) where the instant position is compared in pulse fronts. The output consequently modified is indicated by the //selout2// parameter.}} | ||
+ | |||
+ | ---- | ||
+ | ===timer2=== | ||
+ | {{template> | ||
+ | |shortdescr=Activation delay time for selout1 output| | ||
+ | |dim=Word| | ||
+ | |default=Retentive| | ||
+ | |accesstype=Read - Write| | ||
+ | |um=ms| | ||
+ | |id= - | | ||
+ | |range=-999999-999999| | ||
+ | |wrcond=-| | ||
+ | |longdescr= The output indicated by // | ||
+ | |||
+ | ---- | ||
+ | ===errcode=== | ||
+ | {{template> | ||
+ | |shortdescr=error ID code| | ||
+ | |dim=Byte| | ||
+ | |default=0| | ||
+ | |accesstype=Read| | ||
+ | |um=-| | ||
+ | |id= - | | ||
+ | |range=0-100| | ||
+ | |wrcond=-| | ||
+ | |longdescr=Indication of the type of error tripped in the system. When //st_error = 1// is found in the errcode variable, the type of error and the errvalue variable gives an indication on the cause of error. If an error trips in the device, to restore operation bisogna cancellare the st_error status must be eliminated by the //RSERR// command.\\ | ||
+ | This device does not create an error code.)}} | ||
+ | |||
+ | ---- | ||
+ | ===errvalue=== | ||
+ | {{template> | ||
+ | |shortdescr=Cause of error ID code | | ||
+ | |dim=Byte| | ||
+ | |default=0| | ||
+ | |accesstype=Read| | ||
+ | |um=-| | ||
+ | |id= - | | ||
+ | |range=0-100| | ||
+ | |wrcond=-| | ||
+ | |longdescr=Indication of the cause of an error tripped in the system. The code is only valid if // | ||
+ | |||
+ | ---- | ||
+ | ===wrncode=== | ||
+ | {{template> | ||
+ | |shortdescr=Warning ID code| | ||
+ | |dim=Byte| | ||
+ | |default=0| | ||
+ | |accesstype=Read| | ||
+ | |um=-| | ||
+ | |id= - | | ||
+ | |range=0-100| | ||
+ | |wrcond=-| | ||
+ | |longdescr=Indication of the type of warning tripped in the system. The // | ||
+ | When // | ||
+ | |||
+ | ^Code^Priority^Description^ | ||
+ | | 1 | 0 |Command not executed| | ||
+ | ---- | ||
+ | ===wrnvalue=== | ||
+ | {{template> | ||
+ | |shortdescr=Cause of warning ID code| | ||
+ | |dim=Byte| | ||
+ | |default=0| | ||
+ | |accesstype=Read| | ||
+ | |um=-| | ||
+ | |id= - | | ||
+ | |range=0-100| | ||
+ | |wrcond=-| | ||
+ | |longdescr=Indication of the cause of warning tripped in the system.)}} | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== - Status List ===== | ||
+ | ===st_cntlock=== | ||
+ | {{template> | ||
+ | |shortdescr=Update position status disabled| | ||
+ | |default= Retentive| | ||
+ | |id= -| | ||
+ | |longdescr= Signal that the position update is blocked : | ||
+ | * 0: position update enabled | ||
+ | * 1: position update disabled }} | ||
+ | ------ | ||
+ | |||
+ | ===st_cntrev=== | ||
+ | {{template> | ||
+ | |shortdescr=Invert position update status| | ||
+ | |default= Retentive| | ||
+ | |id= -| | ||
+ | |longdescr=Signal that the position update is inverted: | ||
+ | * 0: position update not inverted, | ||
+ | * 1: position update inverted }} | ||
+ | ------ | ||
+ | |||
+ | ===st_intenbl=== | ||
+ | {{template> | ||
+ | |shortdescr=Interrupt digital input activation status| | ||
+ | |default= 0| | ||
+ | |id= -| | ||
+ | |longdescr=Signal that the capture instant position is enabled on the interrupt digital input, which is activated by the //INTENBL// command and disactivated by the //INTDSBL// command or on the // | ||
+ | ------ | ||
+ | |||
+ | ===st_capture=== | ||
+ | {{template> | ||
+ | |shortdescr=Capture instant position activation| | ||
+ | |default= 0| | ||
+ | |id= -| | ||
+ | |longdescr=The instant position capturing is activated, which is reset by the // | ||
+ | ------ | ||
+ | |||
+ | ===st_int=== | ||
+ | {{template> | ||
+ | |shortdescr=Interrupt digital input status| | ||
+ | |default= 0| | ||
+ | |id= -| | ||
+ | |longdescr=Indication of the interrupt digital input status | ||
+ | * 0: interrupt digital input disattivated | ||
+ | * 1: interrupt digital input activated}} | ||
+ | ------ | ||
+ | |||
+ | ===st_cmp1=== | ||
+ | {{template> | ||
+ | |shortdescr= Comparator 1 status| | ||
+ | |default= 0| | ||
+ | |id= -| | ||
+ | |longdescr=Activation signal for comparator 1: | ||
+ | * 0: comparator 1 disactivated | ||
+ | * 1: comparator 1 activated}} | ||
+ | ------ | ||
+ | |||
+ | ===st_cmp2=== | ||
+ | {{template> | ||
+ | |shortdescr=Comparator 2 status| | ||
+ | |default= 0| | ||
+ | |id= -| | ||
+ | |longdescr=Activation signal for comparator 2: | ||
+ | * 0: comparator 2 disactivated | ||
+ | * 1: comparator 2 activated}} | ||
+ | ------ | ||
+ | |||
+ | ===st_error=== | ||
+ | {{template> | ||
+ | |shortdescr=Error present| | ||
+ | |default= 0| | ||
+ | |id= -| | ||
+ | |longdescr=Indication of a device error status, to know the type of error refer to the //errcode// and // | ||
+ | * 0: error not present | ||
+ | * 1: error present}} | ||
+ | ------ | ||
+ | |||
+ | ===st_warning=== | ||
+ | {{template> | ||
+ | |shortdescr=Warning present| | ||
+ | |default= 0| | ||
+ | |id= -| | ||
+ | |longdescr=Indication of a warning status of the device, to know the type of warning refer to the //wrncode// and //wrnalue// variables: | ||
+ | * 0: warning not present | ||
+ | * 1: warning present}} | ||
+ | ------ | ||
+ | |||
+ | ===== - List of Commands ===== | ||
+ | The commands provided to manage the device are listed below, ordered in decreasing priority. There are two ways to execute a command: | ||
+ | * By the Qview watches panels | ||
+ | * By a QCL instruction | ||
+ | |||
+ | In the second case the QCL program execution is blocked until the end of the command, which lasts between 0 and 2 sampling times. | ||
+ | |||
+ | ===CNTLOCK=== | ||
+ | {{template> | ||
+ | |cond= - | | ||
+ | |shortdescr=Disables update of the actual position| | ||
+ | |id= -| | ||
+ | |longdescr=Disables update of the actual position. In this condition any axis movement is not detected}} | ||
+ | --------- | ||
+ | |||
+ | ===CNTUNLOCK=== | ||
+ | {{template> | ||
+ | |cond= - | | ||
+ | |shortdescr=Enables update of the actual position| | ||
+ | |id= -| | ||
+ | |longdescr= Enables update of the actual position }} | ||
+ | --------- | ||
+ | |||
+ | ===CNTREV=== | ||
+ | {{template> | ||
+ | |cond= - | | ||
+ | |shortdescr=Inversion of position update| | ||
+ | |id= -| | ||
+ | |longdescr=It can invert the sign of the position update; the // | ||
+ | --------- | ||
+ | |||
+ | ===CNTDIR=== | ||
+ | {{template> | ||
+ | |cond= - | | ||
+ | |shortdescr=Position update not inverted| | ||
+ | |id= -| | ||
+ | |longdescr=Disables an inversion of the position update; the // | ||
+ | --------- | ||
+ | |||
+ | ===INTENBL=== | ||
+ | {{template> | ||
+ | |cond= capture> | ||
+ | |shortdescr=Enables the actual position capture on activation of the interrupt digital input| | ||
+ | |id= -| | ||
+ | |longdescr=Activates the actual position capture on activation of the interrupt digital input dedicata, the value is memorised in the delta parameter. | ||
+ | The // | ||
+ | |||
+ | ===INTDSBL=== | ||
+ | {{template> | ||
+ | |cond= - | | ||
+ | |shortdescr=Disables the instant position capture on activation of the interrupt digital input| | ||
+ | |id= -| | ||
+ | |longdescr=Disactivates the instant position capture on activation of the dedicated interrupt digital input. | ||
+ | The // | ||
+ | --------- | ||
+ | |||
+ | ===RSCAPTURE=== | ||
+ | {{template> | ||
+ | |cond= - | | ||
+ | |shortdescr=Deactivation of the capture status | | ||
+ | |id= -| | ||
+ | |longdescr=Deactivates the // | ||
+ | --------- | ||
+ | |||
+ | ===DELCNT=== | ||
+ | {{template> | ||
+ | |cond= st_intenbl=0 | | ||
+ | |shortdescr=Modify //posit// command by a value equal to //delta//| | ||
+ | |id= -| | ||
+ | |longdescr=The axis position is modified by agebraic addition of the value specified in the //delta// variable}} | ||
+ | --------- | ||
+ | |||
+ | ===SETCMP1=== | ||
+ | {{template> | ||
+ | |cond= - | | ||
+ | |shortdescr=Activate comparation 1| | ||
+ | |id= -| | ||
+ | |longdescr=Forced activation of the //st_cmp1// status}} | ||
+ | --------- | ||
+ | |||
+ | ===RESCMP1=== | ||
+ | {{template> | ||
+ | |cond= - | | ||
+ | |shortdescr=Reset comparation 1| | ||
+ | |id= -| | ||
+ | |longdescr=Zero set //st_cmp1// status}} | ||
+ | --------- | ||
+ | |||
+ | ===SETCMP2=== | ||
+ | {{template> | ||
+ | |cond= - | | ||
+ | |shortdescr=Activate comparation 2| | ||
+ | |id= -| | ||
+ | |longdescr=Forzed activation of the //st_cmp2// status}} | ||
+ | --------- | ||
+ | |||
+ | ===RESCMP2=== | ||
+ | {{template> | ||
+ | |cond= - | | ||
+ | |shortdescr=Reset comparation 2| | ||
+ | |id= -| | ||
+ | |longdescr=Zero-set the //st_cmp2// status}} | ||
+ | --------- | ||
+ | |||
+ | ===RSERR=== | ||
+ | {{template> | ||
+ | |cond= - | | ||
+ | |shortdescr=Reset error status| | ||
+ | |id= -| | ||
+ | |longdescr=Zero-set the // | ||
+ | --------- | ||
+ | |||
+ | ===RSWRN=== | ||
+ | {{template> | ||
+ | |cond= - | | ||
+ | |shortdescr=Reset warning status| | ||
+ | |id= -| | ||
+ | |longdescr=Zero-set the // | ||
+ | --------- | ||
+ | |||
+ | ===== - Limitations ===== | ||
+ | |||
+ | If you change the parameters //measure// or //pulse// after sending the command //DELCNT//, the remains of the conversion of the delta space in pulses are reset. | ||
+ | |||
+ | ===== - Application example ===== | ||
+ | |||
+ | ^: | ||
+ | |||
+ | ==== - Configuration unit ==== | ||
+ | |||
+ | <code QCL> | ||
+ | ; | ||
+ | ; COUNTER3 example | ||
+ | ; | ||
+ | |||
+ | ; Bus declaration | ||
+ | BUS | ||
+ | 1 1K31F 20 | ||
+ | 2 . . | ||
+ | 3 1MG8F . | ||
+ | 4 . | ||
+ | |||
+ | ; Input declaration | ||
+ | INPUT | ||
+ | ifEnableZ | ||
+ | ifEnableComp | ||
+ | |||
+ | ; Output declaration | ||
+ | OUTPUT | ||
+ | out201 | ||
+ | out202 | ||
+ | |||
+ | ; Device declaration | ||
+ | INTDEVICE | ||
+ | Count COUNTER3 | ||
+ | |||
+ | END | ||
+ | </ | ||
+ | |||
+ | ==== - COUNTER3 management unit ==== | ||
+ | |||
+ | <code QCL> | ||
+ | SYSTEM | ||
+ | slPrsPos | ||
+ | slSet1 | ||
+ | slSet2 | ||
+ | |||
+ | GLOBAL | ||
+ | gfApp01 | ||
+ | gfApp02 | ||
+ | |||
+ | BEGIN | ||
+ | ; | ||
+ | ; Initialization | ||
+ | ; | ||
+ | Count.measure = 1000 ; | ||
+ | Count.pulse = 1000 ; | ||
+ | |||
+ | Count.capture = 1 ;set capture on rise edge | ||
+ | IF slSet1 EQ 0 | ||
+ | slSet1 = 500 ; | ||
+ | ENDIF | ||
+ | IF slSet2 EQ 0 | ||
+ | slSet2 = 100 ; | ||
+ | ENDIF | ||
+ | |||
+ | MAIN: | ||
+ | |||
+ | |||
+ | IF ifEnableZ | ||
+ | Count.INTENBL | ||
+ | ELSE | ||
+ | Count.INTDSBL | ||
+ | ENDIF | ||
+ | |||
+ | IF Count.st_capture | ||
+ | Count.delta = -(Count.delta - slPrsPos) | ||
+ | Count.DELCNT | ||
+ | Count.RSCAPTURE | ||
+ | ENDIF | ||
+ | |||
+ | IF ifEnableComp | ||
+ | IF NOT gfApp01 | ||
+ | Count.mode1 = 5 ;Set Mode1 for comparation 1 | ||
+ | Count.selout1 = 0 | ||
+ | Count.setpoint1 = slSet1 | ||
+ | Count.timer1 = 0 | ||
+ | Count.mode2 = 6 ;Set Mode2 for comparation 2 | ||
+ | Count.selout2 = 1 | ||
+ | Count.setpoint2 = slSet2 | ||
+ | Count.timer2 = 0 | ||
+ | gfApp01 = 1 | ||
+ | gfApp02 = 0 | ||
+ | ENDIF | ||
+ | ELSE ;When it is not enabled | ||
+ | IF NOT gfApp02 | ||
+ | Count.mode1 = 0 ; | ||
+ | RESOUT out201 | ||
+ | Count.selout1 = 0 | ||
+ | Count.mode2 = 0 ; | ||
+ | RESOUT out202 | ||
+ | Count.selout2 = 1 | ||
+ | gfApp01 = 0 | ||
+ | gfApp02 = 1 | ||
+ | ENDIF | ||
+ | ENDIF | ||
+ | |||
+ | WAIT 1 | ||
+ | JUMP MAIN | ||
+ | |||
+ | END | ||
+ | </ |