日本語 English

KV-X Series System Variable List (Global Variables)

A list of the global variables (variable name, member name, description, data type, read/write, assignment) given in "Appendix 2 System Variable List" of the KEYENCE KV-X500/X300 Series User's Manual.

Date/time and day of week

Variables related to the CPU unit's clock information (calendar timer).

Variable nameMember nameDescriptionData typeR/WAssignment
_CurrentDateTimeARRAY[0..5] OF UINT
_CurrentDateTime[0]YearUINTRCM700
_CurrentDateTime[1]MonthUINTRCM701
_CurrentDateTime[2]DayUINTRCM702
_CurrentDateTime[3]HourUINTRCM703
_CurrentDateTime[4]MinuteUINTRCM704
_CurrentDateTime[5]SecondUINTRCM705
_DayOfWeekDay of week (0: Sunday to 6: Saturday)UINTRCM706

Always ON, always OFF, clock pulses

Variable nameDescriptionData typeR/WAssignment
_AlwaysOnAlways ONBOOLRCR2002
_AlwaysOffAlways OFFBOOLRCR2003
_Clock10ms10 ms clock pulseBOOLRCR2004
_Clock100ms100 ms clock pulseBOOLRCR2005
_Clock1s1 s clock pulseBOOLRCR2006
_FirstScanOffOFF for 1 scan only at start of operationBOOLRCR2007
_FirstScanOnON for 1 scan only at start of operationBOOLRCR2008

Program execution information

System variables related to program execution information.

Variable nameMember nameDescriptionData typeR/WAssignment
_ProgramInfo_PROGRAM_INFO
ScanTimeMeasured scan timeUDINTRCM1000
EndProcTimeMeasured END processing timeUDINTRCM1002
MinScanTimeMinimum scan timeUDINTRCM1004
MaxScanTimeMaximum scan timeUDINTRCM1006
FixScanTimeSetConstant scan time operation settingUDINTWCM1008
EndProcTimeSetEND processing time settingUDINTWCM1010
ExcessConstantScanTimeScan time when setting exceededUDINTRCM1012
ExecssEndProcTimeEND processing time when setting exceededUDINTRCM1014
ProgramErrorDetailOperation error detailsUINTRCM1023
FixScanTimeEnableConstant scan time operation (ON: enabled / OFF: disabled)BOOLRCM1024.3
FixTimeExcessSet time exceeded (ON for 1 scan when the constant scan time or constant END processing time setting is exceeded)BOOLRCM1024.4
OCPDisabledOvercurrent protection disabledBOOLRCM1024.5
BackupBattErrorBackup battery errorBOOLRCM1024.6
ScanTimeMaxMinClearClear minimum/maximum scan timeBOOLCM1024.7
FixEndProcTimeEnableEND processing time setting (ON: enabled / OFF: disabled)BOOLCM1024.8
TimeErrorClock errorBOOLRCM1024.11
ProjectPasswordAuthDisabledProject password authentication prohibited (ON: prohibited / OFF: allowed)BOOLRCM1024.14

Free-running counters

Counters that count up from 0 when the CPU unit switches to RUN mode.

Variable nameDescriptionData typeR/WAssignment
_FreeRunCounter1ms32-bit 1 ms free-running counterUDINTRCM1030
_FreeRunCounter10us32-bit 10 μs free-running counterUDINTRCM1032
_FreeRunCounter1us32-bit 1 μs free-running counterUDINTRCM1034
_FreeRunCounter100ns32-bit 100 ns free-running counterUDINTRCM1036

Errors

System variables related to CPU unit errors.

Variable nameMember nameDescriptionData typeR/WAssignment
_ErrorCtrl_ERROR_CTRL
ErrorMajor error occurringBOOLRCM1050.5
WarningMinor error occurringBOOLRCM1050.6
ClearCurrentErrorClear current errorBOOLWCM1050.9
ClearHistoryClear historyBOOLWCM1050.10

Logging/trace

System variables related to the logging/trace function.

Variable nameMember nameDescriptionData typeR/WAssignment
_LoggingTraceARRAY[0..9] OF _LOGGING_TRACE
ExecEnableEnable operationBOOLWCM1600.0
InOperationBusyBOOLRCM1600.1
FileWriteEndFile write finishedBOOLRCM1600.2
BufferHalfAlmBuffer below 50% warningBOOLRCM1600.3
BufferOverflowBuffer overflowBOOLRCM1600.4
WriteDuringRunWritten during RUN while executingBOOLRCM1600.5
LoggingTraceErrorLogging/trace errorBOOLRCM1600.8
NoMemoryCapacityInsufficient memory errorBOOLRCM1600.9
DeviceTriggerSetErrorDevice/trigger setting errorBOOLRCM1600.10
FileSaveTriggerMonitorFile save trigger monitorBOOLRCM1600.11
DataAcquireCompleteData acquisition completeBOOLRCM1600.12
MinBufferSpaceMinimum free buffer spaceUINTRCM1601
LoopBufferSpaceFree ring buffer spaceUINTRCM1602
FileSavingCounterFile save counterUINTRCM1603

