Sign in to follow this  
Followers 0
Guest Støk

Pulsgenerating in 1 cyclus

2 posts in this topic

Hello, I will create a pulssignal in a SCL program. The problem is that it must happen in only one cyclus, into a For function and every cyclus there must be one small puls. This puls must drives an other program FB100 that will be called like you can see downstears. 'SIGNAAL' must be the puls. After this FB100 has called there will be a waittimer and then well or not continues with the FOR function. FOR I := 1 TO 5 DO FB100.DB100(INITIALISERING :=1 // IN: INT ,CP_ADRES :=DB99.CP_ADRES // IN: INT ,PIN_CODE :=DB99.PINCODE // IN: STRING ,TEL_NUMMER :=STUREN_GSMNUMMER // IN: STRING ,ALARM_TEKST :=ALARMBERICHT // IN: STRING ,SMS_ZENDEN := SIGNAAL // INOUT: BOOL ,SMS_ONTVANGEN := SMSONTVANGEN // INOUT: BOOL ); WACHTTIMER (PT := WACHTTIJD,IN := TRUE); // Waiting IF (WACHTTIMER.Q) THEN NUMMER_ONTVANGEN_BERICHT:= MID(IN := DB99.SMS_ONTVANGEN_TEKST, L := 10, P := 20); // Looking for confirmation IF (NUMMER_ONTVANGEN_BERICHT = STUREN_GSMNUMMER) THEN I:=5 // tis goed en ge moogt uit de for gaan ELSE CONTINUE; END_IF; ELSE RETURN; END_IF; WACHTTIMER (PT := WACHTTIJD,IN := FALSE); END_FOR; Has someone an solution for this problem. Like you programs it in lad, it will not work because it must just be generated in just one cyclus: I4.0 M1.0 Q1 |--------| |-------| |---------( )---------| I4.0 M1.0 |--------|/|-------------| |-------------- | You can always reach me with an mail on hendriks.geert@pandora.be Greetz Støk

Share this post


Link to post
Share on other sites
i am not sure that i understand your problem. I think there is a problem with the waittimer. the timer doesnt work as a sleep function. you just call the timer and then you can see if it is finished or not, the code wont block there. as i understand your code it shoud send an alarm sms and then check five times the wait period if a confirmation is recieved. if thats the case it could look like this. send sms code - send sms - store number - set check flag check code - if check flag - start timer - if timer done - increment counter - if counter = 5 - error sending sms i hope this helps Greetz Jimbo

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0