EasyManua.ls Logo

Strasbaugh nTellect 7AF - Reading from and Writing to Digital Pamux Stations; Reading Digital Inputs; Writing Digital Outputs

Default Icon
2493 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
108 Pamux User’s Guide
READING FROM AND WRITING TO DIGITAL PAMUX
STATIONS
The I/O on digital B4 and B5 Pamux stations is accessed eight bits at a time. Channel 0 is the least
significant bit.
READING DIGITAL INPUTS
The following example reads 16 digital input channels and prints the hex representation on the screen.
During the loop, the address LED should be on almost continuously and the watchdog LED should be off.
DIM UpperByte%
DIM LowerByte%
DO WHILE 1
‘ Loop until ctrl-break
UpperByte% = INP(MyAc28IoPort% + MyDigitalBoard% + 1)
‘ Read bank 1
LowerByte% = INP(MyAc28IoPort% + MyDigitalBoard%)
‘ Read bank 0
PRINT HEX$( UpperByte%); HEX$( LowerByte%)
LOOP
WRITING DIGITAL OUTPUTS
You must be especially careful when writing to Pamux stations. When writing to a bank of eight
modules that includes both inputs and outputs, you must be sure to write 0’s to input module positions.
If you write a 1 to an input module, the module will read back as being active (on) even if it is inactive
(off).
The following example writes to 16 digital output channels using dummy data that implements a ring
counter, which is used to shift the bits of the register to the left one bit at a time. Note that an output
mask is used to prevent input channels from being turned on. If an input is turned on, it will read “on”
regardless of its actual input state.
DIM a&: a& = 1
DIM OutputData%
‘ Prevents a 1 from being written to an input
DO WHILE 1
‘ Loop until ctrl-break
a& = a& * 2: IF a& > &HFFFF& THEN a& = 1
‘ Generate some dummy data
OutputData% = a& AND MyDigitalOutMask%
CALL GetUpperAndLowerBytes(OutputData%, UpperByte%, LowerByte%)
OUT MyAc28IoPort% + MyDigitalBoard% + 1, UpperByte%
OUT MyAc28IoPort% + MyDigitalBoard%, LowerByte%
LOOP
PROGRAMING WITHOUT THE PAMUX DRIVER

Table of Contents

Related product manuals