* The assignment for logging/trace (ID1 to 9, N: logging/trace ID) is "CM1600 + 10 × N".

Access Window

System variables related to the Access Window of the CPU unit.

Variable nameMember nameDescriptionData typeR/WAssignment
_AccessWindowAccess Window_ACCESS_WINDOW
UpKeyPressedUp key pressedBOOLRCM1720.0
DownKeyPressedDown key pressedBOOLRCM1720.1
LeftKeyPressedLeft key pressedBOOLRCM1720.2
RightKeyPressedRight key pressedBOOLRCM1720.3
MenuKeyPressedMENU key pressedBOOLRCM1720.4
EnterKeyPressedENTER key pressedBOOLRCM1720.5
UserMessageDisplayedUser message displayedBOOLRCM1720.15
BlinkLineBlinkARRAY[1..4] OF BOOLWCM1721.0~CM1721.3
DisplayUserMessageDisplay user messageARRAY[1..63] OF BOOLWCM1722.1~CM1725.15
UserMessageDisplayIDUser message display numberUINTWCM1730
InitialDispLangSettingInitial display language settingUINTWCM1731
InitialCommentNumberSettingInitial comment number settingUINTWCM1732
WindowOperationDisableOperation prohibit settingUINTWCM1733
InitScreenSetValidInitial screen setting enabledUINTWCM1734
InitScreenSetDeviceTypeInitial screen setting: device typeUINTWCM1735
InitScreenSetScreenIDInitial screen setting: screen IDUDINTWCM1736
InitScreenSetDeviceNumberInitial screen setting: screen device numberUDINTWCM1738
InitScreenSetDisplayFormatInitial screen setting: display formatUINTWCM1740
InitScreenSetDeviceDisplayInitial screen setting: device notationUINTWCM1741
InitScreenSetKeyLockStatusInitial screen setting: key lock statusUINTWCM1742

Project information

System variables related to the project information of the CPU unit.

Variable nameMember nameDescriptionData typeR/WAssignment
_ProjectInfoPROJECT_INFO
ProjectNameProject nameSTRING[64]RCM1750
SensorInstExecCountNumber of sensor setting instructions executedUINTRCM1784
PrjPasswordCertFailCountConsecutive project password authentication failuresUINTRCM1785
PrjPasswordCertFailTotalCumulative project password authentication failuresUINTRCM1786
CpuFuncVersionCPU function versionUINTRCM1788
ProjectVersionProject function versionUINTRCM1795

Storage

System variables related to the storage (memory card / CPU memory) of the CPU unit.

