Danaher Motion
06/2005
BASIC Moves Development Studio
VES Example:
Program
Dim s2 as string
Dim s1 as string
S2="?sys.time"
S1=VesExecute(s2)
Print s1
S1=VesExecute(“sys.time”) ‘ incorrect, returns syntax error
Print s1
End program
Output:
D:18:27:19
E:Error: 7039, "Syntax Error", Module: Translator
2. 8
O
UTPUT
R
EDIRECTION
Typically, tasks inherit their standard output from the loading context, such
as the entry station or standard output of a loader task. Sometimes, you must
redirect task output (print) to a different place, such as another entry station
or even a virtual entry station.
RedirectStdOut/RedirectStdOut$
provides this
capability.
-->RedirectStdOut task32.prg NewStdOut=1
-->
NewStdOut may be:
1 – Ethernet
2 – DPRAM
3 – Virtual Entry Station
4 – Etherent2
CAUTION
Systems with FPGA version 8.51, firmware 4.0.0 and higher
support IP over DPRAM.
NewStdOut
type is 1,3 or 4.
2. 9
F
ILE
O
PERATIONS
Input and output, whether to or from files, are supported on Flash and RAM
devices. The files are accessed either in serial or random order. Currently,
only ASCII text files are supported – both printable and non-printable
characters.
2.9.1.
OPEN
Opens an existing file or creates a new one with the name specified in the
string expression. The file name should not exceed 8 characters plus
extensions. Acceptable file extensions are:
PRG , DAT , TSK , CMP for permanent files on the Flash disk
REC for temporary files on the RAM disk
You can open a text file to read, write or append to the existing file according
to mode flag.
“r” - open text file for reading
“w” - truncate to zero length or create text file for writing
“a” - append; open or create text file for writing at end-of-file
Use
APPEND
to add new lines at the end of the original contents of the
file.Use
WRITE
to overwrite the previous file or to create a new file.
M-SS-005-03 Rev
E
47