beautypg.com

Pm designer operation manual – B&B Electronics WOP-2121V-N4AE - Manual User Manual

Page 444

background image

4

14

PM Designer Operation Manual

14-35

CHAPTER 14 USING MACROS

FILE_IO_N

Format

P1

= FILE_IO_N(P2,P3,P4)

Data Type

U

Function

Performs the file operation specified by P2 and P3 using filename P4 and saves the completion
code in P1.

P1 (I)

The word to receive the completion code of the operation. If the completion code is 0, the
operation succeeded; otherwise the operation failed.

P2,P3 (I/C)

P2 specifies the type of file operation. P3 specifies the ID of the data source. The following table
describes how to set P2 and P3.

File Operation

P2

P3

Save Logged Data (.txt)

31

Data logger ID (0~15)

Save Logged Alarms (.txt)

32

0

Save Alarm Counts (.txt)

33

0

Save Recipe Data (.txt)

34

Recipe block ID (0~15)

Save Recipe Data (.prd)

35

Recipe block ID (0~15)

Print Screen to File (256-color .bmp)

36

Screen number (1~7999)

Print Screen to File (64K-color .bmp)

37

Screen number (1~7999)

Save Logged Operations (.txt)

39

0

Save Logged Data (.ldf)

40

Data logger ID (0~15)

Take Picture (.bmp)

42

USB camera ID (0~3)

Take Picture (.jpg)

43

USB camera ID (0~3)

P4 (I)

The byte array that contains the specified filename or full pathname. The name must be a valid
Windows pathname with ASCII characters only. The character string must be null terminated
and each character occupies one byte. The maximum length of the string is 127. All the folders
stated in the full pathname must already exist or the file operation will fail.

MKDIR

Format

P1

= MKDIR(P2 )

Function

Creates a new directory with the specified name P2 and saves the result to P1.

P1 (I)

The word to receive the completion code of the operation. If the completion code is 0, the
operation succeeded; otherwise the operation failed.

P2 (I)

The byte array that contains the name of the new directory. The name must be a valid directory
name with or without pathname and has only ASCII characters in it.