Follow

PAL Script - Starting and Stopping Encoders with PAL Scripts

SAM Broadcaster does not include the option to start or stop individual encoders however, we can achieve this through PAL Scripting.

You must remember that your list of encoders starting from the top is not numbered 1,2,3 and so on but is in fact numbered 0,1,2,3 etc.

We have four scripts below, the first will start all encoders, the second will stop all encoders.  The last two scripts will start and stop a single encoder but you would need to determine the number of the encoder you wish to start or stop:

PAL Script to Start All Encoders (EncoderStart.PAL)

{*******************************
PAL Script to start all encoders
********************************}

var I : Integer;

for I := 0 to Encoders.Count-1 do
if not Encoders[I].Started then begin
Encoders[I].Start;
WriteLn('Started Encoder: '+InttoStr(I));
end;

PAL Script to Stop All Encoders (EncoderStop.PAL)

{******************************
PAL Script to stop all encoders
*******************************}

var I : Integer;

for I := 0 to Encoders.Count-1 do
if not Encoders[I].Started then begin
Encoders[I].Stop;
WriteLn('Stopped Encoder: '+InttoStr(I));
end;

PAL Script to Start One Encoder (IndividualEncoderStart.PAL)

{*************************************
PAL Script to start one encoder
Remember the Encoder count starts at 0
**************************************}

var I : Integer = 3; //Replace 3 with the required encoder number

Encoders[I].Start;
WriteLn('Started Encoder: '+InttoStr(I));

PAL Script to Stop One Encoder (IndividualEncoderStop.PAL)

{*************************************
PAL Script to stop one encoder
Remember the Encoder count starts at 0
**************************************}

var I : Integer = 3; //Replace 3 with the required encoder number

Encoders[I].Stop;
WriteLn('Stopped Encoder: '+InttoStr(I));

You can copy and pasted the code into your PAL Scripting IDE or download the scripts which are attached to thsi document.  You can then use the Event Scheduler to run these PAL scripts which we hope gives you better control over your encoders.

 

 

 

 

 

 

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments