PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

Pickering card (40-295-121) Automation using Python is not working as expected.

we are using pickering cards 40-295-121 model and these are 16 bit programmable resistor cards.
 
As per documentation of the Pipx40 module:(Reference from Pipx40 readme file)
 
## Operate Resistor Cards ## 
 
Resistor cards come in two varieties: Programmable Resistor, and Precision Resistor. Programmable Resistors are 
controlled like Switch Cards.
 
 
 
There are three main types of switching cards:
 - Switches
 - Multiplexer
 - Matrix
 
To operate Switches and Multiplexers use `SetChannelState()` providing subunit, switch point, and switch state. 
 
Please see below for worked examples on using these functions:
 
```python
# Control Switches and Multiplexer cards:
subunit = 1 
switchpoint = 1
 
error = card.SetChannelState(subunit, switchpoint, 1)
if error:
    error, errorString = card.ErrorMessage(error)
    print("Error: ", errorString)
 
 
Samething tried from the python script to set the respective setpoints for resistance 
setting switchpoints 1, 6, 9, 10, 14, 15 ---> To set resistance 25377 respective temperature is not setting on pickering card when validating it is setting to lower limit.
 
 
Sample Script:
===========

from __future__ import print_function
from Pipx40 import *


def set_bit_value(card, subunit, bits):
for bit in bits:
# print(subunit)
err = card.SetChannelState(subunit, bit, 1)
print(err)
if err != 0:
print("Unable to connect", card.ErrorMessage(err))
else:
print("\n Successfully Connected bit :", bit)


def open_card(RsrcString):
print(RsrcString)
# Initializing card
print(" Opening card")

card = pipx40_card(RsrcString, 0, 0)

# Getting Card ID
err, id = card.GetCardId()
return card


def close_card(card):
print("closing card")
# Close the card
card.Close()


def channel_patter(card, sub):
err, d = card.GetChannelPattern(sub)
print(err, d)
print("reconized pattern")


RsrcString = 'PXI14::13::INSTR'
print(RsrcString)

sub = 2 # Sub-Unit 1
bits = [1, 6, 9, 10, 14, 15] # bit 1
card = open_card(RsrcString)

set_bit_value(card, sub, bits)
channel_patter(card, sub)
#channel_patter(card, 1)
close_card(card)

card = open_card(RsrcString)
# set_bit_value(card,sub,bits)
channel_patter(card, sub)
#channel_patter(card, 1)
close_card(card)

# card = open_card('PXI14::14::INSTR')
# # set_bit_value(card,sub,bits)
# # channel_patter(card,sub)
# channel_patter(card, 6)
# close_card(card)

 

 
 
 
 
 
 
 
 
 
 
 
0 Kudos
Message 1 of 2
(1,061 Views)

This is a forum for NI PXI(e) modules.

For Pickering Interfaces devices, please contact Support | Pickering Interfaces

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
0 Kudos
Message 2 of 2
(1,038 Views)