4 machine status, 5 program status, Machine status -28 – ElmoMC SimplIQ Software Manual User Manual

Page 90: Program status -28

Advertising
background image

SimplIQ

Software Manual

Program Development and Execution

MAN-SIMSW (Ver. 1.4)

6-28

6.7.4

Machine Status

The DB##MS command returns the status of all existing VAC machines.

Syntax:
DB##MS

This command returns a string in hexadecimal binary format containing a 16-bit number.
Every 4 bits characterize the status of the VAC machine; therefore, the command can give
the status of a maximum of four VAC machines. The most significant bit (bit 4) is dedicated
to run-time errors. If it is set to 1, it indicates that a run-time error has occurred. The
DB##ES[N] command reports further details about the specific VAC errors and resets this
bit. If the run-time error bit is 0, no run-time error has occurred or else it has been reset by a
previous DB##ES[N] command.

The remaining least significant bits (0…3) of the returned status use the following values:
0: Halted
1: Running
2: Idle/Not running
3: Aborted/Fault
4: Does not exist

6.7.5

Program Status

The DB##PS command returns the status of the user program.

Syntax:
DP##PS[N]
where N is a handle of a specified VAC machine.

The DB##PS command returns a string containing hexadecimal binary data with the
following information:


Name


Meaning


Data Type

Size
in Bytes

1 Status

Running status (

section

6.7.4

).

Signed short

2

2 Error code

Last error code or 0 for no error
(

section

6.7.6

).

Signed short

2

3 Program

counter

(PC)

Program counter of current
executing line.

Unsigned short 2

4 Base pointer (BP)

Current base pointer, which is the
saved stack pointer marking the
function entry point. BP is used to
reference local variables of a
function.

Unsigned short 2

5 Stack pointer (SP)

Current stack pointer.

Unsigned short 2

The non-zero error code indicates that an error has occurred.

Advertising