CHAPTER 3: SETTING UP AND USING THE SDK
PCI-AC51 User’s Guide
15
15
by providing a simplified interface between input/output modules and application programs
written in Microsoft Visual C++ and Visual Basic.
In addition to the driver, the SDK includes sample Visual Basic and Visual C++ applications as well as
tools to locate, test, and diagnose the adapter card. All examples include source code.
Pamux Functions
Required Function Calls
For many applications, only four Pamux functions are required:
1.
Open a PCI-AC51 to get a handle.
2.
Configure outputs.
3.
Read and write to I/O.
4.
Close the PCI-AC51 when the application is about to end.
Naming Conventions
Function names in the Pamux library start with “Pamux.” Example: “PamuxDigPointRead.”
Function names follow the object-operation format, with the object first and the operation second.
Example: “PamuxDigPointRead,” where “PamuxDigPoint” (the object) is first and “Read” (the
operation) follows.
Utility functions, provided primarily for Visual Basic, start with “PamuxUtil.” Example:
“PamuxUtilBitEqual.”
Specific PCI-AC51 functions start with “PamuxPCI.”
Banks and Points
Some I/O points can be addressed in multiple ways. A 16-channel I/O board has two banks. Point 0,
the first point, is accessed using a bank number of 0 and a point number of 0. Point 8 can be
accessed in two ways:
•
A bank number of 0 and a point number of 8, or
•
A bank number of 1 and a point number of 0.
Common Function Parameters and Return Values
int hHandle
Handle to a PCI-AC51 card. Handles are acquired usingPamuxPCICardOpen().
int Bank
A bank number (0 to 63).
int Point
A point or channel number on a rack starting with zero.
OutputMask
A “1” bit represents an output. Used to configure outputs.
Return Values.
All functions in the OptoPM32.dll return an error value. A non-zero value indicates
an error has occurred. For proper application operation, make sure your program checks error codes.
See the list of error codes on
page 27
.
Summary of Contents for PCI-AC51
Page 8: ...FOR HELP PCI AC51 User s Guide 4 ...
Page 30: ...SPECIAL PRECAUTIONS FOR THE SOFTWARE DEVELOPER PCI AC51 User s Guide 26 ...
Page 34: ...ERROR CODES FOR WINDOWS 2000 XP PCI AC51 User s Guide 30 ...
Page 38: ...LEDS PCI AC51 User s Guide 34 ...
Page 40: ...CONVERTING APPLICATIONS THAT USE INP AND OUTP PCI AC51 User s Guide 36 ...