RMA
Member
The customer wants to use an existing function block from previous projects to generate variable length pulses. The block looks pretty simple (apart from the fact that it's totally uncommented :angr: ) and it requires only a level rather than an edge to start it and saves to counters. The operator can set the length of both the impulse and the pause between impulses from the panel. The only problem is - it doesn't work!
This is the program:
and here is the block being called with the various parameters and associated comments:
Actually the program originally started at label MX: the bit before that I added to try to see what was happening.
As you can see, significant bits of the program are - apparently - not being run through very often, or even at all. The key bit of the program is the line shortly after label M001: - ON #Takt
#Takt is actually fed by M3.0 which is an impulse for one cycle which appears every second. It's derived from the CPU frequency generator Byte. Accordingly, the part of the program following the jump SPB M004 will only run once every second, thus spending most of its time greyed out - as it is in the screen dump. However, it should run every second and update #IW each time - it doesn't, #IW apparently gets updated randomly at intervals of between 10 and 20 seconds. Apparently, as a result of this the comparison of the #IW (current value) with #SW_Pau (the setpoint) is never, or perhaps only occasionally satisfied, so the Impulse output is never turned on.
I say apparently, because the extra bit of program I added at the top of the block behaves in exactly the same way, but, if I look at the value MW610 in a VAT, sure enough it's counting up once a second!
Anybody got any ideas what's going on here - both with the apparently incorrect display and, given that the pulse input is being handled correctly in my additional bit of program, the actual pulse output is not happening.
The customer is adamant that the FC works as desired in previous projects.
Edit: Just noticed that another of my mods is still in the program the 5 lines following the S #Impuls command are also not in the original program. I've just checked this a bit more closely in the VAT and it turns out that M600.0 is actually being set at the end of every pause (5 seconds in this case), however, it is apparently only on for 1 cycle as the output bits in the VAT only occasionally blink. Maybe the program does work quite the way the customer thinks it does.
Guess I'll need to look at that a bit more closely!
This is the program:
and here is the block being called with the various parameters and associated comments:
Actually the program originally started at label MX: the bit before that I added to try to see what was happening.
As you can see, significant bits of the program are - apparently - not being run through very often, or even at all. The key bit of the program is the line shortly after label M001: - ON #Takt
#Takt is actually fed by M3.0 which is an impulse for one cycle which appears every second. It's derived from the CPU frequency generator Byte. Accordingly, the part of the program following the jump SPB M004 will only run once every second, thus spending most of its time greyed out - as it is in the screen dump. However, it should run every second and update #IW each time - it doesn't, #IW apparently gets updated randomly at intervals of between 10 and 20 seconds. Apparently, as a result of this the comparison of the #IW (current value) with #SW_Pau (the setpoint) is never, or perhaps only occasionally satisfied, so the Impulse output is never turned on.
I say apparently, because the extra bit of program I added at the top of the block behaves in exactly the same way, but, if I look at the value MW610 in a VAT, sure enough it's counting up once a second!
Anybody got any ideas what's going on here - both with the apparently incorrect display and, given that the pulse input is being handled correctly in my additional bit of program, the actual pulse output is not happening.
The customer is adamant that the FC works as desired in previous projects.
Edit: Just noticed that another of my mods is still in the program the 5 lines following the S #Impuls command are also not in the original program. I've just checked this a bit more closely in the VAT and it turns out that M600.0 is actually being set at the end of every pause (5 seconds in this case), however, it is apparently only on for 1 cycle as the output bits in the VAT only occasionally blink. Maybe the program does work quite the way the customer thinks it does.
Guess I'll need to look at that a bit more closely!
Last edited: