You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Here are the function blocks for a pulser. There are two of these, one gives out a pulse with a duration of 3 seconds (PulseThreeSeconds) and the other for 4 seconds (PulseFourSeconds). The times in these are hardcoded because they were used a couple of times in the program, and it would have been more work to add a variable to control the pulse length than to make two different ones.

This works so that if it gets a boolean value in, it gives out a pulse that lasts for 3 seconds or 4 seconds respectively. This is regardless if you turn off the input or let it stay on. When the pulse is finished, the function block needs a new rising edge input to send a new pulse.

INPUT - (Example PulseFourSeconds)

  • in → BOOL

OUTPUT- (Example PulseFourSeconds)

  • out → BOOL

Intern Variables - (ExamplePulseFourSeconds)

  • timer → TOF
  • prev_in → BOOL
  • rising_edge → BOOL


CODED SOLUTION 

Variable Decleration - (Example PulseFourSeconds)

CODE - (Example PulseFourSeconds)






  • No labels