Guest Støk Posted April 3, 2004 Report Posted April 3, 2004 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 Quote
Jimbo Posted April 3, 2004 Report Posted April 3, 2004 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.