Is there a way to count samples processed in a pipetting loop based on the channel pattern used on each iteration of the loop?
For example, if the first iteration through the loop uses “11110000” as a channel pattern, I’d like to add the integer 4 to my Samples Processed variable (and or subtract from my Samples Left To Process variable), whereas if the second iteration uses “11000000”, I’d like it to follow suite and use a value of 2.
I don’t know of an easy native function off the top of my head, but I would create a submethod with the channel pattern as an input variable. Loop through the channel pattern (i=8 iterations in your case) and use the string library function StrMid to return the channel pattern character at the position of interest (your loop counter variable). P.S. don’t forget to iterate your firstemphasized text** argument in the StrMid function as well. Convert the returned string character into an integer using StrIVal and add to your total (Samples Processed variable). Subtract from your Samples Left To Process Variable or end your pipetting loop once your Samples Processed value is equal to your known Number of Samples to process
Another way is to use the StrFind function and search for the substring “0”. Based on your return value, you can extrapolate how many channels were used before you run into a “0”. Note: this has more assumptions than the solution above and may not fit your use case depending on how your channel pattern is configured
To do this, I find using the strReplace function within the HSLStrLib is the easiest function to use to get the information you requested. If you replace the string value “1” with “1”, nothing will change on your channel pattern, but the return value is the count of the number of times the replacement took place. Which in your case is the number of active channels.