Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
if statement
#4
Hi again,

I tried the changed Matlab code as shown in the previous post but that did not seem to work. Could it be that the changes that I made to the firmware code have not been added when I call the PulsePal in Matlab, do I need to update something? By the way here are the changes that I made which I hope are correct. Shown are lines 650 through 672 of the firmware.

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) {
                KillChannel = 1;
            }
           }
         }  
         if (KillChannel) {
            killChannel(x);
         }
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: