V9 MacroReference E
V9 MacroReference E
Macro Reference
Record of Revisions
Reference numbers are shown at the bottom left corner on the back cover of each manual.
Notes:
About Trademarks:
• Windows, Word and Excel are registered trademarks of Microsoft Corporation in the United States
and other countries.
• All other company names or product names are trademarks or registered trademarks of their
respective holders.
• The names of the products contained herein are trademarks or registered trademarks of their
respective manufacturers.
About Manuals
The following manuals are available for the MONITOUCH V series.
Refer to them as necessary.
Please note that the V series model names are used as listed above in the manuals.
Notes on Safe Usage of MONITOUCH
In this manual, you will find various notes categorized under the following levels with the signal words “DANGER”
and “CAUTION”.
Indicates an imminently hazardous situation which, if not avoided, will result in death or
DANGER serious injury.
Indicates a potentially hazardous situation which, if not avoided, may result in minor or
CAUTION moderate injury and could cause property damage.
Note that there is a possibility that items listed with CAUTION may have serious ramifications.
DANGER
Never use the output signal of the V9 series for operations that may threaten human life or damage the
system, such as signals used in case of emergency. Please design the system so that it can cope with a
touch switch malfunction. A touch switch malfunction may result in machine accidents or damage.
Turn off the power supply when you set up the unit, connect new cables, or perform maintenance or
inspections. Otherwise, electrical shock or damage may occur.
Never touch any terminals while the power is on. Otherwise, electrical shock may occur.
You must cover the terminals on the unit before turning the power on and operating the unit. Otherwise,
electrical shock may occur.
The liquid crystal in the LCD panel is a hazardous substance. If the LCD panel is damaged, do not ingest the
leaked liquid crystal. If leaked liquid crystal makes contact with skin or clothing, wash it away with soap and
water.
Never disassemble, recharge, deform by pressure, short-circuit, reverse the polarity of the lithium battery,
nor dispose of the lithium battery in fire. Failure to follow these conditions will lead to explosion or ignition.
Never use a lithium battery that is deformed, leaking, or shows any other signs of abnormality. Failure to
follow these conditions will lead to explosion or ignition.
The power lamp flashes when the backlight has reached the end of its service life or when the backlight is
faulty. Note that the switches on the screen remain operable when this occurs. Do not touch the screen
when the screen becomes dark and the power lamp is flashing. Otherwise, a malfunction may occur and
result in machine accidents or damage.
CAUTION
Check the appearance of the unit when it is unpacked. Do not use the unit if any damage or deformation is
found. Failure to do so may lead to fire, damage, or malfunction.
For use in a facility or as part of a system related to nuclear energy, aerospace, medical, traffic equipment, or
mobile installations, please consult your local distributor.
Operate (or store) the V9 series under the conditions indicated in this manual and related manuals. Failure
to do so could cause fire, malfunction, physical damage, or deterioration.
Observe the following environmental restrictions on use and storage of the unit. Otherwise, fire or damage to
the unit may result.
- Avoid locations where there is a possibility that water, corrosive gas, flammable gas, solvents, grinding
fluids, or cutting oil can come into contact with the unit.
- Avoid high temperatures, high humidity, and outside weather conditions, such as wind, rain, or direct
sunlight.
- Avoid locations where excessive dust, salt, and metallic particles are present.
- Avoid installing the unit in a location where vibrations or physical shocks may be transmitted.
CAUTION
Equipment must be correctly mounted so that the main terminal of the V9 series will not be touched
inadvertently. Otherwise, an accident or electric shock may occur.
Tighten the mounting screw on the fixtures of the V9 series to an equal torque of 0.6 N·m.
Excessive tightening may distort the panel surface. Loose mounting screws may cause the unit to fall down,
malfunction, or short-circuit.
Check periodically that terminal screws on the power supply terminal block and fixtures are firmly tightened.
Loosened screws or nuts may result in fire or malfunction.
Tighten the terminal screws on the power supply terminal block of the V9 series to an equal torque of 7.1 to
8.8 inch-lbf (0.8 to 1.0 N·m). Improper tightening of screws may result in fire, malfunction, or other serious
trouble.
The V9 series has a glass screen. Do not drop the unit or impart physical shocks to the unit. Otherwise, the
screen may be damaged.
Correctly connect cables to the terminals of the V9 series in accordance with the specified voltage and
wattage. Overvoltage, overwattage, or incorrect cable connection could cause fire, malfunction, or damage
to the unit.
Always ground the V9 series. The FG terminal must be used exclusively for the V9 series with the level of
grounding resistance less than 100 . Otherwise, electric shock or a fire may occur.
Prevent any conductive particles from entering the V9 series. Failure to do so may lead to fire, damage, or
malfunction.
After wiring is finished, remove the paper used as a dust cover before starting operation of the V9 series.
Operation with the dust cover attached may result in accidents, fire, malfunction, or other trouble.
Do not attempt to repair the V9 series yourself. Contact Hakko Electronics or the designated contractor for
repairs.
Do not repair, disassemble, or modify the V9 series. Hakko Electronics Co., Ltd. is not responsible for any
damages resulting from repair, disassembly, or modification of the unit that was performed by an
unauthorized person.
Do not use sharp-pointed tools to press touch switches. Doing so may damage the display unit.
Only experts are authorized to set up the unit, connect cables, and perform maintenance and inspection.
Lithium batteries contain combustible material such as lithium and organic solvents. Mishandling may cause
heat, explosion, or ignition resulting in fire or injury. Read the related manuals carefully and correctly handle
the lithium battery as instructed.
Do not press two or more positions on the screen at the same time. If two or more positions are pressed at
the same time, the switch located between the pressed positions may be activated.
Take safety precautions during operations such as changing settings when the unit is running, forced output,
and starting and stopping the unit. Any misoperations may cause unexpected machine movement, resulting
in machine accidents or damage.
In facilities where the failure of the V9 series could lead to accidents that threaten human life or other serious
damage, be sure that such facilities are equipped with adequate safeguards.
When disposing of the V9 series, it must be treated as industrial waste.
Before touching the V9 series, discharge static electricity from your body by touching grounded metal.
Excessive static electricity may cause malfunction or trouble.
Insert an SD card into the unit in the same orientation as pictured on the unit. Failure to do so may damage
the SD card or the slot on the unit.
The SD card access LED flashes red when the SD card is being accessed. Never remove the SD card or
turn off power to the unit while the LED is flashing. Doing so may destroy the data on the SD card. Check
that the LED has turned off before removing the SD card or turning off the power to the unit.
[General Notes]
Never bundle control cables or input/output cables with high-voltage and large-current carrying cables such as
power supply cables. Keep control cables and input/output cables at least 200 mm away from high-voltage and
large-current carrying cables. Otherwise, malfunction may occur due to noise.
When using the V9 series in an environment where a source of high-frequency noise is present, it is
recommended that the FG shielded cable (communication cable) be grounded at each end. However, when
communication is unstable, select between grounding one or both ends, as permitted by the usage
environment.
Be sure to plug connectors and sockets of the V9 series in the correct orientation. Failure to do so may lead to
damage or malfunction.
If a LAN cable is inserted into the MJ1 or MJ2 connector, the device on the other end may be damaged. Check
the connector names on the unit and insert cables into the correct connectors.
Do not use thinners for cleaning because it may discolor the V9 series surface. Use commercially available
alcohol.
If a data receive error occurs when the V9 series unit and a counterpart unit (PLC, temperature controller, etc.)
are started at the same time, read the manual of the counterpart unit to correctly resolve the error.
Avoid discharging static electricity on the mounting panel of the V9 series. Static charge can damage the unit
and cause malfunctions. Discharging static electricity on the mounting panel may cause malfunction to occur
due to noise.
Avoid prolonged display of any fixed pattern. Due to the characteristic of liquid crystal displays, an afterimage
may occur. If prolonged display of a fixed pattern is expected, use the backlight’s auto OFF function.
The V9 series is identified as a class-A product in industrial environments. In the case of use in a domestic
environment, the unit is likely to cause electromagnetic interference. Preventive measures should thereby be
taken appropriately.
Chapter 1 Outline
1.1 Type of V Series Macros. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
1.2 Screen Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
1.3 Multi-overlap Macro. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
1.4 Switch Macro. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
1.5 Function Switch Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5
1.6 Initial Macro. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
Macro Setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
[General] tab window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
Chapter 3 Command
3.1 Macro Command List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
• Screen
- OPEN macro: Executes once when the screen is opened.
- CLOSE macro: Executes once when the screen is switched.
- CYCLE macro: Executes repeatedly while the screen is open.
• Multi-overlap
- OPEN macro: Executes once when the multi-overlap is opened.
- CLOSE macro: Executes once when the multi-overlap is closed.
* OPEN and CLOSE macros cannot be used for call-overlaps.
• Switch
- ON macro: Executes once when the switch is pressed.
- OFF macro: Executes once when the switch is released.
• Function switch
- ON macro: Executes once when the function switch is pressed.
- OFF macro: Executes once when the function switch is released.
• Initial macro
The specified macro block executes once before the V series starts communicating with
the PLC. (Refer to page 1-6.)
• Global macro
The specified macro block is executed once when the control device memory is changed
from 0 to 1 (leading edge). (Refer to page 1-7.)
• Interval timer
While a screen equipped with the interval timer is displayed, the timer starts as preset.
Each time the preset time has elapsed, the specified macro block is executed. (Refer to
page 1-9.)
• Macro mode
While a screen equipped with macro mode is displayed, macros are executed according to
the status at the specified device memory addresses. (Refer to page 1-15.)
- ON macro: Executes when the bit at the specified device memory address
changes from 0 1 (leading edge).
- OFF macro: Executes when the bit at the specified device memory address
changes from 1 0 (falling edge).
• Alarm macro
When a macro is set in the [Alarm Server] window, it is executed according to a change in
the status of the device memory for errors. (Refer to page 1-17.)
- Occurrence macro: To be executed at the time of alarm occurrence
- Resetting macro: To be executed at the time of alarm reset
• Scheduler macro
When a macro is set in the [Scheduler] window, it is executed at the timing specified for
[Trigger]. (Refer to page 1-18.)
1-1
Screen Macro
• OPEN macro
This macro is executed once when a screen is opened.
Select [Screen Setting] [Open Macro] and register the command to be executed.
• CLOSE macro
This macro is executed once when a screen is closed.
Select [Screen Setting] [Close Macro] and register the command to be executed.
• CYCLE macro
This macro is executed repeatedly while the screen is open.
Select [Screen Setting] [Close Macro] and register the command to be executed.
1-2
Multi-overlap Macro
• OPEN macro
This macro is executed once when a multi-overlap display is opened.
Select [Screen Setting] [Open Macro] in the overlap library window and register the
command to be executed.
• CLOSE macro
This macro is executed once when a multi-overlap display is closed.
Select [Screen Setting] [Close Macro] in the overlap library window and register the
command to be executed.
1-3
Switch Macro
• ON macro
This macro is executed once when a switch is pressed.
Set the command in the [Macro] window of the switch.
- Editing with [Setting Method: Specify the macro block number] selected
Register macro commands in a macro block, and select a number of the macro block to
execute.
• OFF macro
This macro is executed once when a switch is released.
Set the command in the [Macro] window of the switch.
- Editing with [Setting Method: Specify the macro block number] selected
Register macro commands in a macro block, and select a number of the macro block to
execute.
1-4
Function Switch Macro
• ON macro
This macro is executed once when a switch is pressed.
Set the command in the [Local Function Switch Setting] window.
• OFF macro
This macro is executed once when a switch is released.
Set the command in the [Local Function Switch Setting] window.
1-5
Initial Macro
Macro Setting
1-6
Global Macro
Macro Setting
1. Specify the number of the macro block for which commands to be executed are
registered.
2. The control device memory is set ([0 1] leading edge).
Macro execution
The information output device memory is automatically set ([0 1]).
Supplemental Remarks
• By using the information output device memory, you can check the timing to reset (OFF)
the control device memory.
1-7
Event Timer Macro
Macro Setting
Supplemental Remarks
1. When the timers for multiple event timer macros are up at the same time:
Event timer macro blocks are executed in ascending numeric order of [Event Timer]. After
a macro block has been processed, execution proceeds to the next macro block.
CYCLE macro
2. When accessing the same external device memory address in some event timer macros:
The processing ability will be improved if you set the event timer macro No. 0 that reads
the external device memory into the internal device memory and make other event timer
macros refer to this internal device memory.
In order to improve the overall processing ability, reduce the number of times that the
external device memory is accessed.
1-8
Interval Timer
• The specified macro is executed at intervals specified for [Repeat Interval] from when the
screen is opened.
The screen is
opened. Repetition interval
Time
Macro
Macro execution
• The specified macro is executed at intervals specified for [Repeat Interval] from when an
arbitrary bit is set (ON). (This function is valid only while the bit is ON.)
Device
memory Repetition interval
Time
Macro
Macro execution
• The specified macro is executed once after the time specified for [Repeat Interval] has
elapsed since the screen was opened or an arbitrary bit was set (ON).
The screen is
opened. Repetition interval
Time
Macro
Macro execution
Macro
Macro execution
1-9
Interval Timer
Setting Dialog
Time
Macro
Macro block execution
• Checked
While the bit is “1” (ON): The macro is executed at intervals specified
for [Repeat Interval].
While the bit is “0” (OFF): The macro is not executed.
Timer start
Start device memory
OFF ON
Repetition
interval
Time
Macro
Macro block execution
Execution Macro Specify the macro block number to be executed at intervals specified for
[Repeat Interval].
1-10
Interval Timer
ON Macro Specify the macro block number to be executed once when the timer starts.
• [Use the start device] unchecked:
1
When the screen is opened, the timer starts and the ON macro is
executed once.
The timer starts when
the screen is opened. Repetition interval
Time
Macro
Macro block execution
Timer start
Start device memory
OFF ON
Repetition interval
Time
Macro
Macro block execution
Different macro block
Execution of ON macro block
OFF Macro This option is enabled, provided that [Use the start device] is checked.
Specify the macro block number to be executed once when the start device
memory bit is reset (1 0).
Timer start
Start device memory
OFF ON
Repetition interval
Time
Macro
Macro block execution
This option is useful for clearing the internal device memory that is used for a
macro.
Edit This button is used to open a macro block.
Preview This area displays the contents of macros registered in the selected macro
block number.
*1 The actual repetition interval may fluctuate according to the contents of the screen.
1-11
Interval Timer
[Detail] window
Process Cycle Specify the cycle for the V series to read the PLC when they are
communicating.
For more information, refer to the V9 Series Reference Manual.
ID Specify an ID.
1-12
Interval Timer
Setting Example 1
Graphic movement on the screen
When the switch is pressed, a graphic from the graphic library is displayed. At the same
time, the graphic placed on the left of the screen starts to move to the right.
Pressing the switch next clears the graphic. Pressing the switch again displays the graphic
in the same position where it was displayed last. The graphic starts to move to the right.
(1) Graphic
(4) Graphic library
(3) Switch
$u100-00 = ON
Graphic relay
Macro
(5) Macro block No. 1 = Executed in every cycle
Change the X parameter of the graphic.
Screen Edit
(3) Switch
Device to Output: $u100-00
Output Action: Alternate
Lamp Device: $u100-00
1-13
Interval Timer
<Parameter setting>
[Action: Animation]
[Start X: Increment +1]
(Incremental coordinate +1)
1-14
Macro Mode
Setting
Device Designation Specify the device memory address that triggers the macro.
Number of Relays 1 - 32
Specify the number of bits for triggering macros.
The number specified here is common to both the ON macro
and OFF macro.
1-15
Macro Mode
[Detail] window
Process Cycle Specify the cycle for the V series to read data in the PLC when they
are communicating.
For more information, refer to the V9 Series Reference Manual.
ID Specify an ID.
1-16
Alarm Macro
1-17
Scheduler Macro
1-18
Notes on Macros
In the above example, the V series goes and writes data to D200 as commanded in
line No. 0, then goes and writes data to D201 as commanded in line No. 1, and so on.
Communications that frequently occur will result in a prolonged processing time.
To shorten the communications time, give a BMOV command as shown below. The
contents of the macro using BMOV are the same as the above macro consisting of five
lines, but the data writing takes place only once.
The processing speed is increased and the number of macro commands is reduced.
As described above, macros can be simplified when you plan to make their commands
more efficient to use.
1-19
Notes on Macros
1-20
2
2.1
Edit
Macro Editor
2.1.1 Start and Quit
2.1.2 Screen Composition
2.1.3 Edit
2.1.4 Error
2.2 Available Device Memory
2.2.1 Device Memory Types
2.2.2 Indirect Device Memory Designation
2.3 CSV Format Setting (with Recipe or Sampling Macro
Used)
2.3.1 Applicable Macros
2.3.2 Recipe
2.3.3 Sampling
Macro Editor
How to start the macro editor varies depending on the location where a macro command is
registered.
Screen
• OPEN macro
[Screen Setting] [Open Macro]
• CLOSE macro
[Screen Setting] [Close Macro]
• CYCLE macro
[Screen Setting] [Cycle Macro]
Overlap library
Select [Home] [Registration Item] [Overlap Library] to show the overlap display where a
macro is to be registered.
• OPEN macro
[Screen Setting] [Open Macro]
• CLOSE macro
[Screen Setting] [Close Macro]
2-1
Macro Editor
Switch
• ON macro
[Macro] [Macro to Edit: ON Macro] [Edit]
• OFF macro
[Macro] [Macro to Edit: OFF Macro] [Edit]
Function switch
• ON macro
[Function Switch Setting] [ON Macro] [Edit]
• OFF macro
[Function Switch Setting] [OFF Macro] [Edit]
2-2
Macro Editor
Macro block
[Home] [Registration Item] [Macro Block]
Specify the number of the macro block where macro commands are to be registered, and click
[OK].
Macro mode
[Screen Setting] [Macro]
• ON macro
[Macro Edit] [ON Macro] [Edit]
• OFF macro
[Macro Edit] [OFF Macro] [Edit]
2-3
Macro Editor
Alarm macro
[Alarm Server] [Alarm Device] [Operation Setting] [Macro]
• Occurrence macro
[Macro to Edit: Occurrence operation] [Setting: Use Alarm macros] [Edit]
• Resetting macro:
[Macro to Edit: Cancellation operation] [Setting: Specify the macro block number]
[Edit]
Scheduler macro
[Scheduler] [Action] [Macro]
2-4
Macro Editor
Quit
1. Select [File] [Close], or click the close button in the upper right corner of the window.
2. When no error is detected, the macro editor ends normally. If detected, the following
message appears.
Select a countermeasure for the error, and quit the macro editor.
2-5
Macro Editor
Menu bar
Refer to page 2-6.
Toolbar
Refer to page 2-9.
Line No.
Edit sheet
Refer to page 2-10.
Error display
Refer to page 2-18.
Menus
[File] menu
2-6
Macro Editor
[Edit]/right-click menu
Undo Returns you to the previous state by canceling the effect of the most
recently executed command.
Redo Returns you to the state before [Undo] is executed.
Cut Cuts the selected area and saves it to the clipboard.
Copy Copies the selected area and saves it to the clipboard.
Paste Pastes the data from the clipboard.
Delete Deletes the selected area.
Select All Selects all macros currently being edited.
Delete All Deletes all macros currently being edited.
Find Searches for characters in the macro currently being edited.
Replace Searches for characters in the macro currently being edited and
replaces them.
Jump to Next Line Jumps to the specified line.
Set Comment Converts the line selected in the macro editor window to a comment
(with “;” as the first character).
Reset Comment Resets the comment conversion selected in the macro editor
window (deletes the first character “;” from the comment).
Edit Comment Allows you to edit comments on macro blocks during macro block
editing.
2-7
Macro Editor
[View] menu
2-8
Macro Editor
Toolbar
Edit
Refer to “Menus” (page 2-6).
Comment List
2
Category
Explanation
Command
Setting items
2-9
Macro Editor
2.1.3 Edit
You can utilize the macro editor in several editing manners. Choose a desired one.
1: Command Entry
Editing is performed with the command list. This method is useful when you know the
names of particular commands. (Refer to page 2-10.)
2: Direct Entry
Editing is performed by entering text through the keyboard of your computer. (Refer to
page 2-12.)
3: Macro Editing Support
Editing is performed in the dialog that provides the explanation of individual commands.
This method is best suited to beginners. (Refer to page 2-14.)
4: Text Entry
Editing is performed with a text editor (commercially available). Macro programming is
enabled even in an environment without the editor. (Refer to page 2-16.)
1: Command Entry
New registration
1. Select a line using the [UP] / [DW] button.
2. Enter a command. The command list appears.
Command list
3. Choose the desired command from the list and double-click it.
Alternatively, choose the desired command using the [] / [] key on the keyboard and
press the Enter key.
4. The [Device Setting] dialog appears. Make necessary settings, such as the address and
data length, in the dialog, and click the [Finish] or [] button.
2-10
Macro Editor
5. The line has been registered. To proceed with the next line registration, go back to step 1.
• Select the desired memory address in green with the cursor. The device memory setting
menu is displayed. Change the address as necessary.
• Select the desired device memory address in green with the cursor, and type an address
change through your computer keyboard.
Command change
Choose the line you wish to change. Delete the line and register a new line.
2-11
Macro Editor
2: Direct Entry
New registration
1. Select a line using the [UP] / [DW] button.
2. Enter mnemonic codes through the keyboard.
Example: MOV command
PLC1 [D200] = $u100 (W)
* For designating memory, refer to page 2-19.
3. Press the Enter key to go to the next line. To proceed with the next line registration, go
back to step 1.
2-12
Macro Editor
Memory change
Memory addresses (corresponding to [F0] / [F1] / [F2] / [F3]) are colored green. Follow the
steps below when you wish to change any memory addresses:
• Select the desired memory address in green with the cursor. The memory setting menu is
displayed. Change the address as necessary. 2
• Select the desired memory address in green with the cursor, and type an address change
through the keyboard.
Command change
Choose the line you wish to change. Delete the line and register a new line.
2-13
Macro Editor
New registration
1. Select a line using the [UP] / [DW] button.
2. Select the desired command from the pull-down menu and the macro list.
Select a
command.
3. The setting items required for the selected command are displayed. Specify the address,
data length, etc.
Explanation
Setting items
2-14
Macro Editor
2
The dialog shows
the command and
the values for the
selected line.
2. Change the device memory addresses as desired and click the [Overwrite] button.
Clicking the [Insert] button inserts the changed setting into the position above the selected
line.
2-15
Macro Editor
4: Text Entry
The macro editor is capable of importing and exporting text files. Even if the editor is not
installed on your computer, macros can be created with commercially available software.
Export
1. From the [File] menu, select [Export]. The [Save As] dialog is displayed.
2. Enter a file name and click [Save]. A text file is created under the name.
Text editing
Editing on Notepad
1. Open the text file on Notepad.
2-16
Macro Editor
Import
1. Open the edit sheet, to which a text file will be imported.
2. From the [File] menu, select [Import]. The [Open] dialog is displayed.
3. Select the desired file and click [Open]. The text file is imported.
2-17
Macro Editor
2.1.4 Error
1. If the registered lines of a macro have any errors, error messages are displayed.
Error display
Selected
3. Correct the error as needed in the message. Once finished, the message disappears.
2-18
Available Device Memory
*1 The available range varies depending on the settings set on the [SRAM/Clock Setting]
dialog.
*2 For “n”, set the number of the connected device (1 to 8).
*3 The designation of [xxxx] varies depending on the type of the connected device. For
more information, refer to the available device memory list in the V9 Series Connection
Manual.
2-19
Available Device Memory
2-20
Available Device Memory
- Expansion code
An expansion code should be designated, depending on the type of memory in use.
For more information, refer to the description of indirect device memory designation
relevant to the target device memory type in the V9 Series Connection Manual.
- Station number
1 : 1 or multi-link: Not used
1 : n (multi-drop): Set the station number of the connected device.
Memory card
15 MSB 8 7 LSB 0
n+0 02H File No.
n+1 Word address in the record
n+2 Record No.
Example
• When accessing a word in the PLCn memory, “0” is specified for the “n + 2” word even in
the case of device memory that does not use an expansion code.
Ex.: Accessing D165 in a Mitsubishi PLC (PLC1)
(Macro)
$u100 = 0100H (W) Model: 01 (PLC1 memory) Memory type: 00
$u101 = 0165 (W) Device memory No.: 165
$u102 = 0000 (W) Expansion code: None
$u200 = *$u100 (W)
(Result of execution)
Data at D165 is transferred to $u200.
• When accessing the bit-writable device memory, such as the Mitsubishi M Relay, the
following setting is necessary.
2-21
CSV Format Setting (with Recipe or Sampling Macro Used)
xxxxxxxx.CSV
SMPL_CSV2 Designation of a file name page 4-138
by the device memory
• Alarm server
xxxxxxxx_ [Alarm Block] [Format
YYYYMMDDHHMMSS.CSV Setting]
Sampling Designation of a file name by
SMPLCSV_BAK the editor page 4-141
After _: Output time in year, • Logging Server
month, day, hour, [Logging Block]
minute, and second [Format Setting]
xxxxxxxx_
YYYYMMDDHHMMSS.CSV
Designation of a file name by
SMPLCSV_BAK2 the device memory page 4-144
After _: Output time in year,
month, day, hour,
minute, and second
2-22
CSV Format Setting (with Recipe or Sampling Macro Used)
2.3.2 Recipe
Setting procedure
1. Select [System Setting] [Recipe], and specify a recipe number.
The [Recipe Edit] window is displayed.
2
Recipe No.
2. In the [File Format] tab window, set and change settings of the selected recipe number.
2-23
CSV Format Setting (with Recipe or Sampling Macro Used)
Setting details
2-24
CSV Format Setting (with Recipe or Sampling Macro Used)
2-25
CSV Format Setting (with Recipe or Sampling Macro Used)
Format • 1-
Data Type
Setting Specify the data format.
- Data Type: DEC, DEC-, HEX, OCT, BIN, CHAR, BCD,
FLOAT
- Data Length: 1-Word, 2-Word
- Decimal Point: 0 - 32
- Characters: 2 - 255
- Text Process: LSB MSB, MSB LSB
This option is enabled when [Add record name] is checked.
Transfer • [Data]
Device Transfer Target Only data is transferred.
Setting • [Record Name + Data]
Both record name and data are transferred.
2-26
CSV Format Setting (with Recipe or Sampling Macro Used)
V8-compatible settings
When using a recipe macro, the following settings are necessary:
2-27
CSV Format Setting (with Recipe or Sampling Macro Used)
Depending on the name of a CSV file, its location and file designation vary. Create a file
according to your purpose.
NORMAL
TARGET
PRODUCT1.CSV
PRODUCT2.CSV
PRODUCT3.CSV Group folders*
PRODUCT4.CSV
PRODUCT5.CSV
PRODUCT6.CSV
TEST
TEST1.CSV
TEST2.CSV
TEST3.CSV
REC0000.CSV
REC0001.CSV
REC0002.CSV
2-28
CSV Format Setting (with Recipe or Sampling Macro Used)
There is a limitation on the number of group folders and CSV files that can be handled in the
recipe mode.
• The total of group folders and CSV files in the RECIPE folder: 1,024 maximum
• The number of CSV files in a group folder: 1,024 maximum 2
Any more folders and files than HDCOPY
1,024 are not recognized in the
JPEG
recipe mode.
MEMO
* When access to CSV files is
RECIPE
made by a macro command,
NORMAL : 1,024 maximum
this limitation is not imposed.
TARGET
The time for accessing : 1,024 maximum
PRODUCT1.CSV
increases proportionately with PRODUCT2.CSV : 1,024 maximum
the number of files. PRODUCT3.CSV
PRODUCT4.CSV
PRODUCT5.CSV
PRODUCT6.CSV
TEST
TEST1.CSV
TEST2.CSV
TEST3.CSV
REC0001.CSV
REC0002.CSV
REC0003.CSV
SAMPLE
SNAP
2-29
CSV Format Setting (with Recipe or Sampling Macro Used)
2.3.3 Sampling
Alarm Server
Setting procedure
1. Select [Alarm Server] [Alarm Block].
The [Alarm Block] window is displayed.
2. In the [Form Setting] tab window, double-click on the block number to be output in CSV
format. The [Format] dialog appears.
Setting details
• [Alarm]
Specify a title Specify a title to be added to the header in the CSV file.
History Display Set the display order of alarm history.
Calendar Condition Select a format of date display to be output in the CSV file.
Display the primary cause Only error messages of primary causes are output in the
only CSV file.
Add a (*) mark to the primary Primary cause messages are output with (*) marks
cause appended in the CSV file.
2-30
CSV Format Setting (with Recipe or Sampling Macro Used)
• [Event]
Specify a title Specify a title to be added to the header in the CSV file.
Calendar Condition Check this box to output the date in the CSV file.
Output Information Select a status to output.
Activate Status Display Select a format of status display to be output in the CSV
file.
2-31
CSV Format Setting (with Recipe or Sampling Macro Used)
Logging Server
Setting procedure
1. Select [Logging Server] [Logging Block].
The [Logging Block] window is displayed.
2. In the [Form Setting] tab window, double-click on the block number to be output in CSV
format. The [Format] dialog appears.
Setting details
Specify a title Specify a title to be added to the header in the CSV file.
Calendar Condition Select a format of date display to be output in the CSV
file.
Display in msec Check this box to output the time data in the unit of
msec in the CSV file.
2-32
CSV Format Setting (with Recipe or Sampling Macro Used)
For “SMPL_CSV”
(User-specified name).CSV
• Alarm server 2
(access folder)\ALARM\
* A maximum of 64 one-byte characters can
be used as a user-specified name. • Logging Server
(access folder)\LOGGING\
LOGGING
2-33
CSV Format Setting (with Recipe or Sampling Macro Used)
For “SMPLCSV_BAK/SMPLCSV_BAK2”
2-34
3
3.1
Command
DIV(/)
F0 = F1 / F2 (W)
Division page 4-8
3
F0 = F1 / F2 (D)
F0 = F1 % F2 (W)
MOD(%) Remainder of division page 4-9
F0 = F1 % F2 (D)
F0 = F1 & F2 (W)
AND(&) Logical product page 4-10
F0 = F1 & F2 (D)
F0 = F1 | F2 (W)
OR(|) Logical add page 4-11
F0 = F1 | F2 (D)
Logical F0 = F1 ^ F2 (W)
XOR(^) Exclusive OR page 4-12
Operation F0 = F1 ^ F2 (D)
F0 = F1 << F2 (W)
SHL(<<) Left shift page 4-13
F0 = F1 << F2 (D)
F0 = F1 >> F2 (W)
SHR(>>) Right shift page 4-14
F0 = F1 >> F2 (D)
F0 = MAX (F1 C:F2) (W)
MAX Maximum page 4-15
F0 = MAX (F1 C:F2) (D)
F0 = MIN (F1 C:F2) (W)
MIN Minimum page 4-16
F0 = MIN (F1 C:F2) (D)
Statistic
F0 = AVG (F1 C:F2) (W)
AVG Average page 4-17
F0 = AVG (F1 C:F2) (D)
F0 = SUM (F1 C:F2) (W)
SUM Sum page 4-18
F0 = SUM (F1 C:F2) (D)
EXP F0 = EXP (F1) (F) Exponent page 4-19
EXPT F0 = EXPT (F1,F2) (F) Powers page 4-20
LN F0 = LN (F1) (F) Natural logarithms page 4-21
LOG F0 = LOG (F1) (F) Common logarithms page 4-22
SQRT F0 = SQRT (F1) (F) Square roots page 4-23
F0 = ABS (F1) (W)
ABS F0 = ABS (F1) (D) Absolute value page 4-24
F0 = ABS (F1) (F)
F0 = NEG (F1) (W)
NEG F0 = NEG (F1) (D) Sign inversion page 4-25
Mathematics/ F0 = NEG (F1) (F)
trigonometric
SIN F0 = SIN (F1) (F) Sine page 4-26
COS F0 = COS (F1) (F) Cosine page 4-27
TAN F0 = TAN (F1) (F) Tangent page 4-28
ASIN F0 = ASIN (F1) (F) Arcsine page 4-29
ACOS F0 = ACOS (F1) (F) Arccosine page 4-30
ATAN F0 = ATAN (F1) (F) Arctangent page 4-31
Convert radians
DEG F0 = DEG (F1) (F) page 4-32
degrees
Convert degrees
RAD F0 = RAD (F1) (F) page 4-33
radians
3-1
Macro Command List
3-2
Macro Command List
3-3
Macro Command List
3-4
Macro Command List
BRIGHT BRIGHT F0
Brightness
page 4-167
3
adjustment
GET_MSGBLK GET_MSGBLK F0 F1 Message acquisition page 4-168
PLC_ULR PLC_ULR F0 F1 Read user log page 4-169
Multi-drop
RECONNECT RECONNECT F0 page 4-171
reconnection (PLC1)
RECONNECT_EX RECONNECT_EX PLC F0 F1 Restart page 4-172
Acquire logging/alarm
SAMPLE SAMPLE F0 F1 F2 page 4-173
data
SEARCH_FILE SEARCH_FILE F0 F1 Search for JPEG files page 4-176
ADJ_VOLUME ADJ_VOLUME F0 F1 F2 Adjust volume page 4-177
Save volume
SAVE_VOLUME SAVE_VOLUME page 4-178
adjustment value
TREND Refresh trend data
TREND REFRESH F0 F1 page 4-179
REFRESH display
Screen number
SYS (SET_SCRN) F1 page 4-180
designation
Multi-overlap/global
SYS (SET_MOVLP) F1 page 4-181
overlap setting
SYS (OVLP_SHOW) F1 Overlap ON/OFF page 4-183
Others SYS (OVLP_POS) F1 Overlap relocation page 4-184
SYS (GET_MSG) F1 Message acquisition page 4-185
Acquisition of X and
SYS (GET_XY) F1 Y coordinates on page 4-186
circumference
SYS (SET_BZ) F1 Buzzer control page 4-188
System time
SYS (GET_TIME) F1 page 4-189
acquisition
SYS SYS (STA_TIME) F1 Timer setting page 4-190
SYS (GET_CLND) F1 Calendar acquisition page 4-192
SYS (SET_CLND) F1 Calendar setting page 4-193
Logging information page 4-194
SYS (SET_BUFNO) F1
Alarm log information page 4-196
Acquire logging/alarm
SYS (GET_SMPL) F1 page 4-197
data
Cursor point
SYS (GET_SCUR) F1 page 4-199
acquisition
Show/hide numerical
SYS (DSP_DATA) F1 page 4-201
data display
Change numerical
SYS (CHG_DATA) F1 page 4-202
data display property
SYS (STA_LIST) F1 Data sheet print page 4-204
3-5
Macro Command List
3-6
4
4.1
Details of Macro
Commands
Guide to Chapter 4
4.2 Arithmetical Operation
4.3 Logical Operation
4.4 Statistic
4.5 Mathematics/trigonometric
4.6 Bit Operation
4.7 Conversion
4.8 Transfer
4.9 Comparison
4.10 Macro Operation Control
4.11 FROM Backup
4.12 PLC
4.13 Ethernet
4.14 Storage (Recipe)
4.15 Storage (Sampling)
4.16 Storage (Others)
4.17 Real No. Arithmetical Operation
4.18 Real No. Statistics
4.19 Others
Guide to Chapter 4
Applicable model *1
4
Types of device memory usable for the
command and how to designate them
For more information on the types of device
memory, refer to page 2-19.
For more information on the indirect memory
designation, refer to page 2-20.
4-1
Arithmetical Operation
WORD DWORD
F1 F1+1 F1
F2 F2+1 F2
F0 F0+1 F0
Setting range
WORD DWORD
F0
32768 - +32767 2147483648 - +2147483647
F1
(Decimal system with signs) (Decimal system with signs)
F2
Example
• $u100 = $u200 + $u300 (W)
$u200 5
$u300 100
$u100 105
4-2
Arithmetical Operation
Supplemental remarks
• Operation is performed in the decimal system with signs. Be sure that the
result [F0] falls within the permissible range.
DEC- HEX
$u200 30000 7530
$u300 5000 1388
$u100 -30536 88B8
8000 - FFFF are negative in
NG the decimal system with signs.
• In a case where [F1] and [F2] are specified in the following ranges, they are
treated as negative values 1 to 32768.
32768 - 65535 (DEC)
100000 - 17777 (OCT)
8000 - FFFF (HEX)
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-3
Arithmetical Operation
Setting range
WORD DWORD
F0
32768 - +32767 2147483648 - +2147483647
F1
(Decimal system with signs) (Decimal system with signs)
F2
Example
• $u100 = $u200 $u300 (W)
$u200 100
$u300 40
$u100 60
• $u100 = $u200 $u300 (D)
$u201 $u200 70000
$u301 $u300 100
$u101 $u100 69900
Supplemental remarks
• Operation is performed in the decimal system with signs. Be sure that the
result [F0] falls within the permissible range.
DEC- HEX
$u200 -30000 8AD0
$u300 5000 1388
$u100 30536 7748
0000 - 7FFF are positive in
NG the decimal system with signs.
4-4
Arithmetical Operation
• In a case where [F1] and [F2] are specified in the following ranges, they are
treated as negative values 1 to 32768.
32768 - 65535 (DEC)
100000 - 17777 (OCT)
8000 - FFFF (HEX)
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development) 4
4-5
Arithmetical Operation
WORD DWORD
F1 F1+1 F1
F2 F2+1 F2
F0 F0+1 F0
Setting range
WORD DWORD
F0
32768 - +32767 2147483648 - +2147483647
F1
(Decimal system with signs) (Decimal system with signs)
F2
Example
• $u100 = $u200 $u300 (W)
$u200 100
$u300 40
$u100 4000
4-6
Arithmetical Operation
Supplemental remarks
• Operation is performed in the decimal system with signs. Be sure that the
result [F0] falls within the permissible range.
DEC- HEX
$u200 30000 7530
$u300 2 0002
$u100 -5536 EA60
8000 - FFFF are negative in
NG the decimal system with signs.
$u200
DEC
30000
HEX
7530
4
$u300 2 0002
$u100 60000 EA60
8000 - FFFF are positive in the
OK decimal system without signs.
• If the result [F0] is outside the permissible range, the extra portion is
truncated.
DEC- HEX
$u200 30000 7530
$u300 3 0003
$u100 24464 15F90
Portion outside the
NG range truncated
5F90
* The execution result in the example above is normal.
• In a case where [F1] and [F2] are specified in the following ranges, they are
treated as negative values 1 to 32768.
32768 - 65535 (DEC)
100000 - 17777 (OCT)
8000 - FFFF (HEX)
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-7
Arithmetical Operation
WORD DWORD
F1 F1+1 F1
F2 F2+1 F2
F0 Remainder F0+1 F0 Remainder
Setting range
WORD DWORD
F0
32768 - +32767 2147483648 - +2147483647
F1
(Decimal system with signs) (Decimal system with signs)
F2
Example
• $u100 = $u200 / $u300 (W)
$u200 100
$u300 40
$u100 Remainder 2 20
Supplemental remarks
• Operation is performed in the decimal system with signs. Be sure that the [F1]
value falls within the permissible range.
• In a case where [F1] and [F2] are specified in the following ranges, they are
treated as negative values 1 to 32768.
32768 - 65535 (DEC)
100000 - 17777 (OCT)
8000 - FFFF (HEX)
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0* Normal
1 Overflow
2 Underflow
3 Calculation operation execution error
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-8
Arithmetical Operation
WORD DWORD
F1 F1+1 F1
F2 F2+1 F2
Quotient F0 Quotient F0+1 F0
Setting range
WORD DWORD
F0
32768 - +32767 2147483648 - +2147483647
F1
(Decimal system with signs) (Decimal system with signs)
F2
Example
• $u100 = $u200 % $u300 (W)
$u200 100
$u300 40
Quotient $u100 2 20
• $u100 = $u200 % $u300 (D)
$u201 $u200 80000
$u301 $u300 30000
Quotient $u101 $u100 2 20000
Supplemental remarks
• Operation is performed in the decimal system with signs. Be sure that the [F1]
value falls within the permissible range.
• In a case where [F1] and [F2] are specified in the following ranges, they are
treated as negative values 1 to 32768.
32768 - 65535 (DEC)
100000 - 17777 (OCT)
8000 - FFFF (HEX)
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0* Normal
1 Overflow
2 Underflow
3 Calculation operation execution error
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-9
Logical Operation
Setting range
WORD DWORD
F0
0000 - FFFF 00000000 - FFFFFFFF
F1
(HEX) (HEX)
F2
Example
• $u100 = $u200 & $u300 (W)
15 0
$u200 1 0 1 1 0 0 0 1 1 1 0 1 0 0 1 0
AND
$u300 0 1 0 1 1 1 0 1 0 0 0 1 1 0 0 1
$u100 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0
Supplemental remarks
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-10
Logical Operation
Setting range
WORD DWORD
F0
0000 - FFFF 00000000 - FFFFFFFF
F1
(HEX) (HEX)
F2
Example
• $u100 = $u200 | $u300 (W)
15 0
$u200 1 0 1 1 0 0 0 1 1 1 0 1 0 0 1 0
OR
$u300 0 1 0 1 1 1 0 1 0 0 0 1 1 0 0 1
$u100 1 1 1 1 1 1 0 1 1 1 0 1 1 0 1 1
Supplemental remarks
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-11
Logical Operation
Setting range
WORD DWORD
F0
0000 - FFFF 00000000 - FFFFFFFF
F1
(HEX) (HEX)
F2
Example
• $u100 = $u200 ^ $u300 (W)
15 0
$u200 1 0 1 1 0 0 0 1 1 1 0 1 0 0 1 0
XOR
$u300 0 1 0 1 1 1 0 1 0 0 0 1 1 0 0 1
$u100 1 1 1 0 1 1 0 0 1 1 0 0 1 0 1 1
Supplemental remarks
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-12
Logical Operation
F0 Truncated 0 0 0
Left shift by 15
0 0 0 0 0 0 0 0 0 0 0 0
4
Available device memory
Internal device PLC 1 - 8 device
Memory card Constant
memory memory
F0
F1
F2
: Setting enabled (indirect designation disabled)
: Setting enabled (indirect designation enabled)
Setting range
WORD DWORD
F0 0000 - FFFF 00000000 - FFFFFFFF
F1 (HEX) (HEX)
F2 0 - 15 0 - 31
Example
• $u100 = $u200 << 3 (W)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
$u200 - 1 0 0 1 1 1 0 1 0 0 0 0 1 0 0 1
Left shift by 3
$u100 Truncated 1 1 1 0 1 0 0 0 0 1 0 0 1 0 0 0
Supplemental remarks
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-13
Logical Operation
Setting range
WORD DWORD
F0 0000 - FFFF 00000000 - FFFFFFFF
F1 (HEX) (HEX)
F2 0 - 15 0 - 31
Example
• $u100 = $u200 >> 3 (W)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
$u200 1 0 0 1 1 1 0 1 0 0 0 0 1 0 0 1 -
Right shift by 3
$u100 0 0 0 1 0 0 1 1 1 0 1 0 0 0 0 1 Truncated
Supplemental remarks
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-14
Statistic
4.4 Statistic
Setting range
WORD DWORD
F0 32768 - +32767 2147483648 - +2147483647
F1 (Decimal system with signs) (Decimal system with signs)
F2 0 - 512 0 - 512
Example
• $u100 = MAX ($u200 C : 5) (W)
$u200 -100
$u201 1 MAX
$u202 32767 $u100 32767
$u203 -4500
$u204 336
• $u100 = MAX ($u200 C : 5) (D)
$u201 $u200 -70000
$u203 $u202 -1 MAX
$u205 $u204 2147483647 $u101 $u100 2147483647
$u207 $u206 450
$u209 $u208 8900000
Supplemental remarks
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-15
Statistic
WORD DWORD
1 F1 1 F1+1 F1
2 F1+1 2 F1+3 F1+2
3 F1+2 F0 3 F1+5 F1+4 F0
: : MIN : : MIN
F2 F2
Setting range
WORD DWORD
F0 32768 - +32767 2147483648 - +2147483647
F1 (Decimal system with signs) (Decimal system with signs)
F2 0 - 512 0 - 512
Example
• $u100 = MIN ($u200 C : 5) (W)
$u200 -100
$u201 1 MIN
$u202 32767 $u100 -4500
$u203 -4500
$u204 336
• $u100 = MIN ($u200 C : 5) (D)
$u201 $u200 -70000
$u203 $u202 -1 MIN
$u205 $u204 2147483647 $u101 $u100 -70000
$u207 $u206 450
$u209 $u208 8900000
Supplemental remarks
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-16
Statistic
WORD DWORD
1 F1 1 F1+1 F1
2 F1+1 2 F1+3 F1+2
3 F1+2 F0 3 F1+5 F1+4 F0
: : AVG : : AVG
F2 F2
Setting range
WORD DWORD
F0 32768 - +32767 2147483648 - +2147483647
F1 (Decimal system with signs) (Decimal system with signs)
F2 0 - 512 0 - 512
Example
• $u100 = AVG ($u200 C : 5) (W)
$u200 -100
$u201 200 AVG
$u202 30000 $u100 5200
$u203 -4500
$u204 400
• $u100 = AVG ($u200 C : 5) (D)
$u201 $u200 -70000
$u203 $u202 70000 AVG
$u205 $u204 2000000000 $u101 $u100 400000000
$u207 $u206 -8900000
$u209 $u208 8900000
Supplemental remarks
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0* Normal
3 Calculation operation execution error
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-17
Statistic
Setting range
WORD DWORD
F0 32768 - +32767 2147483648 - +2147483647
F1 (Decimal system with signs) (Decimal system with signs)
F2 0 - 512 0 - 512
Example
• $u100 = SUM ($u200 C : 5) (W)
$u200 -100
$u201 200 SUM
$u202 30000 $u100 26000
$u203 -4500
$u204 400
• $u100 = SUM ($u200 C : 5) (D)
$u201 $u200 -70000
$u203 $u202 70000 SUM
$u205 $u204 2000000000 $u101 $u100 2000000000
$u207 $u206 -8900000
$u209 $u208 8900000
Supplemental remarks
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0* Normal
1 Overflow
2 Underflow
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-18
Mathematics/trigonometric
4.5 Mathematics/trigonometric
F1+1 F1 FLOAT
e F0+1 F0 FLOAT
Setting range
Value
F0
IEEE 32-bit single precision real number
F1
Example
• $u100 = EXP ($u200) (F)
2.71828 = e 1.0
When $u200 = “1.0”, on command execution “2.71828” is stored in $u100.
Supplemental remarks
• For more information on the IEEE 32-bit single precision real number, refer to
the V9 Series Reference Manual.
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0*1 Normal
1 Overflow*2
2 Underflow*2
*1 Select [System Setting] [Unit Setting] [Environment Setting], and check [Store
the result as normal upon successful completion of macro execution]. When this box
is not checked, the value will not be updated even if execution of the macro is
successfully completed. (Under development)
*2 An indefinite value is stored in [F0].
4-19
Mathematics/trigonometric
Setting range
Value
F0
F1 IEEE 32-bit single precision real number
F2
Example
• $u100 = EXPT ($u200,$u300) (F)
8=23
When $u200 = “2” and $u300 = “3”, on command execution “8” is stored in
$u100.
Supplemental remarks
• For more information on the IEEE 32-bit single precision real numbers, refer to
the V9 Series Reference Manual.
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
*1 Normal
0
1 Overflow*2
2 Underflow*2
*1 Select [System Setting] [Unit Setting] [Environment Setting], and check [Store
the result as normal upon successful completion of macro execution]. When this box
is not checked, the value will not be updated even if execution of the macro is
successfully completed. (Under development)
*2 An indefinite value is stored in [F0].
4-20
Mathematics/trigonometric
LN F0 = LN(F1) (F)
FLOAT FLOAT
log e ( F1+1 F1 ) F0+1 F0
Setting range
Value
F0
IEEE 32-bit single precision real number
F1
Example
• $u100 = LN ($u200) (F)
2.302585 = log e (10.0)
When $u200 = “10.0”, on command execution “2.302585” is stored in $u100.
Supplemental remarks
• For more information on the IEEE 32-bit single precision real number, refer to
the V9 Series Reference Manual.
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
*1 Normal
0
1 Overflow*2
2 Underflow*2
*1 Select [System Setting] [Unit Setting] [Environment Setting], and check [Store
the result as normal upon successful completion of macro execution]. When this box
is not checked, the value will not be updated even if execution of the macro is
successfully completed. (Under development)
*2 An indefinite value is stored in [F0].
4-21
Mathematics/trigonometric
FLOAT FLOAT
log 10 ( F1+1 F1 ) F0+1 F0
Setting range
Value
F0
IEEE 32-bit single precision real number
F1
Example
• $u100 = LOG ($u200) (F)
1.0 = log 10 (10.0)
When $u200 = “10.0”, on command execution “1.0” is stored in $u100.
Supplemental remarks
• For more information on the IEEE 32-bit single precision real number, refer to
the V9 Series Reference Manual.
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
*1 Normal
0
1 Overflow*2
2 Underflow*2
*1 Select [System Setting] [Unit Setting] [Environment Setting], and check [Store
the result as normal upon successful completion of macro execution]. When this box
is not checked, the value will not be updated even if execution of the macro is
successfully completed. (Under development)
*2 An indefinite value is stored in [F0].
4-22
Mathematics/trigonometric
FLOAT FLOAT
л ( F1+1 F1 ) F0+1 F0
Setting range
Value
F0
IEEE 32-bit single precision real number
F1
Example
• $u100 = SQRT ($u200) (F)
1.41421 = (2.0)
When $u200 = “2.0”, on command execution “1.41421” is stored in $u100.
Supplemental remarks
• For more information on the IEEE 32-bit single precision real number, refer to
the V9 Series Reference Manual.
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0*1 Normal
1 Overflow*2
2 Underflow*2
*1 Select [System Setting] [Unit Setting] [Environment Setting], and check [Store
the result as normal upon successful completion of macro execution]. When this box
is not checked, the value will not be updated even if execution of the macro is
successfully completed. (Under development)
*2 An indefinite value is stored in [F0].
4-23
Mathematics/trigonometric
DWORD
WORD FLOAT
F1 + F0 F1+1 F1 + F0+1 F0
Setting range
WORD DWORD FLOAT
F0 32767 to +32767 2147483647 to IEEE 32-bit single
(Decimal system with +2147483647 precision real
F1 signs) (Decimal system with signs) number
Example
• $u100 = ABS ($u200) (W)
When $u200 = “1”, on command execution “1” is stored in $u100.
$u200 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 BIN
F F F F HEX
-1 DEC
ABS
$u100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 BIN
0 0 0 1 HEX
1 DEC
Supplemental remarks
• For more information on the IEEE 32-bit single precision real numbers, refer to
the V9 Series Reference Manual.
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
*1 Normal
0
1 Overflow*2
2 Underflow*2
*1 Select [System Setting] [Unit Setting] [Environment Setting], and check [Store
the result as normal upon successful completion of macro execution]. When this box
is not checked, the value will not be updated even if execution of the macro is
successfully completed. (Under development)
*2 An indefinite value is stored in [F0].
4-24
Mathematics/trigonometric
+ F1 - F0 + F1+1 F1 - F0+1 F0
Setting range
WORD DWORD FLOAT
F0 32767 to +32767 2147483647to IEEE 32-bit single
(Decimal system with +2147483647 precision real
F1 signs) (Decimal system with signs) number
Example
• $u100 = NEG ($u200) (W)
When $u200 = “1”, on command execution “1” is stored in $u100.
$u200 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 BIN
F F F F HEX
-1 DEC
NEG
$u100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 BIN
0 0 0 1 HEX
1 DEC
Supplemental remarks
• For more information on the IEEE 32-bit single precision real numbers, refer to
the V9 Series Reference Manual.
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0*1 Normal
1 Overflow*2
2 Underflow*2
*1 Select [System Setting] [Unit Setting] [Environment Setting], and check [Store
the result as normal upon successful completion of macro execution]. When this box
is not checked, the value will not be updated even if execution of the macro is
successfully completed. (Under development)
*2 An indefinite value is stored in [F0].
4-25
Mathematics/trigonometric
FLOAT FLOAT
F1+1 F1
SIN
F0+1 F0
Setting range
Value
F0
IEEE 32-bit single precision real number
F1
Example
• To obtain the value for sin 90 in radians;
$u200 = RAD (90) (F)
$u100 = SIN ($u200) (F)
The operation result of “1” is stored in $u100.
* The sine, cosine and tangent of the trigonometric functions can be obtained
based on the formulae below.
- Radian (circular measure)
1 rad = 360/2 Y axis
= approx. 57.29578 deg.
(0,1)
(x,y)
r
X axis
(0,-1)
Supplemental remarks
• For more information on the IEEE 32-bit single precision real numbers, refer to
the V9 Series Reference Manual.
• To convert the unit of an angle, use the macro command of DEG (page 4-32)
or RAD (page 4-33).
4-26
Mathematics/trigonometric
FLOAT FLOAT
F1+1 F1
COS
F0+1 F0
Setting range
Value
F0
IEEE 32-bit single precision real number
F1
Example
• To obtain the value for cos 0 in radians;
$u200 = RAD (0) (F)
$u100 = COS ($u200) (F)
The operation result of “1” is stored in $u100.
Supplemental remarks
• For more information on the IEEE 32-bit single precision real numbers, refer to
the V9 Series Reference Manual.
• To convert the unit of an angle, use the macro command of DEG (page 4-32)
or RAD (page 4-33).
4-27
Mathematics/trigonometric
FLOAT FLOAT
F1+1 F1
TAN
F0+1 F0
Setting range
Value
F0
IEEE 32-bit single precision real number
F1
Example
• To obtain the value for tan 45 in radians;
$u200 = RAD (45) (F)
$u100 = TAN ($u200) (F)
The operation result of “1” is stored in $u100.
Supplemental remarks
• For more information on the IEEE 32-bit single precision real numbers, refer to
the V9 Series Reference Manual.
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0*1 Normal
1 Overflow*2
2 Underflow*2
3 Calculation operation execution error*3
*1 Select [System Setting] [Unit Setting] [Environment Setting], and check [Store
the result as normal upon successful completion of macro execution]. When this box
is not checked, the value will not be updated even if execution of the macro is
successfully completed. (Under development)
*2 An indefinite value is stored in [F0].
*3 When the value specified for [F1] is (0.5 + n), “1” is stored in [F0]. (n: integer)
• To convert the unit of an angle, use the macro command of DEG (page 4-32)
or RAD (page 4-33).
4-28
Mathematics/trigonometric
FLOAT FLOAT
SIN-1
F1+1 F1 F0+1 F0
Setting range
Value
F0
IEEE 32-bit single precision real number
F1
Y axis
Example
• To obtain the value for sin-1 1; 2
1
$u100 = ASIN (1) (F)
The operation result of “1.570796” (= /2) X axis
is stored in $u100.
-1 0 1
-1
* The sin of the trigonometric functions is -1
expressed in the graph shown on the right.
2
Supplemental remarks
• For more information on the IEEE 32-bit single precision real numbers, refer to
the V9 Series Reference Manual.
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0*1 Normal
1 Overflow*2
2 Underflow*2
3 Calculation operation execution error*3
*1 Select [System Setting] [Unit Setting] [Environment Setting], and check [Store
the result as normal upon successful completion of macro execution]. When this box
is not checked, the value will not be updated even if execution of the macro is
successfully completed. (Under development)
*2 An indefinite value is stored in [F0].
*3 When the value specified for [F1] is outside the range from “-1” to “1”, “1” is stored in
[F0].
• To convert the unit of an angle, use the macro command of DEG (page 4-32)
or RAD (page 4-33).
4-29
Mathematics/trigonometric
Function: Arccosine
All models
This macro command is used to store an arccosine of the angle (in radians)
specified for [F1] in [F0].
Specify [F0] and [F1] as floating decimal point (FLOAT) type values.
FLOAT FLOAT
COS-1
F1+1 F1 F0+1 F0
Setting range
Value
F0
IEEE 32-bit single precision real number
F1
Example
• To obtain the value for cos-1 0;
$u100 = ACOS (0) (F)
The operation result of “1.570796” (= /2) is stored in $u100.
Y axis
* The cos-1 of the trigonometric functions is
expressed in the graph shown on the right.
X axis
-1 0 1
Supplemental remarks
• For more information on the IEEE 32-bit single precision real numbers, refer to
the V9 Series Reference Manual.
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0*1 Normal
1 Overflow*2
2 Underflow*2
3 Calculation operation execution error*3
*1 Select [System Setting] [Unit Setting] [Environment Setting], and check [Store
the result as normal upon successful completion of macro execution]. When this box
is not checked, the value will not be updated even if execution of the macro is
successfully completed. (Under development)
*2 An indefinite value is stored in [F0].
*3 When the value specified for [F1] is outside the range from “-1” to “1”, “1” is stored in
[F0].
• To convert the unit of an angle, use the macro command of DEG (page 4-32)
or RAD (page 4-33).
4-30
Mathematics/trigonometric
Function: Arctangent
All models
This macro command is used to store an arctangent of the angle (in radians)
specified for [F1] in [F0].
Specify [F0] and [F1] as floating decimal point (FLOAT) type values.
FLOAT FLOAT
TAN-1
F1+1 F1 F0+1 F0
Setting range
Value
F0
IEEE 32-bit single precision real number
F1
Example
• To obtain the value for tan-1 0;
$u100 = ATAN (0) (F)
The operation result of “0” is stored in $u100.
Y axis
* The tan-1 of the trigonometric
functions is expressed in the graph
shown on the right. 2
X axis
0
Supplemental remarks
• For more information on the IEEE 32-bit single precision real numbers, refer to
the V9 Series Reference Manual.
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0*1 Normal
1 Overflow*2
2 Underflow*2
*1 Select [System Setting] [Unit Setting] [Environment Setting], and check [Store
the result as normal upon successful completion of macro execution]. When this box
is not checked, the value will not be updated even if execution of the macro is
successfully completed. (Under development)
*2 An indefinite value is stored in [F0].
• To convert the unit of an angle, use the macro command of DEG (page 4-32)
or RAD (page 4-33).
4-31
Mathematics/trigonometric
FLOAT FLOAT
F1+1 F1
DEG
F0+1 F0
Setting range
Value
F0
IEEE 32-bit single precision real number
F1
Example
• To obtain a value in degrees;
$u100 = ASIN (1) (F)
$u200 = DEG ($u100) (F)
The operation result of “90” is stored in $u200.
Supplemental remarks
• For more information on the IEEE 32-bit single precision real numbers, refer to
the V9 Series Reference Manual.
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
*1 Normal
0
1 Overflow*2
2 Underflow*2
*1 Select [System Setting] [Unit Setting] [Environment Setting], and check [Store
the result as normal upon successful completion of macro execution]. When this box
is not checked, the value will not be updated even if execution of the macro is
successfully completed. (Under development)
*2 An indefinite value is stored in [F0].
4-32
Mathematics/trigonometric
FLOAT FLOAT
F1+1 F1
RAD
F0+1 F0
Setting range
Value
F0
IEEE 32-bit single precision real number
F1
Example
• To obtain 180 in radians;
$u100 = RAD (180) (F)
The operation result of “3.141592” (= ) is stored in $u100.
Supplemental remarks
• For more information on the IEEE 32-bit single precision real numbers, refer to
the V9 Series Reference Manual.
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0*1 Normal
1 Overflow*2
2 Underflow*2
*1 Select [System Setting] [Unit Setting] [Environment Setting], and check [Store
the result as normal upon successful completion of macro execution]. When this box
is not checked, the value will not be updated even if execution of the macro is
successfully completed. (Under development)
*2 An indefinite value is stored in [F0].
4-33
Bit Operation
BSET F0 (ON)
Example
• $u100 - 08 (ON)
15 08 0
$u100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
BSET
0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
Supplemental remarks
• If you use PLC memory or temperature controller memory that is disabled for
bit-by-bit read and write, the macro operation as the following takes place.
Ex.) Mitsubishi PLC D100-05 (ON)
1. One word that specifies the bit is read.
2. The bit specified by the above one word is set (ON).
3. The data is written to the PLC.
1.
2. 15 5 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
BSET
0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1
3.
* If the bit is changed in a sequence program during processing of step 2, step 3 for data
writing is performed.
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-34
Bit Operation
BCLR F0 (OFF)
Example
4
• $u100 - 08 (OFF)
15 08 0
$u100 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
BCLR
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Supplemental remarks
• If you use PLC memory or temperature controller memory that is disabled for
bit-by-bit read and write, the macro operation as the following takes place.
Ex.) Mitsubishi PLC D100-05 (OFF)
1. One word that specifies the bit is read.
2. The bit specified by the above one word is reset (OFF).
3. The data is written to the PLC.
1.
2. 15 5 0
0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1
BCLR
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
3.
* If the bit is changed in a sequence program during processing of step 2, step 3 for data
writing is performed.
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-35
Bit Operation
BINV F0 (INV)
Example
• $u100 - 08 (INV)
15 08 0
$u100 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
BINV
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Supplemental remarks
• If you use PLC memory or temperature controller memory that is disabled for
bit-by-bit read and write, the macro operation as the following takes place.
Ex.) Mitsubishi PLC D100-05 (INV)
1. One word that specifies the bit is read.
2. The bit specified by the above one word is inverted.
3. The data is written to the PLC.
1.
2. 15 5 0
0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1
BINV
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
3.
* If the bit is changed in a sequence program during processing of step 2, step 3 for data
writing is performed.
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-36
Conversion
4.7 Conversion
WORD DWORD
F1 BIN F1+1 F1 BIN
BCD BCD
F0 BCD F0+1 F0 BCD
Setting range
WORD DWORD
0 - 9999 0 - 99999999
F0
(BCD) (BCD)
0 - 9999 0 - 99999999
F1
(Decimal system without signs) (Decimal system without signs)
Example
• $u100 = $u200 (W) BCD
$u200 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 BIN
0 0 6 4 HEX
100 DEC
BCD
$u100 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 BIN
0 1 0 0 HEX
100 BCD
Supplemental remarks
• If the value in [F1] is outside the permissible range, [F0] becomes “0”.
• The result of macro execution is stored in $s1057.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-37
Conversion
WORD DWORD
F1 BCD F1+1 F1 BCD
BIN BIN
F0 BIN F0+1 F0 BIN
Setting range
WORD DWORD
0 - 9999 0 - 99999999
F0
(Decimal system without signs) (Decimal system without signs)
0 - 9999 0 - 99999999
F1
(BCD) (BCD)
Example
• $u100 = $u200 (W)BIN
$u200 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 BIN
0 1 0 0 HEX
100 BCD
BIN
$u100 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 BIN
0 0 6 4 HEX
100 DEC
Supplemental remarks
• If the value in [F1] is outside the permissible range, [F0] becomes “0”.
• The result of macro execution is stored in $s1057.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-38
Conversion
CWD F0 = F1 D <-W
F1
CWD
F0+1 F0
Setting range
Value
F0
32768 - +32767
F0+1
(Decimal system with signs)
F1
Example
• $u100 = $u200 D <- W
$u200 1 1 1 1 1 1 1 1 1 0 0 1 1 1 0 0 BIN
F F 9 C HEX
-100 DEC
CWD
Supplemental remarks
• The result of macro execution is stored in $s1057.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-39
Conversion
Setting range
• The available memory address range and the type of data vary, depending on
the PLCs. Refer to the PLC manual for details.
Example
• Fuji MICREX-F F70S BCD with signs (7999 to +7999)
The most significant bit
OFF: Positive
ON: Negative
$u100 = $u200 (W) PLC<-
$u200 1 1 1 1 1 1 1 1 1 0 0 1 1 1 0 0 BIN
F F 9 C HEX
-100 V series (DEC)
CVP
$u100 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 BIN
8 1 0 0 HEX
-100 F70S (BCD with signs)
Supplemental remarks
• The macro command is used in combination with MOV or BMOV.
• To convert to characteristic data other than for PLC1, use “ CVPFMT” (page 4-
41).
• The result of macro execution is stored in $s1057.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-40
Conversion
Setting range
Value
F0 The available memory address range and the type of data vary,
depending on the PLCs.
F1 Refer to the PLC manual for details.
F2 1-8
Example
• Fuji’s MICREX-F series is connected as PLC2.
• Fuji MICREX-F F70S BCD with signs (-7999 to +7999)
The most significant bit
OFF: Positive
ON: Negative
$u100 = $u200 (W) PLC2 <-
$u200 1 1 1 1 1 1 1 1 1 0 0 1 1 1 0 0 BIN
F F 9 C HEX
-100 V series (DEC)
CVPFMT
$u100 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 BIN
8 1 0 0 HEX
-100 F70S (BCD with signs)
Supplemental remarks
• The macro command is used in combination with MOV or BMOV.
• The result of macro execution is stored in $s1057.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-41
Conversion
Setting range
• The available memory address range and the type of data vary, depending on
the PLCs. Refer to the PLC manual for details.
Example
• Fuji MICREX-F F70S BCD with signs (7999 to +7999)
The most significant bit
OFF: Positive
ON: Negative
$u100 = $u200 (W) <-PLC
$u200 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 BIN
8 0 0 1 HEX
-1 F70S (BCD with signs)
CVB
$u100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 BIN
F F F F HEX
-1 V series (DEC)
Supplemental remarks
• The macro command is used in combination with MOV or BMOV.
• To convert to characteristic data other than for PLC1, use “ CVBFMT” (page 4-
43).
• The result of macro execution is stored in $s1057.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-42
Conversion
Setting range
Value
F0 The available memory address range and the type of data vary,
depending on the PLCs.
F1 Refer to the PLC manual for details.
F2 1-8
Example
• Fuji’s MICREX-F series is connected as PLC2.
• Fuji MICREX-F F70S BCD with signs (-7999 to +7999)
The most significant bit
OFF: Positive
ON: Negative
$u100 = $u200 (W) <- PLC2
$u200 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 BIN
8 0 0 1 HEX
-1 F70S (BCD with signs)
CVBFMT
$u100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 BIN
F F F F HEX
-1 V series (DEC)
Supplemental remarks
• The macro command is used in combination with MOV or BMOV.
• The result of macro execution is stored in $s1057.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-43
Conversion
SWAP F0 = C : F1 (SWAP)
Swap
Setting range
Value
0000 - FFFF
F0
(HEX)
F1 0 - 1024
Example
• $u100 C : 2 (SWAP)
Swap
Supplemental remarks
• The result of macro execution is stored in $s1057.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-44
Conversion
CHR F0 = ’ ’
CHR
F0 Shifted JIS/ASCII
F0+1 Shifted JIS/ASCII
: Shifted JIS/ASCII
Setting range
Value Remarks
F0 82 bytes maximum
F0+1 Shifted JIS/ASCII Variable depending on the bytes
: of the text
Example
• When [MSB LSB] is selected for [Text Process] on the [Communication
Setting] tab window.
$u100 = string
Text string
CHR
$u100 7 3 7 4 HEX ts
$u101 7 2 6 9 HEX ir
$u102 6 E 6 7 HEX gn
$u103 0 0 0 0 HEX Null code
Supplemental remarks
• Swap between the higher-order byte and the lower-order byte can be set by
selecting an option for [Text Process] under [Communication Setting].
• Regardless of the setting above, use a “ STRING” command (page 4-46) for
[LSB MSB] conversions.
• A null code is added to the end. Even-number-byte text thereby uses one
extra word.
• The result of macro execution is stored in $s1057.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-45
Conversion
STRING F0 = ’ ’(STRING)
Text
STRING
F0 Shifted JIS/ASCII
F0+1 Shifted JIS/ASCII
: Shifted JIS/ASCII
Setting range
Value Remarks
F0 128 bytes maximum
F0+1 Shifted JIS/ASCII Variable depending on the bytes
: of the text
Example
$u100 = string
Text string
CHR
$u100 7 4 7 3 HEX ts
$u101 6 9 7 2 HEX ir
$u102 6 7 6 E HEX gn
$u103 0 0 0 0 HEX Null code
Supplemental remarks
• Regardless of the [Text Process] setting under [Communication Setting] for
PLC1, the data is stored in memory in the [LSB MSB] sequence.
• A null code is added to the end. Even-number-byte text thereby uses one
extra word.
• The result of macro execution is stored in $s1057.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-46
Conversion
F1 31 30 29 - 24 23 22 21 - 5 4 3 2 1 0 Real
Sign Exponent Mantissa number
:
0
4
Sign = 1, Exponent = 255,
: -
Mantissa = 0
Exponent = 255, Mantissa 0 : NaN
CVFD
F0 31 30 29 - 5 4 3 2 1 0
BIN
231 230 229 - 25 24 23 22 21 20
Setting range
Value
F0 2147483648 - 2147483647 (BIN)
F1 IEEE 32-bit single precision real number
F2 32 - +32
Example
• $u100 (D) <- $u200 (F) 0 (D)
$u201,$u200 31 30 29 - 24 23 22 21 - 2 1 0
0 127 4194304
Sign Exponent Mantissa
(-1)0 (1 + 4194304 2-23) 2 (127-127) = 1.5
CVFD
$u101,$u100 31 30 29 - 2 1 0
0 0 0 - 0 1 0
2DEC
4-47
Conversion
$u201,$u200 31 30 29 - 24 23 22 21 - 2 1 0
0 127 4194304
Sign Exponent Mantissa
0 -23
(-1) (1 + 4194304 2 ) 2 (127 - 127) = 1.5
CVFD
$u101,$u100 31 30 29 - 2 1 0
0 0 0 - 1 1 1
15DEC
Supplemental remarks
• You can select whether to round to the nearest whole number, round down or
round up by specifying the appropriate value for $s99.*
Setting Operation
Round to the
0 - 4 : Round down
Other than 1 or 2 nearest whole
5 - 9 : Round up
number
1 Round down
0: Round down
2 Round up
Other than 0: Round up
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-48
Conversion
F1 31 30 29 - 5 4 3 2 1 0
4
:
Mantissa = 0
Sign = 1, Exponent = 255,
: -
Mantissa = 0
Exponent = 255, Mantissa 0 : NaN
Setting range
Value
F0 IEEE 32-bit single precision real number
F1 2147483648 - 2147483647 (BIN)
F2 32 - +32
Example
• $u100 (F) <- $u200 (D) 0 (D)
$u201,$u200 31 30 29 - 2 1 0
00000001BIN BIN
CVDF
$u101,$u100 31 30 29 - 24 23 22 21 - 2 1 0
0 127 0
Sign Exponent Mantissa Real
number
(-1)0 (1 + 0 2-23) 2 (127 - 127) = 1
4-49
Conversion
$u201,$u200 31 30 29 - 2 1 0
00000001BIN BIN
CVDF
$u101,$u100 31 30 29 - 24 23 22 21 - 2 1 0
0 130 2097152
Sign Exponent Mantissa Real
number
(-1)0 (1 + 2097152 2-23) 2 (130 - 127) = 10
Supplemental remarks
The V series manipulates 32-bit single precision real numbers. Therefore, in the
case of 24-bit binary data that exceeds the significant digit (16777216 to
16777215 in the decimal system), the figure at the 25th bit from the leftmost digit
of the converted binary data is rounded up and the figures at the 26th bit and after
are truncated. Since the value obtained in the above manner is used for
conversion to real number, an error is introduced.
F1 31 30 - 26 25 24 23 - 3 2 1 0
0 0 - 0 1 0 0 - 0 1 1 1
33554439 DEC
Because the effective digit is exceeded, the figure at the 25th bit
from the leftmost digit of the converted binary data is rounded up.
0 0 - 0 1 0 0 - 0 1 1 1
24 bits Rounding up
33554440 DEC
CVDF
F0 33554440 Real number
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-50
Conversion
CLND_TO_GRE CLND_TO_GRE F0 F1 F2
Setting range
Value
F0 Time data 0 DEC only
Time data 1 Time data 0
F0+1 Time data 1
GMT-based UNIX time from January 1, 1970
F1 4 or 2 digits: Year
F1+1 1 - 12: Month
F1+2 1 - 31: Day
F1+3 0 - 23: Hour
F1+4 0 - 59: Minute
F1+5 0 - 59: Second
Data format for [F1]
F2 0: DEC
1: BCD
Example
The calendar data in $u200 - $u205 in DEC format, 17 (hour):25 (minutes):10
(seconds) on June 10 in 2010, is converted to the GMT-based UNIX time, and the
converted result is stored in $u100 and $u101.
$u200 = 2010 (W)
$u201 = 6 (W)
$u202 = 10 (W)
$u203 = 17 (W)
$u204 = 25 (W)
$u205 = 10 (W)
$u300 = 0 (W)
CLND_TO_GRE $u100 $u200 $u300
The GMT-based UNIX time “1276190710 seconds” is obtained.
Time data 0 $u100 = 8182 DEC
Time data 1 $u101 = 19473 DEC
4-51
Conversion
Supplemental remarks
• The result of macro execution is stored in $s1057.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
Restrictions
• When setting a numerical data display to show the converted result of
calendar data, 3 (hour):14 (minutes):7 (seconds) on January 19, 2038 or after,
enable the display to show 2-word long data without sign.
• This macro handles any year divisible by 4 as a leap year. For example, the
year 2100 is recognized as a leap year though it is not so. Therefore, an error
of one day will result.
• The calendar data displayable on the V9 unit ranges from January 1, 2012 to
January 19, 2038. Any data outside this range cannot be converted with this
macro correctly.
4-52
Conversion
GRE_TO_CLND GRE_TO_CLND F0 F1 F2
Setting range
Value
F0 4 digits: Year
F0+1 1 - 12: Month
F0+2 1 - 31: Day
F0+3 0 - 23: Hour
F0+4 0 - 59: Minute
F0+5 0 - 59: Second
0: Sunday
1: Monday
2: Tuesday
F0+6 3: Wednesday
4: Thursday
5: Friday
6: Saturday
F1 Time data 0 DEC only
Time data 1 Time data 0
F1+1 Time data 1
GMT-based UNIX time from January 1, 1970
4-53
Conversion
Example
The GMT-based UNIX time, 1278663500 seconds, in $u200 is converted to the
calendar data in DEC format, and the converted result is stored in $u100 and after.
GRE_TO_CLND $u100 $u200 0
The calendar data, “8 (hour):18 (minutes):20 (seconds) on Friday on July 9, 2010,”
is obtained.
Year $u100 = 2010 DEC
Month $u101 = 7 DEC
Day $u102 = 9 DEC
Hour $u103 = 8 DEC
Minutes $u104 = 18 DEC
Seconds $u105 = 20 DEC
Day of the week $u106 = 5 DEC
Supplemental remarks
• The result of macro execution is stored in $s1057.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
Restrictions
• This macro handles any year divisible by 4 as a leap year. For example, the
year 2100 is recognized as a leap year though it is not so. Therefore, an error
of one day will result.
• The calendar data displayable on the V9 unit ranges from January 1, 2012 to
January 19, 2038. Any data outside this range cannot be converted with this
macro correctly.
4-54
Conversion
FORMAT_DATA FORMAT_DATA F0 F1 F2
Setting range
Value Remarks
F0 Target memory: BIN data The number of words depends on [F2+1] (data length).
The number of bytes depends on [F2+3] (character
count).
F1 Source memory: String (ASCII code)
32 bytes maximum (16 words)
Character processing LSB MSB fixed
0: DEC without sign (decimal) Format for [F1]
1: DEC with a negative sign If “DEC with a negative sign” or “FLOAT” is selected for
(decimal) [F2] for the conversion of a positive value, add a space
2: DEC with a positive/negative sign code (20H) to the leftmost position of the positive value.
F2 (decimal) Otherwise, an error will result.
3: HEX (hexadecimal) A space code is not included in the number of digits.
4: OCT (octal) Example:
5: BIN (binary) For a string “123” to be converted, add a space to make it
6: FLOAT (real number) as “ 123”.
0: 1 word Data length for [F0]
F2+1
1: 2 words If “FLOAT” is selected for [F2], specify “0”.
Data format for [F0]
0: DEC
F2+2 If “HEX,” “OCT,” “BIN,” or “FLOAT” is selected for [F2],
1: BCD
specify “0”.
Number of digits for [F1]
A positive/negative sign and a decimal point are not
1 - 32: [F2] = 0, 1, 2, 5, or 6
included in the number of digits.
F2+3 1 - 8: [F2] = 3
Example:
1 - 11: [F2] = 4
For a string “12.3” to be converted, the number of digits
is three.
Decimal place for [F1]
0 - 10: [F2] = 0, 1, or 2 Example:
F2+4
0 - 31: [F2] = 6 For a string “12.34” to be converted, specify two decimal
places.
0: With zero suppress
F2+5 Format for [F1]
1: Without zero suppress
4-55
Conversion
Value Remarks
Format for [F1]
When a value in [F1] includes leading spaces, specify “0”.
Valid only when F2+5 = 0 When a value in [F1] includes trailing spaces, specify “1”.
F2+6 0: Leading spaces removed Example:
1: Trailing spaces removed 0: 12 12
1: 12 12
F2+7 0 fixed
Example
The string in $u100 is converted to the numerical data, and the converted result is
stored in $u300.
• String “1234”: DEC without sign
Display
$u100 3 2 3 1 HEX “12”
$u101 3 4 3 3 HEX “34”
FORMAT_DATA
• String “12.34”: A positive value in DEC with a negative sign format and with
two decimal places
$u00100 = ‘ 12.34’ (STRING)
; (For a positive value, add a space code 20H to the leftmost position.)
$u00200 = 1 (W) [DEC with a negative sign]
$u00201 = 0 (W) [1 word]
$u00202 = 0 (W) [DEC]
$u00203 = 4 (W) [4 digits]
$u00204 = 2 (W) [Two decimal places]
$u00205 = 0 (W) [With zero suppress]
$u00206 = 0 (W) [Leading spaces removed]
$u00207 = 0 (W) [0 fixed]
FORMAT_DATA $u00300 $u00100 $u00200
The result “1234” is stored in $u300.
4-56
Conversion
• String “12.34”: A negative value in DEC with a negative sign format and with
two decimal places
$u00100 = ‘12.34’ (STRING)
$u00200 = 1 (W) [DEC with a negative sign]
$u00201 = 0 (W) [1 word]
$u00202 = 0 (W) [DEC]
$u00203 = 4 (W) [4 digits]
$u00204 = 2 (W) [Two decimal places]
$u00205 = 0 (W) [With zero suppress]
$u00206 = 0 (W) [Leading spaces removed]
$u00207 = 0 (W) [0 fixed]
FORMAT_DATA $u00300 $u00100 $u00200
The result “1234” is stored in $u300.
• String “001234”: DEC without sign format and without zero suppress
$u00100 = ‘001234’ (STRING)
$u00200 = 0 (W) [DEC without sign]
$u00201 = 0 (W) [1 word]
$u00202 = 0 (W) [DEC]
$u00203 = 6 (W) [6 digits]
$u00204 = 0 (W) [Without decimal point]
$u00205 = 1 (W) [Without zero suppress]
$u00206 = 0 (W) [Leading spaces removed]
$u00207 = 0 (W) [0 fixed]
FORMAT_DATA $u00300 $u00100 $u00200
The result “1234” is stored in $u300.
• String “ 1234”: DEC without sign format and with two leading spaces
$u00100 = ‘ 1234’ (STRING)
$u00200 = 0 (W) [DEC without sign]
$u00201 = 0 (W) [1 word]
$u00202 = 0 (W) [DEC]
$u00203 = 6 (W) [6 digits]
$u00204 = 0 (W) [Without decimal point]
$u00205 = 0 (W) [With zero suppress]
$u00206 = 0 (W) [Leading spaces removed]
$u00207 = 0 (W) [0 fixed]
FORMAT_DATA $u00300 $u00100 $u00200
The result “1234” is stored in $u300.
4-57
Conversion
• String “1234 ”: DEC without sign format and with two trailing spaces
$u00100 = ‘1234 ’ (STRING)
$u00200 = 0 (W) [DEC without sign]
$u00201 = 0 (W) [1 word]
$u00202 = 0 (W) [DEC]
$u00203 = 6 (W) [6 digits]
$u00204 = 0 (W) [Without decimal point]
$u00205 = 0 (W) [With zero suppress]
$u00206 = 1 (W) [Trailing spaces removed]
$u00207 = 0 (W) [0 fixed]
FORMAT_DATA $u00300 $u00100 $u00200
The result “1234” is stored in $u300.
Supplemental remarks
• If “HEX” is specified as an attribute for conversion, characters “A” - “F” of the
source data is not case-sensitive.
• If this macro, with “FLOAT” specified as an attribute, results in underflow, “0” is
obtained as the converted result.
• Conversion with this macro is in the order of LSB MSB.
• The following PLCs provided with PLC-specific data format are capable of
handling negative values in BCD with a sign format. When you run this macro
using such a value with any of these PLCs, the internal memory is not valid for
[F0]. Therefore, be sure to assign the PLC memory (specific to the PLC
model) to [F0].
- Fuji Electric: All of the MICREX-F series
- Yaskawa: Memobus [Trans. Mode: Type 1]
- Omron: All [Transmission Mode 2]
• The result of macro execution is stored in $s1057.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-58
Conversion
FORMAT_STR FORMAT_STR F0 F1 F2
FORMAT_STR
Setting range
Value Remarks
The number of bytes depends on [F2+3] (character
Target device memory: String (ASCII count).
F0
code) 32 bytes maximum (16 words)
Character processing LSB MSB fixed
F1 Source device memory: BIN data The number of words depends on [F2+1] (data length).
0: DEC without sign (decimal)
Format for [F1]
1: DEC with a negative sign
If “DEC with a negative sign” or “FLOAT” is selected for
(decimal)
[F2] and the converted result is a positive value, a space
2: DEC with a positive/negative sign
code (20H) is added to the leftmost position of the
F2 (decimal)
positive value.
3: HEX (hexadecimal)
Example:
4: OCT (octal)
For numerical data “123” to be converted, a space is
5: BIN (binary)
added to provide a converted result as “ 123”.
6: FLOAT (real number)
0: 1 word Data length for [F1]
F2+1
1: 2 words If “FLOAT” is selected for [F2], specify “0”.
Data format for [F1]
0: DEC
F2+2 If “HEX,” “OCT,” “BIN,” or “FLOAT” is selected for [F2],
1: BCD
specify “0”.
Number of digits for [F0]
A positive/negative sign and a decimal point are not
included in the number of digits.
1 - 32: [F2] = 0, 1, 2, 5, or 6 If the number of digits specified for [F2+3] is smaller than
F2+3 1 - 8: [F2] = 3 that of the converted string, the result is given as a
1 - 11: [F2] = 4 hyphen “-”.
Example:
For a string “-12.3” as the converted result, the number of
digits is three.
Decimal place for [F0]
0 - 10: [F2] = 0, 1, or 2 Example:
F2+4
0 - 31: [F2] = 6 For a string “12.34” as the converted result, the number
of digits is four and two decimal places are given.
4-59
Conversion
Value Remarks
Format for [F0]
0: With zero suppress Select whether to execute zero suppress.
F2+5
1: Without zero suppress Example:
For a string “00012” as the converted result, specify “1”.
Format for [F0]
When a value in [F0] includes leading spaces, specify “0”.
Valid only when F2+5 = 0 When a value in [F1] includes trailing spaces, specify “1”.
F2+6 0: Leading spaces added Example:
1: Trailing spaces added 0: 12 12
1: 12 12
F2+7 0 fixed
Example
The numerical data in $u100 is converted to a string according to the specified
attributes, and the converted result is stored in $u300.
• Numerical data “1234”: DEC without sign
Display
$u100 1234 “1234”
FORMAT_STR
• Numerical data “1234”: DEC without sign format and with zero suppress and
leading spaces
$u00100 = 1234 (W)
$u00200 = 0 (W) [DEC without sign]
$u00201 = 0 (W) [1 word]
$u00202 = 0 (W) [DEC]
$u00203 = 6 (W) [6 digits]
$u00204 = 0 (W) [Without decimal point]
$u00205 = 0 (W) [With zero suppress]
$u00206 = 0 (W) [Leading spaces added]
$u00207 = 0 (W) [0 fixed]
FORMAT_STR $u00300 $u00100 $u00200
The result “ 1234” is stored in $u300 to $u302.
4-60
Conversion
• Numerical data “1234”: DEC without sign format and with zero suppress and
trailing spaces
$u00100 = 1234 (W)
$u00200 = 0 (W) [DEC without sign]
$u00201 = 0 (W) [1 word]
$u00202 = 0 (W) [DEC]
$u00203 = 6 (W) [6 digits]
$u00204 = 0 (W) [Without decimal point]
$u00205 = 0 (W) [With zero suppress]
$u00206 = 1 (W) [Trailing spaces added]
$u00207 = 0 (W) [0 fixed]
FORMAT_STR $u00300 $u00100 $u00200
The result “1234 ” is stored in $u300 to $u302.
• Numerical data “1234”: DEC without sign format and without zero suppress
$u00100 = 1234 (W)
$u00200 = 0 (W) [DEC without sign]
4
$u00201 = 0 (W) [1 word]
$u00202 = 0 (W) [DEC]
$u00203 = 6 (W) [6 digits]
$u00204 = 0 (W) [Without decimal point]
$u00205 = 1 (W) [Without zero suppress]
$u00206 = 0 (W) [Leading spaces added]
$u00207 = 0 (W) [0 fixed]
FORMAT_STR $u00300 $u00100 $u00200
The result “001234” is stored in $u300 to $u302.
• Numerical data “12.34”: DEC with a negative sign format and with two decimal
places
$u00100 = 1234 (W)
$u00200 = 1 (W) [DEC with a negative sign]
$u00201 = 0 (W) [1 word]
$u00202 = 0 (W) [DEC]
$u00203 = 4 (W) [4 digits]
$u00204 = 2 (W) [Two decimal places]
$u00205 = 0 (W) [With zero suppress]
$u00206 = 0 (W) [Leading spaces added]
$u00207 = 0 (W) [0 fixed]
FORMAT_STR $u00300 $u00100 $u00200
The result “ 12.34” is stored in $u300 to $u302.
(For a positive value, a space code 20H is added to the leftmost position.)
4-61
Conversion
Supplemental remarks
• Conversion with this macro is in the order of LSB MSB.
• A NULL code is added to the end of the string as a result of conversion. Even-
number-byte string thereby uses one extra word.
• The following PLCs provided with PLC-specific data format are capable of
handling negative values in BCD with a sign format. When you run this macro
using such a value with any of these PLCs, the internal memory is not valid for
[F1]. Therefore, be sure to assign the PLC memory (specific to the PLC
model) to [F1].
- Fuji Electric: All of the MICREX-F series
- Yaskawa: Memobus [Trans. Mode: Type 1]
- Omron: All [Transmission Mode 2]
• The result of macro execution is stored in $s1057.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-62
Transfer
4.8 Transfer
WORD DWORD
F1 F0 F1+1 F1 F0+1 F0
MOV MOV
Setting range
WORD DWORD
F0 0000 - FFFF 00000000 - FFFFFFFF
F1 (HEX) (HEX)
Example
• $u100 = PLC1 [D200] (W)
D200 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 BIN
0 1 0 0 HEX
MOV
$u100 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 BIN
0 1 0 0 HEX
MOV
Supplemental remarks
• The result of macro execution is stored in $s1057.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-63
Transfer
DWORD
1 F1 1 F0 1 F1 1 F0
2 F1+1 2 F0+1
3 F1+2 2 F0+1 2 F1+1 3 F0+2
BMOV BMOV
: : : : : : : :
F2 F1+(F2-1) F2/2 F0+(F2/2) F2/2 F1+(F2/2-1) F2 F0+(F2-1)
Internal device Double-word Double-word Internal device
memory device memory device memory memory
Setting range
WORD DWORD
F0 0000 - FFFF 00000000 - FFFFFFFF
F1 (HEX) (HEX)
F2 0 - 4096 0 - 4096
Example
• $u100 = PLC1 [D200] C : 3 (BMOV) (W)
4-64
Transfer
4
1:#C101 77775555 HEX $u102 5555 HEX
$u103 7777 HEX
Double-word device memory Internal device memory
Supplemental remarks
• If [ Permit Double-Word Transfer by BMOV] is not checked on the [General
Settings] tab window ([System Setting] [Unit Setting] [General Settings]),
DWORD cannot be selected.
If BMOV in double-word device memory is executed though the option is not
checked, the following results:
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-65
Transfer
WORD
1 F1 F0
2 F1+1 F0+1
3 F1+2 F0+2
CVMOV
: : :
F2 F1+(F2-1) F0+(F2-1)
DWORD
1 F1 1 F0 1 F1 1 F0
2 F1+1 2 F0+1
3 F1+2 2 F0+1 2 F1+1 3 F0+2
CVMOV CVMOV
: : : : : : : :
F2 F1+(F2-1) F2/2 F0+(F2/2) F2/2 F1+(F2/2-1) F2 F0+(F2-1)
Internal device Double-word Double-word Internal device
memory device memory device memory memory
Setting range
WORD DWORD
F0 0000 - FFFF 00000000 - FFFFFFFF
F1 (HEX) (HEX)
F2 0 - 4096 0 - 4096
4-66
Transfer
Example
Refer to the operation example applicable to your PLC model. If any PLC other
than listed blow is in use, the operation identical to the BMOV command takes
place.
S5 PG Port*
Setting] tab window
4
S7
Siemens S7-200PPI 1
S7-300/400MPI
TI500/505
[Transmission Mode: Type
Yaskawa Memobus 1] in the [Communication 2
Setting] tab window
Device selection
Remarks Operation
(temperature controller / servo / inverter)
IAI PCON/ACON/SCON(MODBUS RTU) 1
4-67
Transfer
In the case of DWORD, a swap between the higher-order word and the
lower-order word takes place.
BMOV CVB
DEC (HEX) DEC (HEX)
$u100 +256 (0100) $u100 +100 (0064)
$u101 -32512 (8100) $u101 -100 (FF9C)
$u102 -26215 (9999) $u102 -1999 (F831)
CVP BMOV
DEC (HEX) BCD (HEX)
$u101 $u100 -2147483647 (80000001) BD100 -1 (80000001)
Supplemental remarks
• The result of macro execution is stored in $s1057.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-68
Transfer
Setting range
Value Remarks
F0 102 bytes maximum
F0+1 Text (Varies depending on the bytes of
: the text)
Example
• When the [Communication Setting] [Text Process] setting for the PLC that
is the transfer destination (PLC3) is [MSB LSB]:
- PLC3 [D100] = $u100 C : 8 (CVSMOV) (W)
$u100 7 4 7 3 HEX ts
$u101 6 9 7 2 HEX ir
$u102 6 7 6 E HEX gn
$u103 0 0 0 0 HEX Null code
CVSMOV
D100 7 3 7 4 HEX ts
D101 7 2 6 9 HEX ir
D102 6 E 6 7 HEX gn
D103 0 0 0 0 HEX Null code
4-69
Transfer
Supplemental remarks
• A null code is added to the end. Even-number-byte text thereby uses one
extra word.
• The result of macro execution is stored in $s1057.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-70
Transfer
FILL F0 = F1 C : F2 (FILL)
F1 F0 1
F0+1 2
F0+2 3
FILL
: :
F0+(F2-1) F2
Setting range
WORD
F0 0000 - FFFF
F1 (HEX)
F2 0 - 4096
Example
• $u100 = $u200 C : 3 (FILL)
$u200 20 $u100 20
$u101 20
FILL
$u102 20
Supplemental remarks
• When a PLC device memory address is specified for [F0], code conversion is
not performed.
• The result of macro execution is stored in $s1057.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-71
Comparison
4.9 Comparison
Conditions
Symbol Contents
== Equal
!= Different
< Less than
> Greater than
<= Less than or equal to
>= Greater than or equal to
Setting range
WORD DWORD
F0 0000 - FFFF 00000000 - FFFFFFFF
F1 (HEX) (HEX)
F2 0 - 127 0 - 127
Example
• IF ($u100 == 500) LB 0 (W)
RET
LB0
:
If $u100 = 500, a jump to LB0 (label 0) takes place and then macro execution
proceeds to the next line.
If $u100 500, macro execution proceeds to the next line. In this example,
RET terminates the macro.
4-72
Comparison
Supplemental remarks
• A label (LB) must be specified as the jump target. If no label exists, “Error: 83”
(no destination label for the jump) occurs as a result of an error check on
MONITOUCH.
• The result of macro execution is stored in $s1058.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-73
Comparison
Conditions
Conditions Contents
ZERO 0
NON ZERO Other than 0
Setting range
WORD DWORD
F0 0000 - FFFF 00000000 - FFFFFFFF
F1 (HEX) (HEX)
F2 0 - 127 0 - 127
Example
• IFNZ ($u100 & 8000H) LB0 (W)
RET
LB0
:
If bit 15 at $u100 is set (ON), a jump to LB0 (label 0) takes place and then
macro execution proceeds to the next line.
If bit 15 at $u100 is reset (OFF), macro execution proceeds to the next line. In
this example, RET terminates the macro.
Supplemental remarks
• A label (LB) must be specified as the jump target. If no label exists, “Error: 83”
(no destination label for the jump) occurs as a result of an error check on
MONITOUCH.
• The result of macro execution is stored in $s1058.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-74
Comparison
Condition 1 Condition 2
Symbol Contents Symbol Contents
== Equal ZERO 0
!= Different NON ZERO Other than 0
< Less than
> Greater than
<= Less than or equal to
>= Greater than or equal to
Setting range
WORD DWORD BIT
F0 32768 - +32767 2147483648 - +2147483647 0, 1
F1 (Decimal system with signs) (Decimal system with signs) -
Example
• For WORD comparison
IF ($u100 < 10) (W)
$u100 = $u100 + 1 (W)
ELSE
$u100 = 0 (W)
ENDIF
“$u100 = $u100 + 1” is executed when $u100 is smaller than 10. When $u100
is 10 or more, “$u100 = 0” is executed.
4-75
Comparison
Restrictions
• IF-ELSE-ENDIF commands can be nested up to 8 levels.
Supplemental remarks
• An error occurs to the macro editor when any of the following conditions is
met.
1. When IF-ELSE-ENDIF commands are nested beyond 8 levels;
Ex.: IF ($u100 > 0)
IF ($u100 < 10) There are 9 or more IF commands between
IF-ENDIF commands.
:
IF ($u200 == 1)
ENDIF
2. When the number of IF commands is not the same as the one of ENDIF
commands;
Ex.: IF ($u100 == 0) There are two IF commands while there is
one ENDIF command.
IF ($u100 == 0)
ENDIF
3. When the number of IF commands is not the same as the one of ELSE
commands;
Ex.: IF ($u100 == 0)
ELSE There is one IF command while there are
two ELSE commands.
ELSE
ENDIF
*1 Select [System Setting] [Unit Setting] [Environment Setting], and check [Store
the result as normal upon successful completion of macro execution]. When this box
is not checked, the value will not be updated even if execution of the macro is
successfully completed. (Under development)
*2 When reading from [F0] and [F1] ends in failure, an error occurs and “1” is stored in
$s1059.
When an execution error occurs, it is regarded as a fault.
4-76
Macro Operation Control
CALL CALL F0
Macro block
No.0
No.1
No.2
CALL F0 No.n
(F0=n) Execute
4
No.1023
Setting range
Value
F0 0 - 1023
Example
• CALL 5
No.0
No.1
No.2
CALL 5 No.5
Execute
No.1023
4-77
Macro Operation Control
Supplemental remarks
• If the macro block number called by CALL is not registered, an error check
triggers a warning.
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-78
Macro Operation Control
JMP JMP LB F0
Function: Unconditional jump
All models This macro command is used to execute a jump to the label specified in [F0].
---------
---------
---------
JMP F0
F0=n
---------
---------
---------
Not Execute
LB0 executed
-----------
4
----------
LB n
---------
Setting range
Value
F0 0 - 127
Example
• JMP LB5
---------
---------
---------
JMP 5
---------
---------
--------- Not Execute
LB0 executed
-----------
----------
LB 5
---------
Supplemental remarks
• A label (LB) must be specified as the jump target. If no label exists, error 83
(there is no destination label for the jump) will be detected by error check on
MONITOUCH.
• The result of macro execution is stored in $s1059.
Code (DEC) Contents
0* Normal
End in error (number of executed macro lines of 160001 or greater,
1
etc.)
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-79
Macro Operation Control
LABEL LB F0:
---------
---------
---------
JMP n
F0=n
---------
---------
--------- Not Execute
LB0 executed
-----------
----------
LB F0
---------
Setting range
Value
F0 0 - 127
Supplemental remarks
• A label (LB) must be specified as the jump target. If no label exists, error 83
(there is no destination label for the jump) will be detected by error check on
MONITOUCH.
• The result of macro execution is stored in $s1059.
Code (DEC) Contents
0* Normal
End in error (number of executed macro lines of 160001 or greater,
1
etc.)
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-80
Macro Operation Control
FOR/NEXT FOR F0
NEXT
All models
Function: FOR - NEXT
This macro command is used to execute a loop between FOR and NEXT the
number of times specified in [F0].
FOR F0
$u300 = $u300+5 The loop executes the number
NEXT of times specified in F0.
Setting range
Value
F0 0 - 65535
Example
$u300 = 0 (W)
$u301 = 0 (W)
FOR 3
$u300 = $u300 + 1 (W)
FOR $u400
If $u400 = 5, The loop is
$u301 = $u301 + 5 (W)
the loop is executed 3 times.
NEXT
executed 5 times.
NEXT
• Result
$u300 = 3
$u301 = 75
Supplemental remarks
• Loop between FOR and NEXT can be nested* up to 8 levels. Nesting beyond
8 levels triggers error 81 (macro: FOR-NEXT command number is wrong) as a
result of error check on MONITOUCH.
* Nesting means incorporating a FOR-NEXT loop into a loop of the same kind.
:
FOR 2
:
FOR 3
:
NEXT
:
NEXT
:
4-81
Macro Operation Control
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-82
Macro Operation Control
RET RET
Supplemental remarks
• In the case of a macro block called by CALL, RET executes a return to the
original sequence. 4
$u300 = 1 (W)
$u301 = 10 (W) Macro block No. 1
CALL1 $u200 = $u200 + 10 (W)
$u302 = 100 (W) RET
$u303 = 1000 (W)
4-83
Macro Operation Control
SWRET SWRET
Macro B Macro B
Macro B Macro B
Switch function
Example
• In a case where a macro runs based on the result written by the ENT key (in
the entry mode) to the entry target D200, executing the switch function (for
writing) by SWRET is required.
D200 1234
7 8 9 UP
4 5 6 DW
1 2 3 +-
0 . CLR CR ON Macro
SWRET Function: Write
IF D200>10 LB0 (W)
:
Supplemental remarks
• The macro command is valid in switch ON macros.
The command, however, is not executed normally in the following cases:
- SWRET exists in a macro block called by CALL.
- JMP or FOR-NEXT triggers a movement to a label before the execution of
SWRET.
ON Macro
Macro A Macro A
JMP
SWRET Switch function
FOR - NEXT
Macro B Macro B
4-84
Macro Operation Control
EN_INT EN_INT
Supplemental remarks
• If there is no switch processing pending, nothing happens in response to this
command.
4-85
FROM Backup
FROM_WR FROM_WR F0 F1
Setting range
Value
F0 Address in each device memory
F1 1 - 16384 (= 16k words)
Supplemental remarks
• When using the macro command, go to the [General Settings] tab window in
the [Unit Setting] dialog ([System Setting] [Unit Setting] [General
Settings]). On the window, check [ Use Internal Flash ROM as Back-up
Area].
* Checking this option reduces the available screen program capacity by 66 kbytes.
• Each FP-ROM allows 100,000 write operations.
(Each execution of FROM_WR is counted as one time, regardless of the
number of words.) It is thereby recommended that backup data be read after
power-on and be written before power-off.
• Do not execute FROM_WR in every cycle using a CYCLE macro, etc.
• Writing to FP-ROM takes three to five seconds.
• The result of macro execution is stored in $s728.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-86
FROM Backup
FROM_RD FROM_RD F0 F1
Supplemental remarks
• When using the macro command, go to the [General Settings] tab window in
the [Unit Setting] dialog ([System Setting] [Unit Setting] [General
Settings]). On the window, check [ Use Internal Flash ROM as Back-up
Area].
* Checking this option reduces the available screen program capacity by 66 kbytes.
• Do not execute FROM_RD in every cycle using a CYCLE macro, etc.
• The result of macro execution is stored in $s728.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-87
PLC
4.12 PLC
Setting range
Value
0: Calendar reading *1
1: Calendar writing
F0
(specified by user) *2
2: Calendar writing (by the system) *3
F1 2 - 8: PLC number
F2 0 - 31: PLC station number Invalid with 1:1 connections
Invalid with 1:1 connections
F2+1 0 - 255: PLC sub station number Only valid for PLCs with sub
station number designations
F3 0-: Year (4-digit/2-digit)
F3+1 1 - 12: Month
F3+2 1 - 31: Day
F3+3 0 - 23: Hour
F3+4 0 - 59: Minute
F3+5 0 - 59: Second
0: Sunday
Only valid with a read ([F0] =
1: Monday
0) setting
2: Tuesday
Invalid with a write ([F0] = 1
F3+6 3: Wednesday
or 2) setting because the
4: Thursday
calculation is done internally
5: Friday
in the unit
6: Saturday
* Details of calendar function specification
*1 When [F0] = 0: Calendar reading
When the connection method specified in [F1] is “1:1”, the calendar is read
for the connected device and the information is saved in the [F3] device
memory. (The contents in the [F2] device memory are ignored.)
When the connection method specified in [F1] is “1:n”, the calendar for the
connected device with the station number specified in [F2] or the sub station
number specified in [F2+1] is read and saved in the [F3] device memory.
The V series system calendar is not changed by any command. To change
the system calendar, use “ SYS (SET_SYS_CLND) F1” (page 4-213).
4-88
PLC
Supplemental remarks
• If the relevant equipment doesn’t incorporate a calendar, nothing happens in
response to the command. (The V series automatically judges whether or not
the equipment incorporates a calendar.)
• Nothing happens to the equipment whose link has been dead in response to
the command.
• The result of macro execution is stored in $s729.
Code (HEX) Contents
0* Normal
2004 A PLC [F1] communication error has occurred during processing.
FFFF Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-89
PLC
Setting range
Value
F0 1 - 8: PLC number
F1 0 - 31: PLC station number
F1+1 Command and others
The items to be set differ depending on the equipment. For more
: information, refer to the V9 Series Connection Manual.
F2 The number of words to be transferred
Example
• Bringing Omron’s E5ZN (station No. 1) connected to the PLC2 to a state of
RUN:
$u100 = 1 (W) [PLC station number]
$u101 = 30H (W) [Command]
$u102 = 100H (W) [Operation command (RUN)]
PLC_CTL PLC2 $u100 3
4-90
PLC
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-91
PLC
Setting range
Value
F0 Top address of the target
F1 1 - 8: PLC number
F2 0 - 31: Device memory map No.
Example
• Transferring the data of the addresses registered in device memory map No. 5
defined at PLC3 to $u500 onward
TBL_READ $u500 <- TABLE : PLC3 : 5
Supplemental remarks
• As many addresses as the data count set in the device memory map must be
allocated to the target memory, to which data will be transferred.
• The result of macro execution is stored in $s729.
Code (HEX) Contents
0* Normal
2001 The address set in the device memory map does not exist.
2002 The device memory cannot be allocated.
2004 A PLC [F1] communication error has occurred during processing.
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-92
PLC
Setting range
Value
F0 0 - 31: Device memory map No.
F1 1 - 8: PLC number
F2 Top memory address of the source
Example
• Transferring the data of $u500 onward to the addresses registered in device
memory map No. 5 defined at PLC3
TBL_WRITE TABLE : PLC3 : 5 <- $u00500
Supplemental remarks
• As many addresses as the data count set in the device memory map must be
allocated to the target memory, to which data will be transferred.
• The result of macro execution is stored in $s729.
Code (HEX) Contents
0* Normal
2001 The address set in the device memory map does not exist.
2002 The device memory cannot be allocated.
2004 A PLC [F1] communication error has occurred during processing.
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-93
Ethernet
4.13 Ethernet
Setting range
Value
F0 Top address of the source
F1 0 - 2000: The number of words to be transferred
F2 0 - 255: Transfer target (network table number)
Example
• SEND PLC2 [D10] C:2 TO:3
The above program transfers two words of data starting from D10 of PLC2:B
to network table No. 3 (server A).
<Server: A>
Application
Ethernet
D10 - D11
<PLC2:B>
Supplemental remarks
The following system devices are related to this command. For more information,
refer to the V9 Series Connection Manual.
Address Contents Remarks
$s514 The macro execution format (wait request) is set. V
$s515 The result of macro execution is stored. V
4-94
Ethernet
Setting range
Value
F0 Top address of the target
F1 Top address of the source
F2 0 - 2000: The number of words to be transferred
F3 0 - 255: Transfer source (network table number)
Example
• EREAD PLC1 [D200] = PLC1 [D100] C:2 5
The above program reads two words of data starting from D100 of PLC2:B,
which is connected to network table No. 5 (V series:B), into D200 onward of
PLC1:A.
Ethernet
<PLC1:A> <PLC1:B>
Supplemental remarks
The following system devices are related to this command. For more information,
refer to the V9 Series Connection Manual.
Address Contents Remarks
$s514 The macro execution format (wait request) is set. V
$s515 The result of macro execution is stored. V
4-95
Ethernet
Setting range
Value
F0 Top address of the target
F1 0 - 255: Transfer target (network table number)
F2 Top address of the source
F3 0 - 2000: The number of words to be transferred
Example
• EWRITE PLC1 [D100] 5 = $u100 C:2
The above program writes two words of data starting from $u100 of the V
series:A to D100 onward of PLC2:B which is connected to network table No. 5
(V series:B).
Ethernet
$u100 - 101
D100 - 101
<PLC1:A> <PLC1:B>
Supplemental remarks
The following system devices are related to this command. For more information,
refer to the V9 Series Connection Manual.
Address Contents Remarks
$s514 The macro execution format (wait request) is set. V
$s515 The result of macro execution is stored. V
4-96
Storage (Recipe)
LD_RECIPE LD_RECIPE F0 F1
Setting range
Value
F0 Transfer target address
F1 0000 - 9999: CSV file number
CSV file
Storage target: \(access folder)\RECIPE
File name: \RECxxxx.csv
The designation of the line and column numbers in a CSV file differs, depending
on the options selected for [Format Setting] ([Recipe] [File Format]). The
mark indicates the position of line No. 1 and column No. 1 in the CSV file.
Title
Add record
name
- Title
Add record Record
name Record
4-97
Storage (Recipe)
Example
• LD_RECIPE $u200 1
The data in the REC0001.csv file is transferred to the location starting from
$u200.
$u200 0
Data Management
$u201 1
$u202 2
$u203 3
$u204 4
$u205 5
$u206 6
$u207 10
$u208 11
$u209 12
$u210 13
$u211 14
SD EXT0000
$u212 15
$u213 16
MEMO $u214 100
RECIPE $u215 101
REC0000.csv $u216 102
$u217 103
REC0001.csv Transfers data
$u218 104
REC0002.csv in the CSV file.
$u219 105
LOGGING $u220 106
$u221 1000
$u222 1100
$u223 1200
$u224 1300
$u225 1400
$u226 1500
$u227 1600
$u228 10000
$u229 10001
$u230 10002
$u231 10003
$u232 10004
$u233 10005
$u234 10006
Supplemental remarks
• Recipe settings are required for each CSV file.
4-98
Storage (Recipe)
• For reading text, whether to convert a null to 20H (space) or read it as “00” can
be selected.
Go to the [General Setting] tab window in the [Unit Setting] dialog ([System
Setting] [Unit Setting] [General Settings]). On the tab window, check or
uncheck [ Convert NULL to Space with the LD/RD Macro].
Example:
A,B,
C,,
Execution result
4-99
Storage (Recipe)
LD_RECIPE2 LD_RECIPE2 F0 F1 F2
Setting range
Value
F0 Transfer target address
F1 0000 - 9999: CSV file number
F2 0 - 255: Recipe number
CSV file
Storage target: \(access folder)\RECIPE
File name: \RECxxxx.csv
The designation of the line and column numbers in a CSV file differs, depending
on the options selected for [Format Setting] ([Recipe] [File Format]). The
mark indicates the position of line No. 1 and column No. 1 in a CSV file.
Title
Add record
name
- Title
Add record Record
name Record
4-100
Storage (Recipe)
Example
• LD_RECIPE2 $u100 2 0
The above program transfers the data in the file “REC0002.csv” in the format
of recipe No. 0 to the location starting from $u100.
$u100 1
Data
$u101 10
$u102 100
$u103 1000
$u104 −1
$u105 2
$u106 20
$u107 200
$u108 2000
$u109 −2
$u110
$u111
3
30
4
SD EXT0000 300
$u112
RECIPE $u113 3000
Transfers data in $u114 −3
REC0000.csv the CSV file.
$u115 4
REC0001.csv
$u116 40
REC0002.csv 400
$u117
LOGGING $u118 4000
$u119 −4
$u120 5
$u121 50
$u122 500
$u123 5000
$u124 −5
Supplemental remarks
• Recipe settings must be made in the same format as the CSV file.
Recipe No. 0
• For reading text, whether to convert a null to 20H (space) or read it as “00” can
be selected. For more information, refer to page 4-99.
• The result of macro execution is stored in $s1062.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-101
Storage (Recipe)
LD_RECIPESEL LD_RECIPESEL F0 F1
Setting range
Value
Line: Record, Column: Data Line: Data, Column: Record
F0 Transfer source address
F1 0000 - 9999: CSV file number
F1+1 1 - 32767: Top line number 1 - 4096: Top line number
F1+2 0* - 4096: Top column number 0* - 4096: Top column number
F1+3 1 - 32767: Number of lines 1 - 4096: Number of lines
F1+4 1 - 4096: Number of columns 1 - 4096: Number of columns
* Specify “0” if you wish to transfer the record name as well. In that case, select
[Record Name + Data] for [Transfer Target] under [Transfer Device Setting]
([Recipe] [File Format]) The number of columns specified in F1+4 includes
the cell of the record name.
CSV file
Storage target: \(access folder)\RECIPE
File name: \RECxxxx.csv
The designation of the line and column numbers in a CSV file differs, depending
on the options selected for [Format Setting] ([Recipe] [File Format]). The
mark indicates the position of line No. 1 and column No. 1 in a CSV file.
Title
Add record
name
- Title
Add record Record
name Record
4-102
Storage (Recipe)
Example
• $u100 = 1 (W) [File number 1]
$u101 = 2 (W) [Top line number]
$u102 = 3 (W) [Top column number]
$u103 = 2 (W) [Number of lines]
$u104 = 3 (W) [Number of columns]
LD_RECIPESEL $u300 $u100
The above program transfers part of the data in the REC0001.csv file to the
location starting from $u300.
$u300 12
Data Manegement
$u301 13
$u302 14
$u303
$u304
102
103
4
$u305 104
SD Transfers part of
EXT0000 the CSV file
MEMO
RECIPE Column No. (3 or above)
REC0000.csv
REC0001.csv Line No.
(2 or
REC0002.csv
above)
LOGGING
Supplemental remarks
• Attribute setting is required for each CSV file.
• For reading text, whether to convert a null to 20H (space) or read it as “00” can
be selected. For more information, refer to page 4-99.
4-103
Storage (Recipe)
Reading one line and two Reading one line and two
columns from top line No. 2 and columns from top line No. 2 and
top column No.2 top column No.2
Reading two lines and two Reading two lines and two
columns from top line No. 2 and columns from top line No. 2 and
top column No. 2 top column No. 2
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-104
Storage (Recipe)
LD_RECIPESEL2 LD_RECIPESEL2 F0 F1 F2
All models Function: Read CSV file (in units of a cell/recipe No. designation)
This macro command is used to transfer a part of data in the CSV file number [F1]
in the format of the recipe number [F2] to the location starting from the address
[F0].
Setting range
Value
Line: Record, Column: Data Line: Data, Column: Record
F0 Transfer target address
F1 0000 - 9999: CSV file number
F1+1 1 - 32767: Top line number 1 - 4096: Top line number
F1+2 0* - 4096: Top column number 0* - 4096: Top column number
F1+3 1 - 32767: Number of lines 1 - 4096: Number of lines
F1+4 1 - 4096: Number of columns 1 - 4096: Number of columns
F2 0 - 255: Recipe number
* Specify “0” if you wish to transfer the record name as well. In that case, select
[Record Name + Data] for [Transfer Target] under [Transfer Device Setting]
([Recipe] [File Format]) The number of columns specified in F1+4 includes
the cell of the record name.
CSV file
Storage target: \(access folder)\RECIPE
File name: \RECxxxx.csv
The designation of the line and column numbers in a CSV file differs, depending
on the options selected for [Format Setting] ([Recipe] [File Format]). The
mark indicates the position of line No. 1 and column No. 1 in a CSV file.
Title
Add record
name
- Title
Add record Record
name Record
4-105
Storage (Recipe)
Example
• $u100 = 2 (W) [File number]
$u101 = 1 (W) [Top line number]
$u102 = 1 (W) [Top column number]
$u103 = 1 (W) [Number of lines]
$u104 = 5 (W) [Number of columns]
LD_RECIPESEL2 $u500 $u100 0
The above program transfers a part of data in the file “REC0002.csv” in the
format of recipe No. 0 to the location starting from $u500.
Data
$u500 1
$u501 10
$u502 100
$u503 1000
$u504 −1
SD EXT0000
Transfers part of
MEMO
the CSV file
RECIPE
REC0000.csv
REC0001.csv
REC0002.csv
LOGGING
4-106
Storage (Recipe)
Supplemental remarks
• Recipe settings must be made in the same format as the CSV file.
Recipe No. 0
4
• For reading text, whether to convert a null to 20H (space) or read it as “00” can
be selected. For more information, refer to page 4-99.
• Difference between reading one line and reading multiple lines
Reading one line and two Reading one line and two
columns from top line No. 2 and columns from top line No. 2 and
top column No. 2 top column No. 2
Reading two lines and two Reading two lines and two
columns from top line No. 2 and columns from top line No. 2 and
top column No. 2 top column No. 2
4-107
Storage (Recipe)
4-108
Storage (Recipe)
SV_RECIPE SV_RECIPE F0 F1 F2
Setting range
Value
F0 Transfer source address
F1 1 - 4096: Word count
F2 0000 - 9999: CSV file number
CSV file
Storage target: \(access folder)\RECIPE
File name: \RECxxxx.csv
The designation of the line and column numbers in a CSV file differs, depending
on the options selected for [Format Setting] ([Recipe] [File Format]). The
mark indicates the position of line No. 1 and column No. 1 in a CSV file.
Title
Add record
name
- Title
Add record Record
name Record
4-109
Storage (Recipe)
Example
• SV_RECIPE $u500 5 2
The above program saves the five-word data at $u500 - 504 to the
REC0002.csv file.
SD EXT0000
Saves the data in
the internal
MEMO device memory
RECIPE to the CSV file
REC0000.csv
REC0001.csv
REC0002.csv
LOGGING
Supplemental remarks
• Recipe settings are required for each CSV file.
• If the specified CSV file does not exist in the storage, a new file will be
created. Creating the CSV file in advance is not necessary.
• The result of macro execution is stored in $s1062.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-110
Storage (Recipe)
SV_RECIPE2 SV_RECIPE2 F0 F1 F2 F3
Setting range
Value
F0 Transfer source address
F1 1 - 4096: Word count
F2 0000 - 9999: CSV file number
F3 0 - 255: Recipe number
CSV file
Storage target: \(access folder)\RECIPE
File name: \RECxxxx.csv
The designation of the line and column numbers in a CSV file differs, depending
on the options selected for [Format Setting] ([Recipe] [File Format]). The
mark indicates the position of line No. 1 and column No. 1 in a CSV file.
Title
Add record
name
- Title
Add record Record
name Record
4-111
Storage (Recipe)
Example
• SV_RECIPE2 PLC1 [D400] 10 9999 0
The above program saves the ten-word data at D400 - 409 in PLC1 to the file
“REC9999.csv” in the format of recipe No. 0.
Data
D400 55
D401 66
D402 77
D403 88
D404 99
D405 1111
D406 2222
D407 3333
D408 4444
D409 5555
SD EXT0000
Supplemental remarks
• Recipe settings must be made in the same format as the CSV file.
Recipe No. 0
• If the specified CSV file does not exist in the storage, a new file will be
created. Creating the CSV file in advance is not necessary.
• The result of macro execution is stored in $s1062.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-112
Storage (Recipe)
SV_RECIPESEL SV_RECIPESEL F0 F1
Setting range
4
Value
Line: Record, Column: Data Line: Data, Column: Record
F0 Transfer source address
F1 0000 - 9999: CSV file number
F1+1 1 - 32767: Top line number 1 - 4096: Top line number
F1+2 0* - 4096: Top column number 0* - 4096: Top column number
F1+3 1 - 4096: Number of lines 1 - 4096: Number of lines
F1+4 1 - 4096: Number of columns 1 - 4096: Number of columns
* Specify “0” if you wish to transfer the record name as well. In that case, select
[Record Name + Data] for [Transfer Target] under [Transfer Device Setting]
([Recipe] [File Format]) The number of columns specified in F1+4 includes
the cell of the record name.
CSV file
Storage target: \(access folder)\RECIPE
File name: \RECxxxx.csv
The designation of the line and column numbers in a CSV file differs, depending
on the options selected for [Format Setting] ([Recipe] [File Format]). The
mark indicates the position of line No. 1 and column No. 1 in a CSV file.
Title
Add record
name
- Title
Add record Record
name Record
4-113
Storage (Recipe)
Example
• $u100 = 0 (W) [File number]
$u101 = 3 (W) [Top line number]
$u102 = 1 (W) [Top column number]
$u103 = 1 (W) [Number of lines]
$u104 = 2 (W) [Number of columns]
SV_RECIPESEL $u300 $u100
The above program saves the data at the location starting from $u300 to line
No. 3 in the REC0000.csv file.
Data $u300 ZY
$u301 XW
$u302 VU
$u303 TS
$u304 AB
$u305 CD
$u306 EF
$u307 GH
SD EXT0000
Saves the values in
MEMO
the device memory to
RECIPE the CSV file
REC0000.csv
LOGGING
Saves to the
specified line/
column
Supplemental remarks
• Recipe settings are required for each CSV file.
4-114
Storage (Recipe)
• If the specified CSV file does not exist in the storage, a new file will be
created. Creating the CSV file in advance is not necessary.
• The result of macro execution is stored in $s1062.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-115
Storage (Recipe)
SV_RECIPESEL2 SV_RECIPESEL2 F0 F1 F2
Setting range
Value
Line: Record, Column: Data Line: Data, Column: Record
F0 Transfer source address
F1 0000 - 9999: CSV file number
F1+1 1 - 32767: Top line number 1 - 4096: Top line number
F1+2 0* - 4096: Top column number 0* - 4096: Top column number
F1+3 1 - 32767: Number of lines 1 - 4096: Number of lines
F1+4 1 - 4096: Number of columns 1 - 4096: Number of columns
F2 0 - 255: Recipe number
* Specify “0” if you wish to transfer the record name as well. In that case, select
[Record Name + Data] for [Transfer Target] under [Transfer Device Setting]
([Recipe] [File Format]) The number of columns specified in F1+4 includes
the cell of the record name.
CSV file
Storage target: \(access folder)\RECIPE
File name: \RECxxxx.csv
The designation of the line and column numbers in a CSV file differs, depending
on the options selected for [Format Setting] ([Recipe] [File Format]). The
mark indicates the position of line No. 1 and column No. 1 in a CSV file.
Title
Add record
name
- Title
Add record Record
name Record
4-116
Storage (Recipe)
Example
• $u100 = 9000 (W) [File number]
$u101 = 2 (W) [Top line number]
$u102 = 1 (W) [Top column number]
$u103 = 1 (W) [Number of lines]
$u104 = 5 (W) [Number of columns]
SV_RECIPESEL2 $u300 $u100 0
The above program saves the data at the location starting from $u300 in the
format of recipe No. 3 to line No. 2 in the REC9000.csv file.
Data
4
$u300 444
$u301 444
$u302 444
$u303 444
SD EXT0000 $u304 444
MEMO
RECIPE
REC0000.csv
Writes data in the device
memory to the specified
REC9000.csv location in the CSV file.
LOGGING
Supplemental remarks
• Recipe settings must be made in the same format as the CSV file.
Recipe No. 0
• If the specified CSV file does not exist in the storage, a new file will be
created. Creating the CSV file in advance is not necessary.
• The result of macro execution is stored in $s1062.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-117
Storage (Recipe)
SET_ SET_RECIPEFOLDER F0
RECIPEFOLDER
Function: Folder designation
This macro command is used to designate the folder storing CSV files in [F0].
All models
Setting range
Value
F0
F0+1 ASCII code (8 one-byte upper-case alphanumeric characters):
F0+2 Access target folder name*
F0+3
* Text processing (LSB MSB or MSB LSB) for the folder name is
determined whether [Follow to the PLC1 setting for the text process in a recipe
file.] on the [General Settings] tab window that is displayed by [System
Setting] [Unit Setting] is checked or not.
Follow to the PLC1 setting for the Follow to the PLC1 setting for the
text process in a recipe file. text process in a recipe file.
Text processing specified for the PLC1 Fixed to “LSB MSB”
Example
• $u100 = 4154H (W) 54 41 52 47 45 54 = TARGET
$u101 = 4752H (W) (ASCII)
$u102 = 5445H (W)
$u103 = 0000H (W)
SET_RECIPEFOLDER $u100
4-118
Storage (Recipe)
• The CHR or STRING macro command will simplify the designation of a folder
if it is a fixed name.
- (When text processing is performed according to the setting on the PLC1:
use a “CHR” command.)
$u100 = ’TARGET’
SET_RECIPEFOLDER $u100
- (When “LSB MSB” is selected: use a “STRING” command.)
$u100 = ‘TARGET’ (STRING)
SET_RECIPEFOLDER $u100
Supplemental remarks
• Four consecutive words starting from the address in [F0] are used. Be sure
that these words are not already used elsewhere.
• Once the macro command is executed, the effect is maintained until any of the
following takes place.
- Turning off the power 4
- Switching the V series from a state of RUN to STOP (Local mode)
- Removing the storage device
Execute the macro command again after any of the above or if you access a
CSV file in a different folder.
• The result of macro execution is stored in $s1062.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-119
Storage (Recipe)
RD_RECIPE_FILE RD_RECIPE_FILE F0 F1
Setting range
Value
F0 Transfer target
F1
F1+1 ASCII code (8 one-byte upper-case alphanumeric characters):
F1+2 CSV file name*
F1+3
CSV file
Storage target: \(access folder)\RECIPE\(arbitrary folder)
File name: \xxxxxxxx.csv
The designation of the line and column numbers in a CSV file differs, depending
on the options selected for [Format Setting] ([Recipe] [File Format]). The
mark indicates the position of line No. 1 and column No. 1 in a CSV file.
Title
Add record
name
- Title
Add record Record
name Record
4-120
Storage (Recipe)
Example
• $u100 = ‘TARGET’ Not required if SET_FOLDER has
SET_RECIPEFOLDER $u100 already been executed
$u110 = 5250H (W)
$u111 = 444FH (W) 50 52 4F 44 55 43 54 31 = PRODUCT1
$u112 = 4355H (W) (ASCII)
$u113 = 3154H (W)
RD_RECIPE_FILE PLC1 [D200] $u110
The above program transfers all data in the PRODUCT1.csv file stored in the
TARGET folder to PLC1: D200.
Supplemental remarks
• Four consecutive words starting from the address in [F1] are used. Be sure
that these words are not already used elsewhere.
• If the CSV file specified in [F1] does not exist, a storage read error occurs
($s497 = 16).
4
• For reading text, whether to convert a null to 20H (space) or read it as “00” can
be selected. For more information, refer to page 4-99.
• Text processing (LSB MSB or MSB LSB) for the file name is determined
whether [Follow to the PLC1 setting for the text process in a recipe file.] on the
[General Settings] tab window that is displayed by [System Setting] [Unit
Setting] is checked or not.
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-121
Storage (Recipe)
RD_RECIPE_LINE RD_RECIPE_LINE F0 F1 F2 F3
Setting range
Value
Line: Record, Column: Data Line: Data, Column: Record
F0 Transfer target
F1
F1+1 ASCII code (8 one-byte upper-case alphanumeric characters):
F1+2 CSV file name*
F1+3
F2 1 - 32767: Top line 1 - 4096: Top line
F3 1 - 32767: Final line 1 - 4096: Final line
CSV file
Storage target: \(access folder)\RECIPE\(arbitrary folder)
File name: \xxxxxxxx.csv
The designation of the line and column numbers in a CSV file differs, depending
on the options selected for [Format Setting] ([Recipe] [File Format]). The
mark indicates the position of line No. 1 and column No. 1 in a CSV file.
Title
Add record
name
- Title
Add record Record
name Record
4-122
Storage (Recipe)
Example
• $u100 = ‘TARGET’ Not required if SET_FOLDER has
SET_RECIPEFOLDER $u100 already been executed
$u110 = 5250H (W)
$u111 = 444FH (W) 50 52 4F 44 55 43 54 31 = PRODUCT1
$u112 = 4355H (W) (ASCII)
$u113 = 3154H (W)
RD_RECIPE_LINE PLC1 [D200] $u110 3 3
The above program transfers line No. 3 (record No. 3) data in the
PRODUCT1.csv file stored in the TARGET folder to PLC1: D200.
Supplemental remarks
• Four consecutive words starting from the address in [F1] are used. Be sure
that these words are not already used elsewhere.
• If the CSV file specified in [F1] does not exist, a storage read error occurs
($s497 = 16). 4
• For reading text, whether to convert a null to 20H (space) or read it as “00” can
be selected. For more information, refer to page 4-99.
• Difference between reading one line and reading multiple lines
Reading based on top line No. 2 Reading based on top line No. 2
and final line No. 2 and final line No. 2
Reading based on top line No. 2 Reading based on top line No. 2
and final line No. 3 and final line No. 3
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-123
Storage (Recipe)
RD_RECIPE_ RD_RECIPE_COLUMN F0 F1 F2 F3
COLUMN
Function: Read CSV file (column designation)
This macro command is used to transfer the data of specified columns in the [F1]-
All models
specified CSV file to the address in [F0].
Setting range
Value
Line: Record, Column: Data Line: Data, Column: Record
F0 Transfer target
F1
F1+1 ASCII code (8 one-byte upper-case alphanumeric characters):
F1+2 CSV file name*
F1+3
0: Column of record name
F2
1 - 4096: Top column of data
0: Column of record name
F3
1 - 4096: Final column of data
CSV file
Storage target: \(access folder)\RECIPE\(arbitrary folder)
File name: \xxxxxxxx.csv
The designation of the line and column numbers in a CSV file differs, depending
on the options selected for [Format Setting] ([Recipe] [File Format]). The
mark indicates the position of line No. 1 and column No. 1 in a CSV file.
Title
Add record
name
- Title
Add record Record
name Record
4-124
Storage (Recipe)
Example
• $u100 = ‘TARGET’ Not required if SET_FOLDER has
SET_RECIPEFOLDER $u100 already been executed
$u110 = 5250H (W)
$u111 = 444FH (W) 50 52 4F 44 55 43 54 31 = PRODUCT1
$u112 = 4355H (W) (ASCII)
$u113 = 3154H (W)
RD_RECIPE_COLUMN PLC1 [D300] $u110 5 5
The above program transfers column No. 5 data in the PRODUCT1.csv file
stored in the TARGET folder to PLC1: D300.
Supplemental remarks
• Four consecutive words starting from the address in [F1] are used. Be sure
that these words are not already used elsewhere.
• If the CSV file specified in [F1] does not exist, a storage read error occurs
($s497 = 16).
• For reading text, whether to convert a null to 20H (space) or read it as “00” can
4
be selected. For more information, refer to page 4-99.
• Difference between reading one column and reading multiple columns
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-125
Storage (Recipe)
WR_RECIPE_FILE WR_RECIPE_FILE F0 F1
Setting range
Value
F0 Transfer source
F1
F1+1 ASCII code (8 one-byte upper-case alphanumeric characters):
F1+2 CSV file name*
F1+3
CSV file
Storage target: \(access folder)\RECIPE\(arbitrary folder)
File name: \xxxxxxxx.csv
The designation of the line and column numbers in a CSV file differs, depending
on the options selected for [Format Setting] ([Recipe] [File Format]). The
mark indicates the position of line No. 1 and column No. 1 in a CSV file.
Title
Add record
name
- Title
Add record Record
name Record
4-126
Storage (Recipe)
Example
• $u100 = ‘TARGET’ Not required if SET_FOLDER has
SET_RECIPEFOLDER $u100 already been executed
$u110 = 5250H (W)
$u111 = 444FH (W) 50 52 4F 44 55 43 54 37 = PRODUCT7
$u112 = 4355H (W) (ASCII)
$u113 = 3754H (W)
WR_RECIPE_FILE PLC1 [D200] $u110
The above program overwrites the PRODUCT7.csv file stored in the TARGET
folder with the data at the location starting from PLC1: D200.
Supplemental remarks
• Four consecutive words starting from the address in [F1] are used. Be sure
that these words are not already used elsewhere.
• If the CSV file specified in [F1] does not exist, a storage read error occurs
4
($s497 = 16).
• The result of macro execution is stored in $s1062.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-127
Storage (Recipe)
WR_RECIPE_LINE WR_RECIPE_LINE F0 F1 F2 F3
Setting range
Value
Line: Record, Column: Data Line: Data, Column: Record
F0 Transfer source
F1
F1+1 ASCII code (8 one-byte upper-case alphanumeric characters):
F1+2 CSV file name *1
F1+3
1 - 32767: Top line
F2 1 - 4096: Top line
-1: Additional final line*2
1 - 32767: Final line
F3 1 - 4096: Final line
-1: Additional final line*2
CSV file
Storage target: \(access folder)\RECIPE\(arbitrary folder)
File name: \xxxxxxxx.csv
4-128
Storage (Recipe)
The designation of the line and column numbers in a CSV file differs, depending
on the options selected for [Format Setting] ([Recipe] [File Format]). The
mark indicates the position of line No. 1 and column No. 1 in a CSV file.
Title
Add record
name
- Title
Add record Record
name Record
4
Example
• $u100 = ‘TARGET’ Not required if SET_FOLDER has
SET_RECIPEFOLDER $u100 already been executed
$u110 = 5250H (W)
$u111 = 444FH (W) 50 52 4F 44 55 43 54 37 = PRODUCT7
$u112 = 4355H (W) (ASCII)
$u113 = 3754H (W)
WD_RECIPE_LINE PLC1 [D200] $u110 3 3
The above program overwrites line No. 3 in the PRODUCT7.csv file stored in
the TARGET folder with the data at the location starting from PLC1: D200.
Supplemental remarks
• Four consecutive words starting from the address in [F1] are used. Be sure
that these words are not already used elsewhere.
• If the specified CSV file does not exist, specifying “1” or “1” for [F2] creates a
new file. If [F2] 1, a storage read error ($s497 = 16) occurs.
However, when [Line: Data, Column: Record] is selected, use
“WR_RECIPE_COLUM” to create a new file.
• When setting “1” for [F2] and [F3] and adding an additional final line, make
sure that the number of lines does not exceed 32767. The macro will not
operate correctly on files with more than 32767 lines.
• The result of macro execution is stored in $s1062.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-129
Storage (Recipe)
WR_RECIPE_ WR_RECIPE_COLUMN F0 F1 F2 F3
COLUMN
Function: Save to CSV file (column designation)
This macro command is used to save the data at the location starting from the
All models
address in [F0] to the specified column in the F1-specified CSV file.
Setting range
Value
Line: Record, Column: Data Line: Data, Column: Record
F0 Transfer source
F1
F1+1 ASCII code (8 one-byte upper-case alphanumeric characters):
F1+2 CSV file name*
F1+3
0: Column of record name
F2
1 - 4096: Top column of data
0: Column of record name
F3
1 - 4096: Final column of data
CSV file
Storage target: \(access folder)\RECIPE\(arbitrary folder)
File name: \xxxxxxxx.csv
The designation of the line and column numbers in a CSV file differs, depending
on the options selected for [Format Setting] ([Recipe] [File Format]). The
mark indicates the position of line No. 1 and column No. 1 in a CSV file.
Title
Add record
name
- Title
Add record Record
name Record
4-130
Storage (Recipe)
Example
• $u100 = ‘TARGET’ Not required if SET_FOLDER has
SET_RECIPEFOLDER $u100 already been executed
$u110 = 5250H (W)
$u111 = 444FH (W) 50 52 4F 44 55 43 54 37 = PRODUCT7
$u112 = 4355H (W) (ASCII)
$u113 = 3754H (W)
WR_RECIPE_COLUMN PLC1 [D300] $u110 5 5
The above program overwrites column No. 5 in the PRODUCT7.csv file stored
in the TARGET folder with the data at the location starting from PLC1: D300.
Supplemental remarks
• Four consecutive words starting from the address in [F1] are used. Be sure
that these words are not already used elsewhere.
• If the CSV file specified in [F1] does not exist, a storage read error occurs
($s497 = 16).
4
• When [Line: Data, Column: Record] is selected, a new CSV file is created by
specifying [F2] = 1.
• The result of macro execution is stored in $s1062.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-131
Storage (Recipe)
GET_RECIPE_ GET_RECIPE_FILEINFO F0 F1 F2
FILEINFO
Function: CSV file information
This macro command is used to store the number of lines/columns of the F1-
All models
specified CSV file in memory at the address in [F2].
Setting range
Value
0: Number of lines
F0
1: Number of columns
0000 - 9999: CSV file number designation (RECxxxx.csv)
F1
1 (FFFFH): CSV file name designation (xxxxxxxx.csv)
F1+1
Valid if F1 = 1
F1+2
ASCII code (8 one-byte upper-case alphanumeric characters):
F1+3 CSV file name*
F1+4
F2 Information storage device memory
Example
• CSV file number designation
$u100 = 0 (W) [Line]
$u200 = 1 (W) [File number]
GET_RECIPE_FILEINFO $u100 $u200 $u300
The above program stores the number of lines of the REC0001.CSV file
located in the RECIPE folder in $u300.
The above program reads the number of columns in the file “SUBDATA.CSV”
under the TEST folder from the recipe setting and stores it in $u300.
Supplemental remarks
• When a CSV file name is specified, the next four consecutive words starting
from the address in [F1+1] are used. Be sure that these words are not already
used elsewhere.
4-132
Storage (Recipe)
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-133
Storage (Sampling)
SMPL_BAK SMPL_BAK F0
Setting range
Value
F0 0 - 11: Block number
File
• Logging server
Storage target: \(access folder)\LOGGING\(year/month folder)\(year/
month/day folder)
File name: LOGGINGxx_YYYYMMDDHHMMSS.bin
Example
• SMPL_BAK 2
The above program creates a backup file for logging block 2
(LOGGING02.bin) on April 20, 2014.
SD EXT0000 SD EXT0000 (Access folder)
RECIPE RECIPE
LOGGING LOGGING
LOGGING00.bin LOGGING00.bin
LOGGING01.bin LOGGING01.bin Copy
LOGGING02.bin LOGGING02.bin
201404 (Year/month folder)
20140420 (Year/month/day folder)
LOGGING02_20140420101520.bin
LOGGIBG02_20140420143000.bin
LOGGING02_20140420204500.bin
4-134
Storage (Sampling)
Supplemental remarks
• This command can be used only in the V8-compatible mode.
• This macro command is valid when [Number of Data to Save] under [Storage
Output Settings] is checked in the [Output Destination] window of the logging
or alarm block.
• Data stored in SRAM is output to the storage and saved in a backup file.
• The result of macro execution is stored in $s1062.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-135
Storage (Sampling)
SMPL_CSV SMPL_CSV F0
Setting range
Value
F0 0 - 11: Block number
File
• Logging server
Storage target: \(access folder)\LOGGING
File name: \xxxxxxxx.csv
File name
• Alarm server
Storage target: \(access folder)\ALARM
File name: \xxxxxxxx.csv
File name
* Specify a file name as desired in [Form Setting] in the [Logging Block] or
[Alarm Block] window.
Example
• SMPL_CSV 1
The above program converts the data of logging block 1 to CSV format
(SMP_01.CSV) and saves the file.
With [Number of Data to Save] under [Storage Output Settings] unchecked:
Header
Block No. 0 SD EXT0000
Block No. 1
SRAM Block No. 2 RECIPE
LOGGING
Creates a SMP_01.csv
Memo pad CSV file.
$L/$LD
SD EXT0000 SD EXT0000
RECIPE RECIPE
LOGGING LOGGING
LOGGING00.bin LOGGING00.bin
Creates a
LOGGING01.bin CSV file. LOGGING01.bin
LOGGING02.bin LOGGING02.bin
SMP_01.csv
4-136
Storage (Sampling)
Supplemental remarks
• This command can be used only in the V8-compatible mode.
• When [Number of Data to Save] under [Storage Output Settings] is checked in
the [Output Destination] window, data stored in SRAM is output to the storage
device and saved in a CSV file.
• [Format Setting] is required for each block number.
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-137
Storage (Sampling)
SMPL_CSV2 SMPL_CSV2 F0 F1
Setting range
Value
F0 0 - 11: Block number
ASCII code (64 one-byte uppercase alphanumerics at the
F1
maximum): CSV file name
File
• Logging server
Storage target: \(access folder)\LOGGING
File name: xxxxxxxx.csv
• Alarm server
Storage target: \(access folder)\ALARM
File name: xxxxxxxx.csv
Example
• The file named “SEISAN.CSV” is created from the data in logging block No. 1.
$u00100 = ‘SEISAN’ (STRING)
SMPL_CSV2 1 $u00100
File name designation
Logging block number designation
SD EXT0000 SD EXT0000
RECIPE RECIPE
LOGGING LOGGING
LOGGING00.bin LOGGING00.bin
Creates a
LOGGING01.bin LOGGING01.bin
CSV file.
LOGGING02.bin LOGGING02.bin
SEISAN.CSV
4-138
Storage (Sampling)
Supplemental remarks
• This command can be used only in the V8-compatible mode.
• When [Number of Data to Save] under [Storage Output Settings] is checked in
the [Output Destination] window, data stored in SRAM is output to the storage
device and saved in a CSV file.
• [Format Setting] is required for each block number.
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
Restrictions
• Symbols, [\], [/], [:], [*], [?], ["], [<], [>] and [|], cannot be used for a file name.
4-139
Storage (Sampling)
SMPL_SAVE SMPL_SAVE
File
• Logging server
Storage target: \(access folder)\LOGGING
File name: \LOGGINGxx.bin
Supplemental remarks
• This command can be used only in the V8-compatible mode.
• This macro command is valid when [Number of Data to Save] under [Storage
Output Settings] is checked in the [Output Destination] window of the logging
or alarm block.
• Data stored in SRAM is output to the storage and saved in a backup file.
• The result of macro execution is stored in $s1062.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-140
Storage (Sampling)
SMPLCSV_BAK SMPLCSV_BAK F0
Setting range
Device Value 4
F0 0 - 11: Block number
File
• Logging server
Storage target: \(access folder)\LOGGING\(year/month folder)\(year/
month/day folder)
File name: \xxxxxxxx_YYYYMMDDHHMMSS. csv
4-141
Storage (Sampling)
Example
• SMPLCSV_BAK 1
The above program creates a CSV file for logging block 1 (LOGGING01.bin)
on April 20, 2014.
With [Number of Data to Save] under [Storage Output Settings] unchecked:
Header
Block No. 0 SD EXT0000
SRAM Block No. 1
Block No. 2 Creates a
CSV file. RECIPE
LOGGING
201404 (Year/month folder)
Memo pad 20140420 (Year/month/day folder)
$L/$LD SMP_01.csv
SD EXT0000 SD EXT0000
RECIPE RECIPE
LOGGING LOGGING
Creates a
LOGGING00.bin LOGGNG00.bin CSV file.
LOGGING01.bin LOGGING01.bin
LOGGING02.bin LOGGING02.bin
201404 (Year/month folder)
(Year/month/day
20140420 folder)
SMP_01_20140420101530.csv
4-142
Storage (Sampling)
Supplemental remarks
• This command can be used only in the V8-compatible mode.
• When [Number of Data to Save] under [Storage Output Settings] is checked in
the [Output Destination] window, data stored in SRAM is output to the storage
device and saved in a CSV file.
• [Format Setting] is required for each block number.
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-143
Storage (Sampling)
SMPLCSV_BAK2 SMPLCSV_BAK2
All models Function: Create CSV backup file (file name designation)
This macro command is used to convert the logging or alarm data in block No. [F0]
to the CSV file under a name specified for [F1], and to save the file to the year/
month/day folder in the storage.
Available device memory
Internal device PLC 1 - 8 device
Memory card Constant
memory memory
F0
F1
: Setting enabled (indirect designation disabled)
: Setting enabled (indirect designation enabled)
Setting range
Value
F0 0 - 11: Block number
ASCII code (64 one-byte uppercase alphanumerics
F1
at the maximum): CSV file name
File
• Logging server
Storage target: \(access folder)\LOGGING\(year/month folder)\(year/
month/day folder)
File name: \xxxxxxxx_YYYYMMDDHHMMSS. csv
4-144
Storage (Sampling)
SD EXT0000 SD EXT0000
RECIPE RECIPE 4
LOGGING LOGGING
Creates a
LOGGING00.bin LOGGING00.bin CSV file.
LOGGING01.bin LOGGING01.bin
LOGGING02.bin LOGGING02.bin
201404 (Year/month folder)
20140420 (Year/month/day folder)
SEISAN_20140420153000.CSV
Supplemental remarks
• This command can be used only in the V8-compatible mode.
• When [Number of Data to Save] under [Storage Output Settings] is checked in
the [Output Destination] window, data stored in SRAM is output to the storage
device and saved in a CSV file.
• The format setting must be made for each block number. (Refer to page 4-
139.)
• If the block is empty, no CSV file will be created.
• The result of macro execution is stored in $s1062.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
Restrictions
• Symbols, [\], [/], [:], [*], [?], ["], [<], [>] and [|], cannot be used for a file name.
4-145
Storage (Others)
HDCOPY HDCOPY
Storage target
Storage target: \(access folder)\HDCOPY
File name: \HDxxxx.PNG
Supplemental remarks
• One file saves one screen. If a screen file you wish to save already exists in
the storage, the file will be overwritten.
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-146
Storage (Others)
HDCOPY2 HDCOPY2 F0
Setting range
4
Value
F0 0 - 99: Backup number
Storage target
Storage target: \(access folder)\HDCOPY
File name: \HDxxx~yy.PNG
Supplemental remarks
• With the use of backup numbers, a maximum of 100 hardcopy images can be
saved per screen. You can, therefore, view time-series variations in these
images.
• The result of macro execution is stored in $s1062.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-147
Storage (Others)
HDCOPY3 HDCOPY3
Setting range
Value
ASCII code (64 one-byte uppercase alphanumerics
F0
at the maximum): CSV file name
File
Storage target: \(access folder)\HDCOPY
File name: \xxxxxxxx.PNG
File name
Example
• The file named “SCREEN10.PNG” is created.
$u00100 = ‘SCREEN10’ (STRING)
HDCOPY3 $u00100
File name designation
* If [ Insert/Overwrite together with STRING Command] is checked in the [Device
Setting] or [Macro Editing Support] dialog, the macro command STRING can also be
registered. For more information on STRING, refer to page 4-46.
Supplemental remarks
• One file saves one screen. If a screen file you wish to save already exists in
the storage, the file will be overwritten.
• A full pathname can be specified for [F0].
• The result of macro execution is stored in $s1062.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
Restrictions
• Symbols, [\], [/], [:], [*], [?], ["], [<], [>] and [|], cannot be used for a file name.
4-148
Storage (Others)
SET_DRIVE SET_DRIVE F0
Setting range
4
Value
Drive name designation*
F0 C: Built-in SD card drive
D: Storage device connected to USB port
Example
• $u0010 =‘D:’
SET_DRIVE $u0010
The above program switches access to the D drive (storage device connected
to the USB port).
Supplemental remarks
• If the drive name is not correctly specified, no operation takes place.
• The result of macro execution is stored in $s1062.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
• A drive change due to this macro command occurs only when any recipe
macro command is executed.
No drive change will be made for sampling data storage and macro
commands other than that which is recipe-related.
• After the drive has been changed with this command, files under the folder
specified for [Access Folder Name] in [System Setting] [Storage Setting]
are accessed. To change the folder to access using a recipe-related macro
command, use “SET_ RECIPEFOLDER” (page 4-118).
4-149
Storage (Others)
COPY_FILE COPY_FILE F0 F1
Setting range
Value Remarks
F0 Full pathname of the copy source* Drive name designation
C: Built-in SD card drive
F1 Full pathname of the copy destination* D: Memory device
connected to USB port
Example
• Operation 1
The program below copies “C:\EXT0000\RECIPE\abc.csv” to
“D:\EXT0000\RECIPE\abc.csv”.
- $u00100 = ‘C:\EXT0000\RECIPE\abc.csv’
$u00200 = ‘D:\EXT0000\RECIPE\’
COPY_FILE $u00100 $u00200
(Drive C:) (Drive D:)
SD EXT0000 SD EXT0000
RECIPE RECIPE
aaa.csv abc.csv
abc.csv
Copy
bbb.csv
• Operation 2
The program below copies all files stored in “C:\EXT0000\RECIPE\” to
“D:\EXT0000\RECIPE\”.
- $u00100 = ‘C:\EXT0000\RECIPE\*.*’
$u00200 = ‘D:\EXT0000\RECIPE\’
COPY_FILE $u00100 $u00200
(Drive C:) (Drive D:)
SD EXT0000 SD EXT0000
RECIPE RECIPE
aaa.csv aaa.csv
abc.csv abc.csv
bbb.csv Copy bbb.csv
4-150
Storage (Others)
Supplemental remarks
• When an asterisk “*” is specified for the copy source file name (F0) or
extension name, all of the files or files with all extensions are copied. The
contents of subfolders are also copied.
• If the file name of the copy destination (F1) is omitted, the data is copied to the
file under the same name.
• If the full pathname is not correctly specified, no operation takes place.
• The result of macro execution is stored in $s1062.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
4
completed. (Under development)
4-151
Storage (Others)
MOVE_FILE MOVE_FILE F0 F1 F2
Setting range
Value Remarks
Source full pathname Drive name designation
F0
(within 255 alphanumerics)* C: Built-in SD card drive
Target full pathname D: Storage device connected to
F1 USB port
(within 255 alphanumerics)*
F2 0 fixed
Example
• The program below moves “C:\EXT0000\RECIPE\REC0000.csv” to
“C:\EXT0000\RECIPE\SEISAN\abc.csv”.
$u00100 = ‘C:\EXT0000\RECIPE\REC0000.csv’
$u00200 = ‘C:\EXT0000\RECIPE\SEISAN\abc.csv’
$u00300 = 0 (W)
MOVE_FILE $u00100 $u00200 $u00300
(Drive C:) (Drive C:)
SD EXT0000 SD EXT0000
RECIPE RECIPE
REC0000.csv REC0001.csv
REC0001.csv REC0002.csv
REC0002.csv Move SEISAN
abc.csv
4-152
Storage (Others)
Supplemental remarks
• If the full pathname is not correctly specified, no operation takes place. An
error will result.
• The result of macro execution is stored in $s1062.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
• In the case of a read-only file movement between drives, the file is copied to
the target location, and the file at the original location is not deleted.
• A folder to be moved is allowed to contain a maximum of 5 hierarchical levels
under the folder. If files or folders at further lower levels exist under the folder,
they can be copied to the target location, but those at the original location are 4
not deleted.
Restrictions
• Use alphanumerics to specify full pathnames as the source and the target. If
any characters other than alphanumerics are used, the function of this macro
command is not assured.
• Wildcard characters (such as “*” and “?”) cannot be used for full pathnames as
the source and the target.
• If a file of the same name already exists in the target location, it will not be
overwritten.
In this case, “1” is set in $s1062 (execution error). Change the file name and
execute the macro again.
4-153
Storage (Others)
READ_FILE READ_FILE F0 F1 F2 F3
Setting range
Value
Remarks
File read File size acquisition
Drive designation
F0 Source full pathname (within 255 alphanumerics) C: Built-in SD card drive
D: Memory connected to USB port
F1 Storage memory 0 fixed
F2
0 - 10485760 bytes: Size 0 fixed DEC
F2+1
F2+2 0 - 10485760 bytes: Offset from the
0 fixed DEC
F2+3 top of the file
F2+4 0 fixed
F3 Read data size storage memory File size storage
F3+1 (Data size successfully read) memory
Example
• File read
The file “ABC.DAT” is read from its 11th byte by 512 bytes into $u1000 -
$u1255.
4-154
Storage (Others)
Supplemental remarks
• If any characters other than alphanumerics are used to specify a source full
pathname, this macro command may not work normally. Be sure to use
alphanumerics.
• Wildcard characters (such as “*” and “?”) cannot be used for a full pathname
as the source.
• If the file specified as the source does not exist, an error will result.
• If an illegal full pathname is specified, this macro command does not work. An
4
error will result.
• In the event of an error during file reading, the data having been read is stored
in memory. However, the size of the data does not affect the successfully read
data size in [F3] and [F3+1].
• The result of macro execution is stored in $s1062.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-155
Storage (Others)
WRITE_FILE WRITE_FILE F0 F1 F2
Setting range
Value
New Remarks
Overwriting Addition
creation
Drive designation
C: Built-in SD card drive
F0 Target full pathname
D: Memory connected to USB
port
F1 Source memory
F2 0 fixed 1 fixed 2 fixed
F2+1
0 - 10485760 bytes: Size DEC
F2+2
F2+3 0 - 10485760 bytes:
0 fixed 0 fixed
F2+4 Offset from the top of the file
F2+5 0 fixed
Example
• New creation
The 512 bytes of data in $u1000 - $u1255 is written to the new file “ABC.DAT”
created in the folder “ABC”.
4-156
Storage (Others)
• Overwriting
The 33rd byte and after in the existing file “ABC.DAT” is overwritten with the
16 bytes of data in $u1000 - $u1007.
• Addition
The 512 bytes of data in $u1000 - $u1255 is added to the existing file
“ABC.DAT”.
$u00100 = ‘C:\EXT0000\ABC\ABC.DAT’
$u00200 = 2 (W)
[Target full pathname]
[2: Addition] 4
$u00201 = 512 (D) [Size]
$u00203 = 0 (D) [0 fixed]
$u00205 = 0 (W) [0 fixed]
WRITE_FILE $u00100 $u01000 $u00200
Supplemental remarks
• If the name of a new file you intend to create is already used, delete the
existing file first and create a new file.
• If the size specified with [F2+1] and [F2+2] is zero for a new file, an empty file
will be created.
• If the file you specified for overwriting or data addition does not exist, an error
will result.
• Wildcard characters (such as “*” and “?”) cannot be used for a full pathname
as the target, to which data is written.
• If an illegal full pathname is specified, this macro command does not work. An
error will result.
• In the event of an error during writing to a file, the data having been written
remains in the file.
• The result of macro execution is stored in $s1062.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-157
Real No. Arithmetical Operation
F_ADD(+) F0 = F1 + F2 (F)
Function: Real number addition
All models This macro command is used to write the result of [F1] real number data plus [F2]
real number data to [F0].
DWORD
F1+1 F1
F2+1 F2
F0+1 F0
Setting range
Value
F0
F1 IEEE 32-bit single precision real number
F2
Supplemental remarks
• For more information on the IEEE 32-bit single precision real numbers, refer to
the V9 Series Reference Manual.
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0* Normal
1 Overflow
2 Underflow
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-158
Real No. Arithmetical Operation
F_SUB(-) F0 = F1 - F2 (F)
Function: Real number subtraction
All models This macro command is used to write the result of [F1] real number data minus
[F2] real number data to [F0].
DWORD
F1+1 F1
F2+1 F2
F0+1 F0
Setting range
Value
F0
F1 IEEE 32-bit single precision real number
F2
Supplemental remarks
• For more information on the IEEE 32-bit single precision real numbers, refer to
the V9 Series Reference Manual.
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0* Normal
1 Overflow
2 Underflow
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-159
Real No. Arithmetical Operation
F_MUL(X) F0 F2 (F)
Function: Real number multiplication
All models This macro command is used to write the result of [F1] real number data multiplied
by [F2] real number data to [F0].
DWORD
F1+1 F1
F2+1 F2
F0+1 F0
Setting range
Value
F0
F1 IEEE 32-bit single precision real number
F2
Supplemental remarks
• For more information on the IEEE 32-bit single precision real numbers, refer to
the V9 Series Reference Manual.
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0* Normal
1 Overflow
2 Underflow
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-160
Real No. Arithmetical Operation
F_DIV(/) F0 = F1 / F2 (F)
Function: Real number division
All models This macro command is used to write the result of [F1] real number data divided
by [F2] real number data to [F0].
DWORD
F1+1 F1
F2+1 F2
F0+1 F0 Remainder
Setting range
Value
F0
F1 IEEE 32-bit single precision real number
F2
Supplemental remarks
• For more information on the IEEE 32-bit single precision real numbers, refer to
the V9 Series Reference Manual.
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0* Normal
1 Overflow
2 Underflow
3 Calculation operation execution error
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-161
Real No. Statistics
DWORD
1 F1+1 F1
2 F1+3 F1+2
3 F1+5 F1+4 F0
: : SUM
F2
Setting range
Value
F0
IEEE 32-bit single precision real number
F1
F2 0 - 512
Supplemental remarks
• For more information on the IEEE 32-bit single precision real numbers, refer to
the V9 Series Reference Manual.
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0* Normal
1 Overflow
2 Underflow
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-162
Real No. Statistics
DWORD
1 F1+1 F1
2 F1+3 F1+2
3 F1+5 F1+4 F0
: : AVG
F2
Setting range
Value
F0
IEEE 32-bit single precision real number
F1
F2 0 - 512
Supplemental remarks
• For more information on the IEEE 32-bit single precision real numbers, refer to
the V9 Series Reference Manual.
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0* Normal
1 Overflow
2 Underflow
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-163
Real No. Statistics
DWORD
1 F1+1 F1
2 F1+3 F1+2
3 F1+5 F1+4 F0
: : MAX
F2
Setting range
Value
F0
IEEE 32-bit single precision real number
F1
F2 0 - 512
Supplemental remarks
• For more information on the IEEE 32-bit single precision real numbers, refer to
the V9 Series Reference Manual.
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0* Normal
1 Overflow
2 Underflow
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-164
Real No. Statistics
DWORD
1 F1+1 F1
2 F1+3 F1+2
3 F1+5 F1+4 F0
: : MIN
F2
Setting range
Value
F0
IEEE 32-bit single precision real number
F1
F2 0 - 512
Supplemental remarks
• For more information on the IEEE 32-bit single precision real numbers, refer to
the V9 Series Reference Manual.
• The result of macro execution is stored in $s1056.
Code (DEC) Contents
0* Normal
1 Overflow
2 Underflow
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-165
Others
4.19 Others
;(Comment) ; (Comment)
4-166
Others
BRIGHT BRIGHT F0
Setting range
4
Value
0: Bright
F0
...
127: Dark
Supplemental remarks
• The current brightness is output to $s956.
• When the macro command is executed, communication will pause for several
hundred milliseconds to allow for saving the setting value to the FROM. Avoid
the frequent use of the macro command.
• If MONITOUCH set to a low brightness is turned off, the backlight may not
light up at the next power-on.
• The result of macro execution is stored in $s1063.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-167
Others
GET_MSGBLK GET_MSGBLK F0 F1
Setting range
Value
F0 Storage memory
F1 0 - 32767: Message No.
Example
• $u00050 = 256 (W)
GET_MSGBLK $u00100 $u00050
$u100 7 4 7 3 HEX ts
GET_MSGBLK $u101 6 9 7 2 HEX ir
$u102 6 7 6 E HEX gn
$u103 0 0 0 0 HEX Null code
The above program stores message No. 256 (= GNo. 1 and line No. 0) in
memory at $u100 and after using shifted JIS codes.
Supplemental remarks
• Regardless of the [Text Process] setting under [Communication Setting] for
PLC1, the data is stored in memory in the [LSB MSB] sequence.
• A null code is added to the end. Even-number-byte text thereby uses one
extra word.
• The result of macro execution is stored in $s1063.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-168
Others
PLC_ULR PLC_ULR F0 F1
00 : CPU No.1
F0
Device memory
F1
Reading
“1” to be stored if no
data exists in the user
0: Normal
F1 log specified in F0 or a
1: Error
communication error
occurs
F1+1 Year (ASCII)
Log read
4-169
Others
Example
If a user log reading results in “05/10/19 11 : 20 : 34 +1 +23”, its format for storage
is as the following:
Storage format
m+0 0
m+1 3530HEX (= 05DEC)
m+2 3031HEX (= 10DEC)
m+3 3931HEX (= 19DEC)
m+4 3131HEX (= 11DEC)
m+5 3032HEX (= 20DEC)
m+6 3433HEX (= 34DEC)
m+7 1DEC
m+8 23DEC
Supplemental remarks
• The macro command is valid only when Yokogawa’s FA-M3xxx is selected as
the PLC1.
• The result of macro execution is stored in $s1063.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-170
Others
RECONNECT RECONNECT F0
Supplemental remarks
• This command is only valid when a multi-drop connection (1:n) is set at PLC1.
To re-establish a connection other than with PLC1, use a “ RECONNECT_EX”
command (page 4-172).
• The macro command is used in the event of a communication fault.
• Reconnection with the specified station is performed only once.
• When reconnection is successful, the “interrupted” information in system
device memory ($s114 to 159) and 8-way communication device memory
($p[1] : 10 to 25) in the PLC1 are cleared.
• The result of macro execution is stored in $s1063.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-171
Others
Setting range
Value Remarks
F0 1 - 8: PLC number
1: All station numbers
F1 0 - 255: PLC station number
designation
1: All sub-station number
F1+1 0 - 255: PLC sub-station number
designation
Supplemental remarks
• The macro command is used in the event of a communication fault.
• Reconnection with the specified station and the specified sub-station is
performed only once.
• When reconnection is successful, the “interrupted” information in 8-way
communication device memory ($p[F0] : 10 to 25) in the PLC is cleared. For
the PLC1, the “interrupted” information in system device memory ($s114 to
129) is also cleared at the same time.
• The result of macro execution is stored in $s1063.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-172
Others
SAMPLE SAMPLE F0 F1 F2
* When [Real Time Display] is selected for [Display Mode] in the logging viewer, no
operation takes place.
4-173
Others
Word
Device memory Contents
count
F0 Sampling time (Greenwich data) 2
F0+2 Sampling time in msec (0 - 999) 1
F0+3 Sampling data (1) 1
F0+4 Sampling data (2) 1
: : :
F0 + (3 + sampling word count 1) Sampling data (sampling word count) 1
* When [Real Time Display] is selected for [Display Mode] in the logging viewer, no
operation takes place.
* When [Real Time Display] is selected for [Display Mode] in the logging viewer, no
operation takes place.
4-174
Others
Supplemental remarks
• This command can be used only in the V8-compatible mode.
• The result of macro execution is stored in $s1063.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-175
Others
SEARCH_FILE SEARCH_FILE F0 F1
Setting range
Value
F0 Search result (file number) storage target
0: Searches the JPEG folder for JPxxxxx.jpg file
F1
1: Searches the SNAP folder for VDxxxxx.jpg file
F1+1 0 - 32767: Search start file number
F1+2 32767 - 32767: Increments
Example
• $u200 = 0 (W) [JPEG folder search]
$u201 = 0 (W) [Search start file No. 0]
$u202 = 10 (W) [Increments 10]
SEARCH_FILE $u100 $u200
$u201 = $u100 (W)
SD EXT0000
JPEG
JP00000.jpg
JP00001.jpg
$u100 $u100
JP00002.jpg
JP00010.jpg 10 200
JP00015.jpg Macro Macro
JP00200.jpg execution execution
Supplemental remarks
• The macro command is valid even if no JPEG display item exists on the
screen.
• The result of macro execution is stored in $s1063.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-176
Others
ADJ_VOLUME ADJ_VOLUME F0 F1 F2
Low
1
0
-18dB
-21dB
4
*The default is “5” (6 dB).
Setting range
Value
0: L channel
F0 1: R channel
2: Both channels L and R
F1 0 - 7: Volume adjustment for L channel
F2 0 - 7: Volume adjustment for R channel
Supplemental remarks
• This command is valid only for the V9 Standard model.
• To save the ADJ_VOLUME setting to the V series, use SAVE _VOLUME.
When the V series is turned off without executing the SAVE_VOLUME
command following the ADJ_VOLUME command, the viewing angle is reset
to the one that was valid before the execution of the ADJ_VOLUME
command.
• The current volume adjustment value (0 - 7) for the L channel is stored in
$s1001. The current volume adjustment value (0 - 7) for the R channel is
stored in $s1002.
• The result of macro execution is stored in $s1063.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-177
Others
SAVE_VOLUME SAVE_VOLUME
Example
• ADJ_VOLUME 2 6 6
SAVE_VOLUME
The above program sets the volume for both L and R channels to 6.
Supplemental remarks
• This command is valid only for the V9 Standard model.
• When the SAVE_VOLUME command is executed, the communication (serial,
Ethernet) is temporarily interrupted. Do not execute the SAVE_VOLUME
command frequently.
• The result of macro execution is stored in $s1063.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-178
Others
Setting range
4
Value
0: Base
F0
1 - 10: Overlap ID 0 - 9
F1 0 - 255: ID
Supplemental remarks
• This command is valid only when [Display mode: Historical Display] and
[Display method: Graph Display] are set for the logging viewer.
• If device memory addresses are specified in logging viewer settings for [Graph
Min. Value] and [Graph Max. Value], and [Max. Scale Value] and [Min. Scale
Value], the display must be refreshed each time data at any of these devices is
changed.
• The result of macro execution is stored in $s1063.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-179
Others
Setting range
Value
F0 SET_SCRN
F1 0 - 9999: Screen number
Example
• $u100 = 55 (W) [Screen number]
SYS (SET_SCRN) $u100
Supplemental remarks
• If a screen number that does not exist is specified in [F1], the macro command
is disabled.
• The macro command is invalid in screen OPEN, screen CLOSE, overlap
library OPEN, overlap library CLOSE, and initial macros.
• The macro command is valid only once in a macro created on the macro edit
sheet. Its execution timing is set at the end of the macro on the edit sheet.
• Do not execute the macro command in every cycle using a CYCLE macro or
an event timer macro.
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-180
Others
Setting range
4
Value
Dot (unit: 4 1) Line/column (unit 8 20)
F0 SET_MOVLP
F1 0 - 9: Overlap ID
F1+1 0 - 1023: Overlap library number
F1+2 0 - 1023: X coordinate 0 - 127: X coordinate
F1+3 0 - 767: Y coordinate 0 - 38: Y coordinate
Example
• $u100 = 2 (W) [Overlap ID]
$u101 = 12 (W) [Overlap library number]
$u102 = 50 (W) [X coordinate]
$u103 = 5 (W) [Y coordinate]
SYS (SET_MOVLP) $u100
Line/Column:
The above program displays overlap ID2 and overlap library No. 12 at the
coordinates X: 400 and Y: 100.
Dot:
The above program displays overlap ID2 and overlap library No. 12 at the
coordinates X: 48* and Y: 5.
* Since four dots are treated as one unit on the X axis, any value in the range of “48” to
“51” on the axis is regarded as “48”.
Supplemental remarks
• The macro command is valid when [Internal] is checked under [Designate] in
the [Multi-Overlap] or [Global Overlap Setting] dialog.
• If [F1]>9, the macro command is disabled.
• If an overlap library number specified in [F1+1] does not exist, the macro
command is disabled.
• If the specified X and Y coordinates are outside the permissible ranges, the
display appears in the lower right corner of the screen.
• The macro command is invalid in a screen CLOSE macro and an initial macro.
• The macro command is valid only once in a macro created on the macro edit
sheet for each overlap ID. Its execution timing is set at the end of the macro
on the edit sheet.
• Use the OVLP_SHOW command to turn off the multi-overlap or global
overlap.
• Do not execute the macro command in every cycle using a CYCLE macro or
an event timer macro.
4-181
Others
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-182
Others
Setting range
Value 4
F0 OVLP_SHOW
F1 0 - 9: Overlap ID
0: OFF (non-display)
F1+1
1: ON (display)
Example
• $u100 = 2 (W) [Overlap ID]
$u101 = 0 (W) [OFF]
SYS (OVLP_SHOW) $u100
Supplemental remarks
• If [F1]>9, the macro command is disabled.
• If F1+1 = 0, the macro command is valid for normal, call-, multi-, and global
([Designate]: [Internal]) overlaps.
• The macro command is invalid in screen CLOSE, overlap library CLOSE and
initial macros.
• The macro command is valid only once in a macro created on the macro edit
sheet for each overlap ID. Its execution timing is set at the end of the macro
on the edit sheet.
• Do not execute the macro command in every cycle using a CYCLE macro or
an event timer macro.
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-183
Others
Setting range
Value
Dot (unit: 4 1) Line/column (unit 8 20)
F0 OVLP_POS
F1 0 - 9: Overlap ID
F1+1 0 - 1023: X coordinate 0 - 127: X coordinate
F1+2 0 - 767: Y coordinate 0 - 38: Y coordinate
Example
• $u100 = 2 (W) [Overlap ID]
$u101 = 50 (W) [X coordinate]
$u102 = 5 (W) [Y coordinate]
SYS (OVLP_POS) $u100
Line/Column:
The above program moves overlap ID2 to coordinates X: 400 and Y: 100.
Dot:
The above program moves overlap ID2 to coordinates X: 48* and Y: 5.
* Since four dots are treated as one unit on the X axis, any value in the range
of “48” to “51” on the axis is regarded as “48”.
Supplemental remarks
• If [F1]>9, the macro command is disabled.
• In the event of a normal or a call-overlap, the macro command is enabled also
to display the overlap.
• The X and Y coordinates specified by the macro command take effect until the
screen is switched. If OVLP_SHOW is executed after OVLP_POS, the overlap
appears at the coordinates specified by OVLP_POS.
• The macro command is invalid in screen OPEN, screen CLOSE, overlap
library CLOSE and initial macros.
• The macro command is valid only once in a macro created on the macro edit
sheet for each overlap ID. Its execution timing is set at the end of the macro
on the edit sheet.
• Do not execute the macro command in every cycle using a CYCLE macro or
an event timer macro.
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-184
Others
Setting range
4
Value
F0 GET_MSG
F1 0 - 32767: Message number
F1+1 0 - 16383: Storage device number
$u[F1+1] Shifted JIS/ASCII
50 words maximum
-
Example
• $u50 = 256 (W) [Message number]
$u51 = 100 (W) [Storage target device memory No.]
SYS (GET_MSG) $u50
The above program stores message No. 256 (= GNo. 1 and line No. 0) in
memory at $u100 and after using shifted JIS codes.
The above program shows the case when [MSB LSB is selected for [Text
Process] under [Communication Setting] for the PLC1.
Supplemental remarks
• Swap between the higher-order byte and the lower-order byte can be set by
selecting an option for [Text Process] under [Communication Setting].
• Regardless of the setting above, use a “ GET_MSGBLK” command (page 4-
168) for storing data by [LSB MSB].
• A null code is added to the end. Even-number-byte text thereby uses one
extra word.
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-185
Others
Center Angle
coordinates
0
Radius
Setting range
Value
F0 GET_XY
F1 0 or above: Radius
F1+1 0 to 3600: Angle (0.1-degrees)
F1+2 0 or above: Center coordinate X
F1+3 0 or above: Center coordinate Y
F1+4 0 or above: X coordinate
F1+5 0 or above: Y coordinate
Example
• $u100 = 100 (W) [Radius]
Execution result
$u101 = 900 (W) [Angle]
$u102 = 200 (W) [X coordinate X,Y=(200, 100)
of the center]
X,Y=(200, 200) 90
$u103 = 200 (W) [Y coordinate
of the center]
SYS (GET_XY) $u100 0
100-dot
Supplemental remarks
• If a value specified for the angle is 3,600 or above, the value is corrected to
the remainder as the result of division by 3,600.
4-186
Others
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-187
Others
Setting range
Value Remarks
F0 SET_BZ
0: Normal
F1 1: Error
2: Sound change
0: Standard
1: Short
F1+1 Setting required if F1 = 2
2: None
3: Continuous
Example
• $u100 = 2 (W) [Sound change]
$u101 = 2 (W) [None]
SYS (SET_BZ) $u100
Supplemental remarks
• The [Buzzer] tab window setting in the [Unit Setting] dialog ([System Setting]
[Unit Setting] [Buzzer]) takes effect only at the time of initial connection
of MONITOUCH.
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-188
Others
Setting range 4
Value
F0 GET_TIME
F1
0 - 4294967295 (10 msec)
F1+1
Example
• SYS(GET_TIME) $u100
The above program acquires the time that has elapsed after power-on.
Supplemental remarks
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-189
Others
Setting range
• STA_TIME
Value Remarks
F0 STA_TIME
Time-out flag
F1 0: Counting
1: Time-out
0: Timer type 0 F1 = 1: Stops the timer
F1+1 F1 = 1:
1: Timer type 1
Updates the timer start time
F1+2 0 - 65535: Time-out time 10 ms
F1+3 Timer start time
Example
<Timer type 0>
• OPEN macro
$u101 = 0 (W) [Timer type]
$u102 = 50 (W) [Time-up time]
SYS (STA_TIME) $u100
The above program starts the timer type 0, for which a 500-ms time-out period
is set.
$u103 =current time and $u100=0 are set.
• CYCLE macro
SYS (CHK_TIME) $u100
1
$u100 = 0 $u100 500ms
Lapse of 500 ms 0
$u100 = 1 (W)
(End) START CHECK
4-190
Others
The above program starts the timer type 1, for which a 500-ms time-out period
is set.
$u103 =current time and $u100=0 are set.
• CYCLE macro
SYS (CHK_TIME) $u100
IF ($u100! = 0) LB 0
1
RET
LB0 $u100 0 500ms 500ms 500ms
$u200 = $u200+1 (W)
RET START CHECK 4
$u100 = 0
Lapse of 500 ms
$u100 = 1 and $u200 = 1 are set.
$u103 =current time and $u100=0 are set.
Lapse of 500 ms
$u100 = 1 and $u200 = 2 are set.
(Repetition)
Supplemental remarks
• The timer base is set to 10 ms.
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-191
Others
Setting range
Value
F0 GET_CLND
F1 0 or above: Year (4-digit)
F1+1 1 - 12: Month
F1+2 1 - 31: Day
F1+3 0 - 23: Hour
F1+4 0 - 59: Minute
F1+5 0 - 59: Second
0: Sunday
1: Monday
2: Tuesday
F1+6 3: Wednesday
4: Thursday
5: Friday
6: Saturday
Example
• SYS (GET_CLND) $u100
$u100 = 2005
$u101 = 7
$u102 = 15
[July 15, 2005 Friday 15:25:41]
$u103 = 15
$u104 = 25
$u105 = 41
$u106 = 5
Supplemental remarks
• The calendar is acquired not from a PLC or other external device but from the
V series unit.
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-192
Others
Example
• $u100 = 2005 (W)
$u101 = 7 (W)
$u102 = 15 (W) [July 15, 2005 Friday 15:00:00]
$u103 = 15 (W)
$u104 = 0 (W)
$u105 = 0 (W)
SYS (SET_CLND) $u100
The above program sets the calendars in the V series and the PLC1 to July
15, 2005 on Friday at 15:00:00.
Supplemental remarks
• When setting calendar data for PLC 2 to 8, use a macro command
“ PLC_CLND” (page 4-88).
• When setting calendar data only for the V series, use a macro command
“ SYS (SET_SYS_CLND) F1” (page 4-213).
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-193
Others
Setting range
Value
F0 SET_BUFNO
F1 0 - 11: Logging block No.
$s180 - 181 Logging No. 0 Average
$s182 - 183 Logging No. 0 Maximum
$s184 - 185 Logging No. 0 Minimum
$s186 - 187 Logging No. 0 Total
$s188 - 195 Logging No. 1 Average/maximum/minimum/total
$s196 - 203 Logging No. 2 Average/maximum/minimum/total
$s204 - 211 Logging No. 3 Average/maximum/minimum/total
$s212 - 219 Logging No. 4 Average/maximum/minimum/total
$s220 - 227 Logging No. 5 Average/maximum/minimum/total
$s228 - 235 Logging No. 6 Average/maximum/minimum/total
$s236 - 243 Logging No. 7 Average/maximum/minimum/total
$s244 - 251 Logging No. 8 Average/maximum/minimum/total
$s252 - 259 Logging No. 9 Average/maximum/minimum/total
$s260 - 267 Logging No. 10 Average/maximum/minimum/total
$s268 - 275 Logging No. 11 Average/maximum/minimum/total
$s276 - 283 Logging No. 12 Average/maximum/minimum/total
$s284 - 291 Logging No. 13 Average/maximum/minimum/total
$s292 - 299 Logging No. 14 Average/maximum/minimum/total
$s300 - 307 Logging No. 15 Average/maximum/minimum/total
$s308 - 315 Logging No. 16 Average/maximum/minimum/total
$s316 - 323 Logging No. 17 Average/maximum/minimum/total
$s324 - 331 Logging No. 18 Average/maximum/minimum/total
$s332 - 339 Logging No. 19 Average/maximum/minimum/total
$s340 - 347 Logging No. 20 Average/maximum/minimum/total
$s348 - 355 Logging No. 21 Average/maximum/minimum/total
$s356 - 363 Logging No. 22 Average/maximum/minimum/total
$s364 - 371 Logging No. 23 Average/maximum/minimum/total
$s372 - 379 Logging No. 24 Average/maximum/minimum/total
$s380 - 387 Logging No. 25 Average/maximum/minimum/total
4-194
Others
Value
$s388 - 395 Logging No. 26 Average/maximum/minimum/total
$s396 - 403 Logging No. 27 Average/maximum/minimum/total
$s404 - 411 Logging No. 28 Average/maximum/minimum/total
$s412 - 419 Logging No. 29 Average/maximum/minimum/total
$s420 - 427 Logging No. 30 Average/maximum/minimum/total
$s428 - 435 Logging No. 31 Average/maximum/minimum/total
:V series (Return data)
Example
• $u100 = 5 (W) [Block No.]
SYS (SET_BUFNO) $u100
The above program stores the average, maximum, minimum and total of block
No. 5 in $s180 to 435.
4
Supplemental remarks
• This command can be used only in the V8-compatible mode.
• When multiple logging blocks are set, the block with the smallest number is
selected as default.
• The macro command does not work if no display area exists on the screen.
• Logging numbers 32 to 255 are not available with this macro command.
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-195
Others
Setting range
Value
F0 SET_BUFNO
F1 0 - 11: Alarm block number
$s436 - 437 Automatic operation time
$s438 - 439 Automatic operation stop time
$s440 - 441 Program stop time
$s442 Number of stops
$s443 Rate of operation XX.X
Example
• $u100 = 4 (W) [Block No.]
SYS(SET_BUFNO) $u100
The above program stores the alarm log information of block No. 4 in $s436 -
443.
Supplemental remarks
• This command can be used only in the V8-compatible mode.
• This command is valid only when [Alarm History] ([Alarm Block] [Alarm
Device]) is checked.
• For more information on each data, refer to the V9 Series Reference Manual.
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-196
Others
Setting range
4
Value
F0 GET_SMPL
F1 0 - 11: Block number
0 or above: Logging number / Alarm device memory
F1+1
number
0 - 16383: Storage target internal device memory
F1+2
No. “n”
Time data 0
Trigger / Constant cycle / Device memory map
$u n 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Time data 1
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
$u n 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Time data 1
(Alarm logging)
Alarm
$u n+1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
$u n+2
0: OFF Bit number
1: ON
4-197
Others
Value
Time data 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
$u n
Month: 1 - 12 Day: 1 - 31 Hour: 0 - 23
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
$u n+1
Minutes & seconds (unit: seconds)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
$u n+2
Relay number
$u n Time data 0
Time data 1
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Bit number
$u n+2 1: Power-off after an alarm occurrence
1: Deleted by DEL key
1: First cause
0: Reset
1: Occurrence
Supplemental remarks
• This command can be used only in the V8-compatible mode.
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-198
Others
Setting range 4
Value Remarks
F0 GET_SCUR
0: Base
F1
1 - 10: Overlap ID 0 - 9
F1+1 0 - 255 : ID
The most recent information to be
0: Cursor non-display
stored in F1+3 and F1+4
F1+2
The cursor information to be
1: Cursor display
stored in F1+3 and F1+4
F1+3 0 or above: Sample number Used by GET_SMPL
F1+4 0 or above: Cursor address Sampling number comparison*
Example
• $u100 = 0 (W) [Base]
$u101 = 1 (W) [ID]
SYS (GET_SCUR) $u100
The above program acquires the cursor point of the logging or alarm data
(ID 1) on the base screen.
Supplemental remarks
• This command can be used only in the V8-compatible mode.
• The macro command is valid in the following cases:
- [Historical Display] is selected for [Display mode] in the logging viewer.
- [Event History] is selected for [Display mode] in the alarm viewer.
• If the sampling number is “5” at the time of the execution of GET_SCUR, the
sampling count (numerical data display) on the screen shows “6”.
This results from the fact that the cursor point starts from “0” and the sampling
count (numerical data display) starts from “1”.
4-199
Others
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-200
Others
Setting range
4
Value
F0 DSP_DATA
0: Base
1 - 3: Overlap ID 0 - 2
F1
4 - 7: Data block No. 0 - 3
8 - 14: Overlap ID 3 - 9
F1+1 0 - 255: ID
0: Not display
F1+2
1: Display
Example
• $u100 = 0 (W) [Base]
$u101 = 1 (W) [ID]
$u102 = 0 (W) [Not display]
SYS (DSP_DATA) $u100
The above program hides all numerical data displays of ID 1 on the base
screen.
Supplemental remarks
• The macro command is valid for numerical data displays only. It cannot be
used for character and message displays.
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-201
Others
Setting range
Value
F0 CHG_DATA
0: Base
1 - 3: Overlap ID 0 - 2
F1
4 - 7: Data block No. 0 - 3
8 - 14: Overlap ID 3 - 9
F1+1 0 - 255: ID
0: Without signs
1: With signs
2: With sign (+)
F1+2
3: HEX
4: OCT
5: BIN
Color
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 to 127 colors 0 to 127 colors
Blink Blink
F1+4 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
4-202
Others
Example
The above program changes the properties of the numerical data display of
ID1 placed on the base screen.
- Type: HEX
- Background color: Black
- Foreground color: Green
- Decimal Point: None
- Number of digits: 5
Supplemental remarks
• The macro command is valid for numerical data displays only. It cannot be
used for character and message displays.
• When using this macro command, be sure to execute the command
DSP_DATA to redisplay the data. For more information on DSP_DATA, refer
to page 4-201.
• Even on MONITOUCH with 32k- or 64k-color display, 128 colors + blink
([Custom Color] [Palette 1]) are available with the macro command.
• 128-color codes
The boxes on the palette are provided with their individual codes.
0 1 2 3 4 5 6 7 8 9 A B C D E F
00 0F
10 1F
20 2F
30 3F
40 4F
50 5F
60 6F
70 7F
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-203
Others
Setting range
Value
F0 STA_LIST
F1 0 - 1023: Print start number
F1+1 1 - 1023: Number of pages to be printed
F1+2
ASCII code: Output file name (64 one-byte alphanumeric characters
: maximum) *
F1+33
Example
• $u100 = 3 (W) [Print start number]
$u101 = 1 (W) [Number of pages to be printed]
SYS (STA_LIST) $u100 macro execution
A line
B line
C line
D line
E line
A line
B line
SD C line
D line
E line
4-204
Others
Supplemental remarks
• If nothing is registered on a data sheet, specifying the page of this sheet does
not produce a printout of it.
B Line
A Line Data sheet No.14
A Line
C Line B Line
B Line
D Line C Line A Line
C Line
E Line D Line B Line
D Line
F Line E Line C Line
E Line
G Line F Line D Line
F Line
H Line G Line E Line
I Line G Line
H Line F Line
J Line H Line
I Line G Line
I Line
J Line H Line
J Line
I Line
J Line
4
No.11
A Line
No.12
B Line A Line
PLC
E Line
J Line I Line H Line
F Line
J Line I Line
G Line
J Line
H Line
I Line
J Line
$u100 = 10 [Print start number] Data sheet No. 10 to 12 and 14 can be printed.
$u101 = 5 [Number of pages to The page that is not stored, No. 13, is ignored,
be printed] and four pages are output.
SYS (STA_LIST) $u100
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-205
Others
Setting range
Value Remarks
F0 SET_BKLT
0: OFF
1: ON
F1
Valid when [Auto 1/2/3] is
2: OFF time change
selected
F1+1 0 - 65535: OFF time (sec) Setting required if F1 = 2
Example
• $u100 = 0 (W) [OFF]
SYS (SET_BKLT) $u100
Supplemental remarks
• When [Always ON] is selected for [Action] on the [Backlight] tab window in the
[Unit Setting] dialog ([System Setting] [Unit Setting]), the macro command
is invalid.
• The macro command is invalid with the control device memory ON.
• Do not execute the macro command in macros to be executed constantly
using a CYCLE macro, an interval timer, or an event timer macro.
• The use of a switch ON macro to execute a backlight turn-on command will
not be possible.
• At power-on, the backlight is restored to the status as set in [Backlight] tab
window (initial status) in the [Unit Setting] dialog ([System Setting] [Unit
Setting]). The internal memory $L is available to retain the value set with this
macro command. By using the initial macro at power-on, this macro command
is executable according to the value you stored with $L.
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-206
Others
Setting range
4
Value
F0 RESTART
F1 0 - 60: Time (sec)
Example
• $u100 = 10 (W) [sec]
SYS (RESTART) $u100
The above program maintains the check screen for 10 seconds and then
switches it to the RUN screen.
Supplemental remarks
• When the macro command has been executed, the data in the internal
memory $u becomes “0”.
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-207
Others
Setting range
Value
F0 CHG_LANG
0: Language 1
1: Language 2
2: Language 3
F1 :
13: Language 14
14: Language 15
15: Language 16
Example
In the example below, the ON macros for the screen change switches are used to
switch between two languages.
Screen No. 0
Screen No. 1
Supplemental remarks
• When the screen is switched, the language also switches.
To change the language on the same screen, use the “SYS(RESET_SCRN)”
command (page 4-210).
• At power-on, the language as specified for [Initial Interface Language] in the
[Font Setting] dialog takes effect (initial status).
4-208
Others
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-209
Others
Setting range
Value
F0 RESET_SCRN
Bit OFF (0) : Executed
Bit ON (1) : Disabled
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Example
• $u100 = 0H (W)
SYS (RESET_SCRN) $u100
Close macro, open macro, and internal device memory $T are initialized and
the screen currently displayed is reset.
• $u100 = CH (W)
SYS (RESET_SCRN) $u100
The screen currently displayed is reset without executing close macro and
open macro.
Supplemental remarks
• The macro command is invalid in screen OPEN, screen CLOSE, overlap
library OPEN, overlap library CLOSE, and initial macros. Executing these
error results in failure.
• The macro command is valid only once in a macro created on the macro edit
sheet. Its execution timing is set at the end of the macro on the edit sheet.
• When screen internal switching is disabled (the 13th bit of read area n+1 is
ON), the macro is invalid.
• [Function: Return] for the switch is valid even after using this command.
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-210
Others
Setting range
Value Remarks
F0 OUT_ENQ 4
F1 10 - 2F HEX : ENQ No.
Transfer format
F1+1 0: Numerical
1: Characteristic
1 - 16384: Word count If F1+1 = 1
F1+2
2 - 32768: Number of bytes If F1+1 = 1
F1+3 Top address number
0: Non-wait Executes the next macro
F1+4 Executes the next macro after a
1: Wait
transmission is complete
Example
The following programs transmit the specified data to the host when the character
display ($u200) shows “ABCD.”
• Transfer data format: Numerical
$u100 = 10H (W) [ENQ No.]
$u101 = 0 (W) [Numerical]
$u102 = 2 (W) [Word count]
$u103 = 200 (W) [Top address]
$u104 = 0 (W) [Non-wait]
SYS (OUT_ENQ) $u100 Macro execution
Data received at the host: 3431343234333434H
Supplemental remarks
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-211
Others
Setting range
Value Remarks
F0 OUT_ENQ
F1 0: Fixed
F1+1 2: Fixed
System code
F1+2 1: NET/10
2: NET II (/B)
0: Fixed If F1+2 = 2
F1+3
1: Network number If F1+2 = 2
Example
• $u100 = 0 (W) [Fixed]
$u101 = 2 (W) [Fixed]
$u102 = 1 (W) [NET/10]
$u103 = 3 (W) [Network number]
SYS (OUT_ENQ) $u100
According to the above program, the PLC connected to the V series accesses
the PLC NET 10 on network No. 3.
Supplemental remarks
• The macro command is valid when [A-link + Net10] is selected for [Select
PLC1 Type].
• Be sure to use the macro command in an OPEN macro for the screen. If it is
used in any other way, the network will change immediately after the
command is executed and a communication error will result.
• For more information, refer to the V9 Series Connection Manual.
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-212
Others
Setting range
4
Value
F0 SET_SYS_CLND
F1 0-: Year (4-digit/2-digit)
F1+1 1 - 12: Month
F1+2 1 - 31: Day
F1+3 0 - 23: Hour
F1+4 0 - 59: Minute
F1+5 0 - 59: Second
Invalid; to be automatically
F1+6 Day of the week
calculated by MONITOUCH
Example
• $u100 = 2005 (W)
$u101 = 7 (W)
$u102 = 15 (W) July 15, 2005 Friday 15:00:00
$u103 = 15 (W)
$u104 = 0 (W)
$u105 = 0 (W)
SYS (SET_SYS_CLND) $u00100
The above program sets the calendars in MONITOUCH to July 15, 2005 on
Friday at 15:00:00.
Supplemental remarks
• When setting calendar data for PLC 1 to 8, use a macro command
“ PLC_CLND” (page 4-88).
• The result of macro execution is stored in $s72.
Code (DEC) Contents
0* Normal
1 Execution error
* Select [System Setting] [Unit Setting] [Environment Setting], and check [Store the
result as normal upon successful completion of macro execution]. When this box is not
checked, the value will not be updated even if execution of the macro is successfully
completed. (Under development)
4-213
Others
4-214
www.monitouch.com
1071NE0 40500000