Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
if statement
#5
Hi,
finally I was able to get the PulsePal to work the way I wanted it to. It did require one change to the firmware as seen below (Lines 650-677):


Code:
for (int x = 0; x < 4; x++) {
     byte KillChannel = 0;
      // If trigger channels are in toggle mode and a trigger arrived, or in gated mode and line is low, shut down any governed channels that are playing a pulse train
      if (((StimulusStatus[x] == 1) || (PreStimulusStatus[x] == 1))) {
         for (int y = 0; y < 2; y++) {
           if (TriggerAddress[y][x]) {
               if ((TriggerMode[y] == 1) && (LineTriggerEvent[y] == 1)) {
                    KillChannel = 1;
               }
               if ((TriggerMode[y] == 2) && (LineTriggerEvent[y] == 2)) {
                   if ((TriggerMode[1-y] == 2) && (TriggerAddress[1-y][x])) {
                     if (InputValues[1-y] == DefaultInputLevel) {
                       KillChannel = 1;
                     }
                   } else {
                     KillChannel = 1;
                   }
               }
               if ((TriggerMode[y] == 3) && (LineTriggerEvent[y] == 1)){
                  KillChannel = 1;
               }
           }
         }  
         if (KillChannel) {
            killChannel(x);
         }
       
     } else {
Lines 668-669 were added,


Code:
if ((TriggerMode[y] == 3) && (LineTriggerEvent[y] == 1)){
  KillChannel = 1;
Now by linking Chan1 to TriggerChannel1 and this trigger channel receiving a TTL it will start my pulse and by linking Chan1 also to TriggerChannel2 and this trigger channel receiving also a TTL is will stop my pulse and so on until I manually stop this.

Maybe this will be helpful to others.

Ilja
Reply


Messages In This Thread
if statement - by Ilja - 02-13-2020, 10:23 PM
RE: if statement - by Josh - 02-16-2020, 02:11 AM
RE: if statement - by Ilja - 02-18-2020, 11:42 PM
RE: if statement - by Ilja - 02-19-2020, 09:57 PM
RE: if statement - by Ilja - 02-27-2020, 06:25 PM

Forum Jump: