You can use the block 'Detect Rise Positive' to detect the rising edge of each pulse. You may set the output of this block to 'uint8' and use a 'Memory' blck to add and count the total number of pulses. This way you can count number of pulses in one channel (say A channel)
Next, you mentioned that you need to count the number of pulses in one channel (say,A) until one pulse in the other channel (say, B)is generated. To develop this system, you may put the former model in a 'Enabled Subsystem'/'Triggered Subsystem' depending on your use case and as the triggering signal you should use the channel B.