Variable nameMember nameDescriptionData typeR/WAssignment
_Storage_STORAGE
MemCardMountReqMemory card mount requestBOOLWCM1800.0
MemCardUnmountReqMemory card unmount requestBOOLWCM1800.1
MemCardInUseMemory card in useBOOLRCM1800.2
MemCardRecognizedMemory card recognition completeBOOLRCM1800.3
MemCardExistMemory card presentBOOLRCM1800.4
CpuMemoryMountReqCPU memory mount requestBOOLWCM1800.8
CpuMemoryUnmountReqCPU memory unmount requestBOOLWCM1800.9
CpuMemoryInUseCPU memory in useBOOLRCM1800.10
CpuMemoryRecognizedCPU memory recognition completeBOOLRCM1800.11
AutoLoadAuto load_AUTOLOAD_CTRL
AutoLoad.FolderNumberFolder numberUINTWCM1804
AutoLoad.CompleteFolderNumberCompleted folder numberUINTRCM1806
AutoLoad.FinCodeCompletion codeUINTRCM1807
RunLoadRun load_AUTOLOAD_CTRLCM1810
RunLoad.FolderNumberFolder numberUINTWCM1811
RunLoad.CompleteFolderNumberCompleted folder numberUINTRCM1813
RunLoad.FinCodeCompletion codeUINTRCM1814
ProjectSaveProject save_PROJECT_RECIPE_SAVE_LOAD
ProjectSave.RequestExecute requestBOOLWCM1820.0
ProjectSave.BusyExecutingBOOLRCM1820.1
ProjectSave.CompleteExecution completeBOOLRCM1820.2
ProjectSave.ErrorExecution failedBOOLRCM1820.3
ProjectSave.DriveNumberDrive numberUINTWCM1821
ProjectSave.FolderNumberFolder numberUINTWCM1822
ProjectSave.CompleteDriveNumberCompleted drive numberUINTRCM1823
ProjectSave.CompleteFolderNumberCompleted folder numberUINTRCM1824
ProjectSave.FinCodeCompletion codeUINTRCM1825
ProjectLoadProject load_PROJECT_RECIPE_SAVE_LOAD
ProjectLoad.RequestExecute requestBOOLWCM1830.0
ProjectLoad.BusyExecutingBOOLRCM1830.1
ProjectLoad.CompleteExecution completeBOOLRCM1830.2
ProjectLoad.ErrorExecution failedBOOLRCM1830.3
ProjectLoad.DriveNumberDrive numberUINTWCM1831
ProjectLoad.FolderNumberFolder numberUINTWCM1832
ProjectLoad.CompleteDriveNumberCompleted drive numberUINTRCM1833
ProjectLoad.CompleteFolderNumberCompleted folder numberUINTRCM1834
ProjectLoad.FinCodeCompletion codeUINTRCM1835
RecipeSaveRecipe save_RECIPE_SAVECM1840
RecipeSave.RequestExecute requestBOOLWCM1840.0
RecipeSave.BusyExecutingBOOLRCM1840.1
RecipeSave.CompleteExecution completeBOOLRCM1840.2
RecipeSave.ErrorExecution failedBOOLRCM1840.3
RecipeSave.DriveNumberDrive numberUINTWCM1841
RecipeSave.InputFolderNumberReference folder numberUINTWCM1842
RecipeSave.OutputFolderNumberOutput folder numberUINTWCM1844
RecipeSave.FinCodeCompletion codeUINTRCM1845
RecipeLoadRecipe load_PROJECT_RECIPE_SAVE_LOAD
RecipeLoad.RequestExecute requestBOOLWCM1850.0
RecipeLoad.BusyExecutingBOOLRCM1850.1
RecipeLoad.CompleteExecution completeBOOLRCM1850.2
RecipeLoad.ErrorExecution failedBOOLRCM1850.3
RecipeLoad.DriveNumberDrive numberUINTWCM1851
RecipeLoad.FolderNumberFolder numberUINTWCM1852
RecipeLoad.CompleteDriveNumberCompleted drive numberUINTRCM1853
RecipeLoad.CompleteFolderNumberCompleted folder numberUINTRCM1854
RecipeLoad.FinCodeCompletion codeUINTRCM1855
CpuMemorySaveSave to CPU memory_CPU_MEMORY_SAVE
CpuMemorySave.RequestExecute requestBOOLWCM1860.0
CpuMemorySave.BusyExecutingBOOLRCM1860.1
CpuMemorySave.CompleteExecution completeBOOLWCM1860.2
CpuMemorySave.ErrorExecution failedBOOLRCM1860.3
StorageFBIsRAMModeStorage FB RAM modeBOOLWCM1861.7
ProjectBackupBusyProject backup in progressBOOLRCM1861.8
LoggingTraceBusyLogging/trace in progressBOOLRCM1861.10
LoggingInternalBufferOverflowLogging internal buffer overflowBOOLRCM1861.11
PowerOffDuringStorageAccessPower OFF during storage accessUINTWCM1870
MemoryCardRetryCountMemory card retry countUINTRCM1871
MemoryCardErrorCountMemory card verify error countUINTRCM1872
MemoryCardResetDelayReset delay time on memory card errorUINTWCM1874
UsageCpuMemoryCPU memory usageUDINTRCM1880

Expansion units

System variables related to connected expansion units.

Variable nameMember nameDescriptionData typeR/WAssignment
_ExpansionUnit_EXPANSION_UNIT
ConnectedExpansion unit connected (unit number 0 is fixed OFF)ARRAY[0..48] OF BOOLRCM2000
LoadOptionLoad optionARRAY[0..48] OF BOOLWCM2004
UnitNumberNumber of connected expansion units (the CPU unit is not counted)UINTRCM2075

Inter-unit synchronization

System variables related to inter-unit synchronization.

Variable nameMember nameDescriptionData typeR/WAssignment
_UnitSynchronize_UNIT_SYNCHRONIZE
RefreshStartTimeDelayInter-unit synchronization refresh start timeUDINTRCM2400
RefreshFinishTimeDelayInter-unit synchronization refresh end timeUDINTRCM2402
RefreshStartTimeMaxDelayInter-unit synchronization maximum start timeUDINTRCM2404
RefreshFinishTimeMaxDelayInter-unit synchronization maximum end timeUDINTRCM2406
RefreshExecutionTimeInter-unit synchronization refresh execution timeUDINTRCM2408
RefreshIntervalOverInter-unit synchronization refresh time exceededBOOLRCM2410.0

Latest major error details

System variables that store detailed information when a major error occurs in the CPU unit.

