: Pulsing a discrete command bit from InTouch

 

NOTE:  This article and all content are provided on an "as is" basis without any warranties of any kind, whether express or implied, including, but not limited to the implied warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall Q-mation be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortuous action, arising out of or in connection with the use or performance of information contained in this article.

 

We receive requests for the ability to set a bit from InTouch for a certain amount of time and then reset it. There are a couple ways that you can approach this:

  • Set the bit in InTouch and allow the PLC to reset it after receiving the signal. This would be the most reliable method of ensuring that the signal is received by the controller but would require that logic to be added in the PLC for each bit that required that functionality.

  • You could add a QuickFunction that can control pulsing the discrete bit. An example that we have used in the past, qPulse, is shown below.

-------------------------------------------------------------------------------------------------------------
{ This function will PULSE the passed discrete tag ON based on the delay that is passed in.
NOTE: This QuickFunction must run Asynchronously
NOTE: This QuickFunction leverages nested FOR-NEXT loops for the delay. By default,
this should not execute longer than 5 seconds.
REQUIRES:
This function uses an INDIRECT DISCRETE tag called "indPulse"
ARGUMENTS:
mDiscreteTag <Message>: String containing the Discrete Tag to pulse
iDelay <Integer>: Specifies the number of external loop iterations

EXAMPLE:
IF NOT IsAnyAsyncFunctionBusy( 3 ) THEN
CALL qPulse( disTemp.Name, intTemp);
ENDIF;
}


DIM loopCount;
DIM loopDelay;
indPulse.Name = mDiscreteTag;
indPulse = 1;
FOR loopCount = 1 TO iDelay
FOR loopDelay = 1 TO 10000
NEXT;
NEXT;
indPulse = 0;
-------------------------------------------------------------------------------------------------------------

 

Please feel free to email support@qmation.com with questions.

 

©2007 Q-mation, Inc. All rights reserved. All trademarks are the property of their respective owners.