FC: Jobmailbox Screen Selection - v1.0
This function changes the active screen on a Siemens HMI panel using the jobmailbox mechanism (job 51 — Screen selection).
Use Cases
Section titled “Use Cases”- Navigating to a specific screen from PLC logic.
- Implementing automatic screen routing based on machine state.
Dependencies
Section titled “Dependencies”None.
Parameters
Section titled “Parameters”Function
Section titled “Function”| Parameter | Declaration | Type | Init. value | Description |
|---|---|---|---|---|
newScreenNumber | In/Out | UInt | — | IOX: Target screen number (1..32767) |
jobMailbox | In/Out | Array[0..3] of Word | — | IOX: Siemens HMI job mailbox array |
screenNumber | In/Out | Array[0..4] of Word | — | IOX: Siemens HMI current screen number array |
Jobmailbox Array
Section titled “Jobmailbox Array”| Index | Variable | Description |
|---|---|---|
[0].%B0 | Command | 51 — Screen selection job |
[1] | screen | Target screen number |
[2] | — | 0 |
[3] | field | Field number |
Screen Number Array
Section titled “Screen Number Array”| Index | Description |
|---|---|
[0] | Current screen type: 1= Root screen; 4= Permanent area |
[1] | Current screen number |
[2] | Reserved |
[3] | Current field number |
[4] | Reserved |
Returns
Section titled “Returns”| ENO | Return | Description |
|---|---|---|
TRUE | 0x0000 | Done — screen change requested successfully |
FALSE | 0x0001 | Busy — jobmailbox not yet processed |
FALSE | 0x7000 | No screen — newScreenNumber is 0 |
FALSE | 0x8000 | Out of range — newScreenNumber > 32767 |