P1-04AD

Current or Voltage Input

This module can read the current or voltage of four different input signals.

int inputCounts = P1.readAnalog(1, 2); //set the value of slot 1 channel 2 returned by the readAnalog function to the variable inputCounts
				float inputAmps = 20 * ((float)inputCounts / 65535); //converts the value of inputCounts to float with the units mA
digitalReading = base[1][2].value   #store the digital value of slot 1 channel 2
                    analogReading = base[1][2].real  #store the analog value of slot 1 channel 2 with the units of the channel's range

Configuration Tool

Compatible Functions

Properties and Methods


import P1AM
                    base = P1AM.Base()
                    module = base[1] # Slot 1
                    ch = module[2] # Channel 2
                

Module Configuration and Status Tables

We recommend using the status functions and configuration tool. These tables are provided as additional reference.

Module Status Data

Bytes (MSB) 7 6 5 4 3 2 1 0 (LSB) Description
Byte 0 x x x x x x x x bits 0-7 are undefined
Byte 1 x x x x x x x x bits 0-7 are undefined
Byte 2 x x x x x x x x bits 0-7 are undefined
Byte 3 x x x x x x 1 0 bit 1 - Lost 24V error
bit 0 - Module diagnostics failure
Byte 4 x x x x x x x x bits 0-7 are undefined
Byte 5 x x x x x x x x bits 0-7 are undefined
Byte 6 x x x x x x x x bits 0-7 are undefined
Byte 7 x x x x 3 2 1 0 bit 3 - Under range error on channel 4
bit 2 - Under range error on channel 3
bit 1 - Under range error on channel 2
bit 0 - Under range error on channel 1
Byte 8 x x x x x x x x bits 0-7 are undefined
Byte 9 x x x x x x x x bits 0-7 are undefined
Byte 10 x x x x x x x x bits 0-7 are undefined
Byte 11 x x x x 3 2 1 0 bit 3 - Over range error on channel 4
bit 2 - Over range error on channel 3
bit 1 - Over range error on channel 2
bit 0 - Over range error on channel 1

Module Configuration Data

Default values are in bold.

Offset Description Allowable Values Value Description
Bytes 00-01 Channel enable 0x4000 Enable channel 1
0x4001 Enable channels 1 and 2
0x4002 Enable channels 1-3
0x4003 Enable channels 1-4
Bytes 02-03 Reserved 0x0000 Reserved
Bytes 04-05 Channel 1 range 0x200r
r = 0 ± 10V
r = 1 0-10V
r = 2 0-5V
r = 3 0-20mA
r = 4 ± 5V
Bytes 06-07 Reserved 0x0000 Reserved
Bytes 08-09 Channel 2 range 0x210r see CH1
Bytes 10-11 Reserved 0x0000 Reserved
Bytes 12-13 Channel 3 range 0x220r see CH1
Bytes 14-15 Reserved 0x0000 Reserved
Bytes 16-17 Channel 4 range 0x230r see CH1

Channels: 4
Range: 0-20mA, 0-5V, ±5V, 0-10V, ±10V
Resolution: 16 bit (0-65535 or -32768 to 32767)
Examples:
Arduino
CircuitPython

Additional Resources:
Data Sheet
P1-04AD on AutomationDirect.com