DioLoadFile

Applies To

GC5050, GX5050, GX5055, GX5150, GX5280, GX5290, GX5290e, GX5295

Purpose

Loads a DIO file or file segment to the specified Master and its Slaves.

Syntax

DioLoadFile (nMasterHandle, szFileName, dwFileStart, dwStart, pdwSize, pnStatus)

Parameters

Name

Type

Comments

nMasterHandle

SHORT

Master board handle.

szFileName

LPSTR

DIO file name.

dwFileStart

DWORD

File starting step number.

dwStart

DWORD

Board starting step number.

pdwSize

PDWORD

Number of steps to load. When 0 is used, all steps to the end of the file are loaded. Upon return, the variable holds the number of steps actually loaded.

pnStatus

PSHORT

Returned status: 0 on success, negative number on failure.

Comments

This function loads steps starting at dwFileStart to board file(s) steps starting at dwStart until dwSteps are loaded.

The DioLoadFile supports the following file formats:

·         DIO files created using DIOEasy 2x.

·         DIO files created using DIOEasy 1.x.

The board must be in the halt state before a file can be loaded.

This function uses the default DIOEasy2.0 file format.

After the function is called, the program counter is set to 0.

When loading a DIO file, the file’s board setup is applied to the board (see Appendix B).

Example

The following example initializes the Master board and its Slaves and loads a DIO file:

 

DWORD dwSize=0;

DioInitialize (0, &nMasterHandle, &nStatus);

DioLoadFile (nMasterHandle, “MemoryTest.dio”, 0, 0, &dwSize, &nStatus);

 

See Also

DioSaveFile, DioCompareFiles