Digital Input; Example 2: Digital Input - Keysight E1459A User & Scpi Programming Manual

64-channel isolated input interrupt module
Table of Contents

Advertisement

Using the Keysight E1459A Module

Digital Input

The Keysight E1459A is capable of simple digital inputs on any of the individual
four ports or combined Ports 0 and 1 or Ports 2 and 3. The
subsystem (see Chapter 3 for details) provides two commands for reading the
current value of the input ports:

Example 2: Digital Input

This program reads Port 0 as an individual 16-bit port and then it reads the
combined Ports 2 and 3 as a 32-bit port. The values returned are a signed 16-bit
integer for Port 0 and a signed 32-bit integer for combined Ports 2 and 3.
Although this program does not decode the returned value to determine
individual bit/channel values, a "0" in any bit position indicates the input to the
corresponding channel is low; a "1" in any bit position indicates the input to the
corresponding channel is high.
/* Digital Input Example
Created in Microsoft Visual C++
#include <visa.h>
#include <stdio.h>
#include <stdlib.h>
#define INSTR_ADDR "GPIB0::9::3::INSTR"
/* E1459A logical address */
int main()
{
ViStatus errStatus;
/* status from VISA call */
ViSession viRM;
/* Resource Mgr. session */
ViSession E1459;
/* session for E1459A */
int val;
/* value of Port 0 */
long val1;
/*Value of Ports 2 & 3 */
/* Open a default Resource Manager */
errStatus = viOpenDefaultRM (&viRM);
32
MEASure:DIGital:DATAn:type:VALue?
MEASure:DIGital:DATAn:type:BITm?
This program reads the current value of Port 0 (16-bit word)
and combined value of Ports 2 and 3 (32-bit word)
if (VI_SUCCESS > errStatus){
— reads the current port value
— reads an individual bit value
*/
Keysight E1459A/Z2404B User and SCPI Programming Guide
Power-on / Reset States
MEASure
command

Advertisement

Table of Contents
loading

This manual is also suitable for:

Z2404a

Table of Contents