byte-motion / byte-motion/RNL_RAPIDLibrary

Implement Execution mode

Open
#43 1 comment 0 reactions 0 assignees View on GitHub
New Module
Dominant language
AMPL
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Implement a datatype that tells the robot how it should operate. Categorized into different modes like "Normal" "Simulation" "Debug" and "Disabled".

Draft of module:

```
MODULE RNL_B_executionMode

!executionMode is a set of modes that descibe different ways for the robot
!to behave.

!Dependencies:
! - None

RECORD executionMode
bool disableExecution;
bool printDebug;

bool simulateSignalInput;
bool disableSignalOutput;
bool disableEvents;
ENDRECORD

!disableExecution - skip all execution
!printDebug - print debug to TCP and/or file
!simulateSignalInput - simulate input signals so they are not required
!disableSignalOutput - disable output signals, not setting them
!disableEvents - disable events, not calling them

!Pre defined execution modes
CONST executionMode executionMode_Normal:=[FALSE,FALSE,FALSE,FALSE,FALSE];
CONST executionMode executionMode_Simulation:=[FALSE,FALSE,TRUE,FALSE,FALSE];
CONST executionMode executionMode_Debug:=[FALSE,TRUE,FALSE,FALSE,FALSE];
CONST executionMode executionMode_Disable:=[TRUE,FALSE,FALSE,FALSE,FALSE];

!Global Execution mode
LOCAL VAR executionMode executionModeGlobal:=[FALSE,FALSE,FALSE,FALSE,FALSE];


FUNC executionMode executionMode_getGlobalMode()
RETURN executionModeGlobal;
ENDFUNC

PROC executionMode_setGlobalMode(executionMode mode)
executionModeGlobal := mode;
ENDPROC



ENDMODULE
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.