Working With Time; Delay - Crestron SIMPL+ Programming Manual

Crestron simpl+ software: software guide
Hide thumbs Also See for SIMPL+:
Table of Contents

Advertisement

Software

Working with Time

42 • SIMPL+
}
myStruct struct;
PUSH writeCompactFlashCard
{
SIGNED_INTEGER nFileHandle;
INTEGER nNumBytes;
StartFileOperations()
nFileHandle = FileOpen( "\\CF0\\MyFile.txt",
if( nFileHandle >= 0 )
{
WriteStructure( nFileHandle, struct, nNumBytes );
Print( "The number of bytes written = %d", nNumBytes );
FileClose( nFileHandle );
}
EndFileOperations();
}
PUSH readCompactFlashCard
{
SIGNED_INTEGER nFileHandle;
INTEGER nNumBytes;
StartFileOperations()
nFileHandle = FileOpen( "\\CF0\\MyFile.txt", _O_CREAT );
if( nFileHandle >= 0 )
{
ReadStructure( nFileHandle, myInt, nNumBytes );
Print( "The number of bytes read = %d", nNumBytes );
FileClose( nFileHandle );
}
EndFileOperations();
}
Up until now, this manual has discussed elements of the SIMPL+ language that have
no concept of time. This means that each statement in a SIMPL+ program executes
after the previous statement is completed. There are times when programming where
there is a need to have control over exactly when the statements in the program
execute. This section deals with those language constructs.

Delay

The Delay function pauses the execution of the current SIMPL+ for the time
specified in the parameter field. As with most time values in SIMPL+, this time
value is specified in hundredths of seconds. The following program causes the
program to stop for five seconds before resuming.
Crestron SIMPL+
_O_WRONLY | _O_CREAT );
Programming Guide – DOC. 5789A

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents