Live machine state prompt

The current state of the machines can be queried with the UDF skrpps_02.skr_get_mc_states(…). The data returned by this UDF is not available as DB table put will be made available directly by the PollClient.

Call-up parameters

Parameter

Type

Description

_aMcIds

integer []

SKR machine IDs of the machines whose state is to be queried.
If NULL is transferred, the state of all machines are returned.

Note:
If the data of only some machines are needed, the function must always be called up with _aMcIds NULL for performance reasons.

Wrong:
SELECT * from skrpps_02.skr_get_mc_states( NULL ) where "MC_KEY"=1404903009;

First of all a table with the status information of all machines is generated, then all entries but one are rejected.

Correct:
SELECT * from skrpps_02.skr_get_mc_states( Array[1404903009] );

Only the entry of the machine with the MC_Key = 1404903009 is generated.

Return Table

Column

Type

Contents

MC_KEY

integer

SKR machine ID

ACTIVATED

boolean

True if the machine is active (not inoperative) in the SKR

CONNECTED

boolean

True if the PollClient has established a TCP/IP connection to the machine

DATA_UP_TO_DATE

boolean

True if it is highly probable that the content of the data for this machine is the current one.

Uncertainty due to:
If a TCP/IP is interrupted for example due to a network error, this is often or sometimes not detected by the communication partner until the next time data is sent because of the missing receipt notification.

LAST_EVENT_TIMESTAMP

timestamp

without time zone

Timestamp of the most recent event transferred to the SKR

USER_STATE

smallint

Current state of User State Event

SINTRAL_STATE

smallint

Current state of Sintral State Event

SHIFT_STATE

smallint

Current shift

MC_STATE

smallint

Current Machine State

MC_STATE_PARAM

text

Parameter of the last machine status change events
In case of an error it contains a list of the errors existing at the machine

PATTERN_NAME

text

Currently loaded pattern

SEQ_NAME

text

Currently loaded sequence

TICKET_UID

bigint

PPS UID of the currently loaded ticket
(0 if no ticket is loaded)

TICKET_TYPE

smallint

Ticket type

TICKET_CUSTOMER_ID

text

Ticket customer ID

TICKET_ARTICLE_ID

text

Ticket Article ID

TICKET_PRODUCTION_ID

text

Ticket production ID

TICKET_PRODUCTION_SUB1_ID

text

Ticket production sub ID 1

TICKET_PRODUCTION_SUB2_ID

text

Ticket production sub ID 2

PRODUCTIVITY_FLAGS

smallint

Productivity flags

  • Bit 0
    Enabled (true) is obsolete
  • Bit_1
    Productive (true) / Unproductive (false)
    (Productive time (true) = Pattern \ sequence started or piece counter > 0)
  • Bit_2
    Reduced speed \ snail button
    ON (true) / OFF (false)
    Reduced Speed
  • Bit_3
    Manually switched extended stroke
    ON (true) / OFF (false)
    Extended Stroke
  • Bit_4
    With tandem machines carriage 1
    ON (true) / OFF (false)
  • Bit_5
    With tandem machines carriage 2
    ON (true) / OFF (false)
    see also Skr2def.h
  • Bit 6
    Setup mode
    ON (true) / OFF (false)
  • Bit 7
    Maintenance mode
    ON (true) / OFF (false)

PRODUCTIVITY_SPEED

smallint

Machine speed with active snail key in %
(only with newer machines)

USER

text

Last user signed in to the machine

[SKR_ERR_ID]

smallint

Debug info: Internal SKR error state

[CONNECT_STATE]

smallint

Debug info: Internal SKR net state

[ROW_UPDATES]

smallint

Debug info: Internal SKR update counter for this line

Code example skr_get_mc_states