WWW.NNC.IR
Macro Reference
710
Vision System FH/FZ5 Series
User’s Manual (Z340)
Example
In the communication macro, writes measurement coordinate X and measurement coordinate Y of the search
processing unit of Processing Unit number 2 to the PLC connected by PLC link. Measurement coordinate X
is external data number 6, and measurement coordinate Y is external data number 7.
Useable Modules
Scene Control Macro / Communication Command Macro / Unit Macro
Supported Versions
Version 4.20 or later
Related Items
IOMODULE$ = "UdpPlcLink"
Rem Get the measurement result.
GetUnitData 2, 6, X#
GetUnitData 2, 7, Y#
Rem Convert the real number value multiplied by 1,000 to the integer value.
VALUE0& = Int(X# * 1000)
VALUE1& = Int(Y# * 1000)
Rem Get the settings of the output data area.
GetSystemData IOMODULE$, "outputArea", AREA&
GetSystemData IOMODULE$, "outputMemoryAddress", ADDRESS&
Rem Store the data to be written in an integer array variable.
Dim DATA&(1)
SetPlcData IOMODULE$, DATA&(), 0, 4, VALUE0&
SetPlcData IOMODULE$, DATA&(), 4, 4, VALUE1&
Rem Write the data (4ch) in data output area.
WritePlcMemory IOMODULE$, AREA&, ADDRESS&, 4, DATA&()
GetPlcData (Reference: X Details (p.538)) ReadPlcMemory (Reference: X Details (p.649))
WritePlcMemory (Reference: X Details (p.807))