Side-connect api plc status and control functions – ProSoft Technology MVI69-ADM User Manual
Page 320

Side-Connect API Library Functions
MVI-ADM ♦ 'C' Programmable
Developer's Guide
'C' Programmable Application Development Module
Page 320 of 342
ProSoft Technology, Inc.
February 20, 2013
11.8 Side-connect API PLC Status and Control Functions
MVIsc_GetPLCStatus
Syntax
int MVIsc_GetPLCStatus(HANDLE handle, WORD *status, WORD *majfault);
Parameters
handle
Handle returned by previous call to MVIsc_Open
status
Pointer to variable to receive PLC-5 status word
majfault
Pointer to variable to receive PLC-5 major fault word
Description
This function is used by an application to retrieve the PLC-5 status and major
fault words.
handle must be a valid handle returned from MVIsc_Open. Table 3 and Table 4
below define the bits of the status and major fault words, respectively. For
programming convenience and clarity, a definition is provided for each bit in the
API include file MVISCAPI.H.
PLC-5 Status Word
Bit
Definition
Description
0
MVISC_PLCSTS_RAM_BAD
RAM bad
1
MVISC_PLCSTS_RUN_MODE
Run mode
2
MVISC_PLCSTS_TEST_MODE
Test mode
3
MVISC_PLCSTS_PROG_MODE
Program mode
4
MVISC_PLCSTS_BURN_EEPROM
Burning EEPROM
5
MVISC_PLCSTS_DWNLD_MODE
Download mode
6
MVISC_PLCSTS_EDITS_ENAB
Edits enabled
7
MVISC_PLCSTS_REM_MODE
Remote modes
8
MVISC_PLCSTS_FRC_ENAB
Forces enabled
9
MVISC_PLCSTS_FRC_PRES
Forces present
10
MVISC_PLCSTS_EEPROM_SUCC
Successful EEPROM burn
11
MVISC_PLCSTS_ONLINE_EDIT
Online editing
12
MVISC_PLCSTS_DEBUG_MODE
Debug mode
13
MVISC_PLCSTS_PROG_CKSM
User program checksum done
14
MVISC_PLCSTS_LAST_SCAN
Last scan of ladder/SFC step
15
MVISC_PLCSTS_FIRST_SCAN
First scan of ladder/SFC step
PLC-5 Major Fault Word
Bit
Definition
Description
0
MVISC_PLCFLT_PROG_MEM_BAD
Bad user program memory
1
MVISC_PLCFLT_BAD_OPRN_ADDR
Illegal operand address