Variable nameMember nameDescriptionData typeR/WAssignment
_NewestError_ERROR_DETAIL
YearMonthYear/month (2402 means February 2024)UINTRCM5100
DayDayUINTRCM5101
HourHourUINTRCM5102
MinuteMinuteUINTRCM5103
SecondSecondUINTRCM5104
ErrorNumberError codeUINTRCM5105
ValidCountNumber of valid dataUINTRCM5106
DetailDetail information 01 to 20ARRAY[0..19] OF UINTRCM5107~CM5126

Latest minor error details

System variables that store detailed information when a minor error occurs in the CPU unit.

Variable nameMember nameDescriptionData typeR/WAssignment
_NewestWarning_ERROR_DETAIL
YearMonthYear/month (2402 means February 2024)UINTRCM5150
DayDayUINTRCM5151
HourHourUINTRCM5152
MinuteMinuteUINTRCM5153
SecondSecondUINTRCM5154
ErrorNumberError codeUINTRCM5155
ValidCountNumber of valid dataUINTRCM5160
DetailDetail information 01 to 20ARRAY[0..19] OF UINTRCM5157~CM5176

Operation recording

System variables related to the operation recording function (drive recorder function).

Variable nameMember nameDescriptionData typeR/WAssignment
_OperationRecorderARRAY[0..3] OF _OPERATION_RECORDER
SaveRequestSave requestBOOLRCM6000.0
InActionBusyBOOLRCM6000.1
SaveTriggerMonitorFile save trigger occurredBOOLRCM6000.2
SaveBusySaving fileBOOLRCM6000.3
CollectingCollecting dataBOOLRCM6000.4
SettingErrorSetting errorBOOLRCM6000.5
SaveCompleteFile save completeBOOLRCM6000.7
SaveErrorFile save errorBOOLRCM6000.8
BufferShortageInsufficient recording bufferBOOLRCM6000.9
BufferAllSaveModeSave entire buffer modeBOOLRCM6000.14
AverageSamplingPeriodAverage sampling periodDINTRCM6002
AverageChangedDeviceNumAverage number of changed devicesDINTRCM6004
MaxCollectingPeriodCollectable periodDINTRCM6006
SaveFinCodeFile save completion codeUINTRCM6020
SaveCounterFile save counterUINTRCM6022
SaveProgressInfo1Save progress detail 1UINTRCM6024
SaveProgressInfo2Save progress detail 2UINTRCM6025
SaveProgressSave progressUINTRCM6026
SavePathSave file pathSTRING[320]RCM6030~CM6191

* The assignment for operation recording (ID1 to ID3, N: operation recording ID) is "CM1600 + 200 × N".

Module executing

System variables that store the execution state of modules.

Variable nameDescriptionData typeR/W
_MD_(ModuleName)Turns ON while the module specified by ModuleName is executing.
e.g. while the "Auto" module is executing, _MD_Auto is ON
Used, for example, to control the execution of standby modules.
BOOLR

Expansion unit device addresses

System variables that store the device addresses of the first R and first DM of the specified expansion unit.

Variable nameMember nameDescriptionData typeR/W
_UnitIdAdr[0..48]ARRAY[0..48] OF _UNIT_ID_ADR
UnitNoUnit number of the target unitUINTR
RelayAdrFirst relay address of the target unit
*Specifying _UnitIdAdr[#1].RelayAdr designates the relays assigned to the unit.
UDINTR
DmAdrFirst DM address of the target unit
*Specifying _UnitIdAdr[#1].DmAdr designates the DM assigned to the unit.
UDINTR

The values stored in _UnitAdr are shown using the following unit configuration as an example.

Unit numberModelFirst RFirst DM
0KV-X550R30000DM10000
1KV-SSC02R33000DM10300
2KV-SAD04R34000DM10400

*Writing _UnitAdr[#1].RelayAdr handles the first relay R33000 of the KV-SSC02 (unit number #1).
*Writing _UnitAdr[#2].DmAdr handles the first DM10400 of the KV-SAD04 (unit number #2).
To handle devices other than the first one, use instructions that add/subtract addresses (DevAddressAdd etc.) (e.g. to handle first R + 20 "ch1 current value write request" of the KV-SSC02, see the ladder example on page A-16 of the manual).

Arithmetic flags

System variables that store the execution results of some instructions.

Variable nameDescriptionData typeR/W
_CalcResultNegTurns ON when the comparison result is less.BOOLR
_CalcResultEqualTurns ON when the comparison result is equal.BOOLR
_CalcResultPosTurns ON when the comparison result is greater.BOOLR

Source

Created from "Appendix 2 System Variable List" (pages A-9 to A-17) of the KEYENCE KV-X500/X300 Series User's Manual.

Comments