Coder Social home page Coder Social logo

nisyscfg-python's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nisyscfg-python's Issues

resource.external_calibration_last_time and resource.current_temp not works for PXI-4309 card

Describe the bug
resource.external_calibration_last_time and resource.current_temp not works for PXI-4309 card and provide exception
nisyscfg.errors.LibraryError: Status.PROP_DOES_NOT_EXIST:
Error: return self._type_property.get(instance._property_accessor)
As I remember, it was functional for one of previous
To Reproduce
Steps to reproduce the behavior:

  1. install NIDAQmx device driver and MAX Config 22.5
  2. install nisyscfg 0.0.5 release
  3. connect chassis with installed PXIe-4309 and chassis with PXI-6284
  4. run the following:
    nisystem_resource = []
    with nisyscfg.Session() as session:
    filter = session.create_filter()
    filter.is_present = True
    filter.is_ni_product = True
    for resource in session.find_hardware(filter):
    if resource.is_device:
    nisystem_resource.append(str(resource.expert_user_alias[0]))
    nisystem_resource.append(str(resource.serial_number))
    nisystem_resource.append(str(resource.external_calibration_last_time))
    nisystem_resource.append(str(resource.current_temp))
    if resource.is_chassis:
    nisystem_resource.append(str(resource.expert_user_alias[0]))
    pass
    return nisystem_resource

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

Desktop (please complete the following information):

  • Win 10

Additional context
Add any other context about the problem here.

README Mistake: is_in_product?

Describe the bug
The README shows this example:

>>> import nisyscfg
>>> with nisyscfg.Session() as session:
>>>     # Print user aliases for all National Instruments devices in the local system
>>>     filter = session.create_filter()
>>>     filter.is_present = True
>>>     filter.is_in_product = True
>>>     filter.is_device = True
>>>     for resource in session.find_hardware(filter):
>>>         print(resource.expert_user_alias[0])

I searched the code for "is_in_product" because I wasn't familiar with that property, but I couldn't find anything.
I think it's supposed to be "is_ni_product".

nisyscfg resource.is_device query for PXIe-4309 is not working as expected

I use the following code to collect Slot_names, SN , last calibration date and current temperature for PXIe-1092 chassis with 5 mounted PXIe-4309 slots:
nisystem_resource = []
with nisyscfg.Session() as session:
filter = session.create_filter()
filter.is_present = True
filter.is_ni_product = True
for resource in session.find_hardware(filter):
if resource.is_device:
nisystem_resource.append(str(resource.expert_user_alias[0]))
nisystem_resource.append(str(resource.serial_number))
#nisystem_resource.append(str(resource.external_calibration_last_time))
#nisystem_resource.append(str(resource.current_temp))
print (nisystem_resource)
The query cannot separate 4309 card from TB MT adapter and MXI card. As result resource.current_temp and resource.external_calibration_last_time crashes with exception nisyscfg.errors.LibraryError: Status.PROP_DOES_NOT_EXIST:

output example for the print (nisystem_resource):
['PXI1Slot5', '01D80D59', 'Dev1', '01D73EF9', 'PXI1Slot2', '01D73F07', 'TB-4309 (MT)/PXI1Slot2/0', '01CF4765', 'PXI1Slot3', '01D80D54', 'TB-4309 (MT)/PXI1Slot3/0', '01E60B0B', 'PXI1Slot4', '01D80D5F', 'TB-4309 (MT)/PXI1Slot4/0', '01E60B0C', 'MXI1', '', 'PXIChassis1', '31CFB9B', 'PXI1Slot1', '31C6BB9']

Used nisyscfg is rev 0.0.4

session.get_installed_software_components() output format

Describe the bug
Hello,

i am using NISYSCFG 0.0.4 release in the following python script to collect info for installed NI SW:
import nisyscfg
host="localhost"
with nisyscfg.Session(target=host) as session:
for component in session.get_installed_software_components():
print(component.title, component.version)

component.version return string some HEX data (for example -0+f138). See below the collected example.
how to filter this unused HEX data?

thanks,
Nahum

ASAM e.V. DataPlugin for AOP5 21.5.0.49290-0+f138
ASAM e.V. DataPlugin for AOP6 21.5.0.49290-0+f138
ASAM e.V. DataPlugin for MDF4 21.5.0.49291-0+f139
DIAdem English 22.0.0.49381-0+f229
FlexLogger 22.2.0.49213-0+f61
LabVIEW Runtime (32-bit) 19.1.4.49152-0+f0
LabVIEW Runtime (32-bit) 20.1.0.49152-0+f0
LabVIEW Runtime (32-bit) 21.1.0.49476-0+f324
LabVIEW Runtime (64-bit) 16.6.7.49153-0+f1
LabVIEW Runtime (64-bit) 20.1.0.49152-0+f0
LabVIEW Runtime (64-bit) 21.1.0.49476-0+f324
LabWindows/CVI Analysis Library Runtime 20.0.0.49152-0+f0
LabWindows/CVI DotNet 17.0.0.49155-0+f3
LabWindows/CVI Low-Level Driver 17.5.0.49152-0+f0
LabWindows/CVI Network Streams 17.0.0.49155-0+f3
LabWindows/CVI Network Variable 17.0.0.49155-0+f3
LabWindows/CVI Shared Runtime 2017 17.0.0.49157-0+f5
LabWindows/CVI Shared Runtime 2017 Merge Module Redeployment Support 17.0.0.49155-0+f3
LabWindows/CVI TDMS 17.0.0.49155-0+f3
Microsoft/IBM DataPlugin for Audio 21.5.0.49291-0+f139
NI 1588-2008 Network Management Runtime 18.1.0 18.10.24
NI Certificates Installer 21.5.0.49170-0+f18
NI Device Monitor 21.0.0.49152-0+f0
NI Hardware Configuration Importer 8.4.0.49152-0+f0
NI Help Viewer File Package 19.0.1.49152-0+f0
NI I/O Trace 21.5.0.49393-0+f241
NI LabVIEW 2016 Runtime 16.5.1.49152-0+f0
NI LabVIEW 2017 Runtime 17.5.1.49152-0+f0
NI License Manager 21.8.0.49275-0+f123
NI Linux RT System Image 21.0.0.49309-0+f157
NI Linux RT System Image 21.5.0.49335-0+f183
NI Measurement & Automation Explorer 21.5.0.49391-0+f239
NI Package Manager 21.8.0.49275-0+f123
NI System Configuration .NET Runtime 21.5.0.49392-0+f240
NI System Configuration Runtime 21.5.0.49392-0+f240
NI System Configuration support for LabWindows/CVI 18.5.0.49153-0+f1
NI System Web Server 2019 19.0.0.49152-0+f0
NI SystemLink Alarm and Notification Web UI 21.5.0.49361-0+f209
NI SystemLink Message Client Runtime 21.5.0.49348-0+f196
NI SystemLink Tag Client Runtime 21.5.0.49348-0+f196
NI SystemLink Tag Service Web UI 21.5.0.49361-0+f209
NI Update Service 21.0.0.49243-0+f91
NI USI Core 21.5.0.49152-0+f0
NI Web Server 21.3.0.49152-0+f0
NI-488.2 18.5.0.49153-0+f1
NI-488.2 C/C++ Support 18.5.0.49152-0+f0
NI-488.2 DLL Direct Entry Support 18.5.0.49152-0+f0
NI-488.2 Documentation 18.5.0.49152-0+f0
NI-488.2 LabWindows/CVI Support 18.5.0.49152-0+f0
NI-488.2 MAX Support 18.5.0.49152-0+f0
NI-488.2 Runtime 18.5.0.49152-0+f0
NI-488.2 Utilities 18.5.0.49152-0+f0
NI-488.2 Visual Basic Support 18.5.0.49152-0+f0
NI-DAQmx 21.3.0.49319-0+f167
NI-DAQmx .NET Language Runtime for .NET Framework 4.0 21.0.0.49316-0+f164
NI-DAQmx .NET Language Runtime for .NET Framework 4.0 21.3.0.49317-0+f165
NI-DAQmx .NET Language Runtime for .NET Framework 4.5 21.0.0.49316-0+f164
NI-DAQmx .NET Language Runtime for .NET Framework 4.5 21.3.0.49317-0+f165
NI-DAQmx cDAQ Firmware 21.3.0.49310-0+f158
NI-DAQmx Runtime 21.3.0.49317-0+f165
NI-DAQmx Runtime with Configuration Support 21.3.0.49319-0+f167
NI-DAQmx Support for .NET Framework 4.0 Languages 21.3.0.49319-0+f167
NI-DAQmx Support for .NET Framework 4.5 Languages 21.3.0.49319-0+f167
NI-DAQmx Support for C 21.3.0.49319-0+f167
NI-VISA 18.5.0.49152-0+f0
NI-VISA .NET Development Support 17.5 17.5.0.49152-0+f0
NI-VISA .NET Runtime 17.5 17.5.0.49152-0+f0
NI-VISA C Examples 18.5.0.49152-0+f0
NI-VISA Configuration Support 21.5.0.49252-0+f100
NI-VISA Driver Development Wizard 18.5.0.49152-0+f0
NI-VISA Interactive Control 21.5.0.49252-0+f100
NI-VISA Runtime 21.5.0.49252-0+f100
NI-VISA Server 21.5.0.49252-0+f100
NI-XNET 21.5.0.49342-0+f190
NI-XNET Database Editor 21.5.0.49342-0+f190
NI-XNET Runtime 21.5.0.49340-0+f188
NI-XNET Support for Microsoft Visual C/C++ 21.5.0.49340-0+f188
NI-XNET Utilities 21.5.0.49340-0+f188
PACS v4.3 1.0.13
PXI Platform Services 21.5.0.49272-0+f120
PXI Platform Services Configuration 21.5.0.49271-0+f119
PXI Platform Services Runtime 21.5.0.49271-0+f119
PXI Platform Services Support for .NET 21.5.0.49271-0+f119
PXI Platform Services Support for Visual C 21.5.0.49271-0+f119
TDM Excel Add-In 21.5.0.49361-0+f209
Variable Engine 21.0.0.49350-0+f198

To Reproduce
Steps to reproduce the behavior:

  1. install nisyscfg PY module
  2. run the code
  3. check the component.version output
  4. See HEX values

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Self-Calibrate

Is your feature request related to a problem? Please describe.
This API looks pretty awesome, but the self_calibrate function appears to be missing.

It's available in the LabVIEW API for hardware resources, but I don't see it anywhere in this API.

authorship question

Dear Tyler Krehbiel,

as author in setup.py national instruments is stated. is this correct? A ni email address is given as your email maintainer address but the project is not hosted on the official ni GitHub page. (https://github.com/ni)

Can you give some background on authorship/ownership of the code?

Thanks in advance,
Franz

Creating a Python API for PXI Chassis Fan Speed Control

we use nisyscfg-python to remotely collect information about PXIe-1092 chassis fans, cooling profiles, and PXIe-4309 cards temperatures. it is a simple and effective solution for automatically detecting and alerting NI systems requiring immediate service or support.
Is it possible to add to the same nisyscfg API the ability to control these fans and configure colling profiling?

thanks and best regards,
Nahum

[question] Getting some crashes in Ubuntu 20.04 while the code works in Windows 10

Hello tkrebes, thanks a lot for the work that you have put into this. I have tried using the nisyscfg-python both in Windows 10 and Ubuntu 20.04 with the kernel 5.13. However, some of the functions I have written have caused crashes in Ubuntu.

I am trying the function below on a cRIO-9049

def get_sw_and_feeds(target_name: str,username: str,password: str):
    print("Trying to connect to target: " + target_name)
    with nisyscfg.Session(target=target_name,username=username,password=password) as session: 
        print("Succesfully connected to target: " + str(session.resource.name))
        print("Available Software feeds:")
        for software_feed in session.get_software_feeds():
            print("\t"+str(software_feed))
        print("Installed Software:")
        print("\t Software Title\tVersion")
        for software in session.get_installed_software_components():
            print("\t" + str(software.title) + "\t" + str(software.version))
        print("Closing Session")
        session.close()

I get this response on Windows:

        SoftwareFeed(name='NI-dist', uri='http://download.ni.com/ni-linux-rt/feeds/dist', enabled=True, trusted=False)
        SoftwareFeed(name='ni-labview-2019', uri='http://download.ni.com/ni-linux-rt/feeds/2021.3/ni-lv2019', enabled=False, trusted=False)
        SoftwareFeed(name='ni-labview-2020', uri='http://download.ni.com/ni-linux-rt/feeds/2021.3/ni-lv2020', enabled=True, trusted=False)
        SoftwareFeed(name='ni-labview-2021', uri='http://download.ni.com/ni-linux-rt/feeds/2021.3/ni-lv2021', enabled=False, trusted=False)
        SoftwareFeed(name='ni-labview-nxg-5.1', uri='http://download.ni.com/ni-linux-rt/feeds/2021.3/ni-lvnxg50', enabled=False, trusted=False)
        SoftwareFeed(name='ni-software', uri='http://download.ni.com/ni-linux-rt/feeds/2021.3/ni-main', enabled=True, trusted=False)
        SoftwareFeed(name='ni-third-party', uri='http://download.ni.com/ni-linux-rt/feeds/2021.3/ni-third-party', enabled=False, trusted=False)
        ...etc

Installed Software:
         Software Title Version
        CompactRIO Support      21.0.0.49153-0+f1
        LabVIEW Real-Time       20.0.1.49159-0+f7
        Network Variable Engine 21.0.0.49350-0+f198
        NI Scan Engine  9.0.0.49152-0+f0
        NI System Configuration 21.0.0.49154-0+f2
        NI System Configuration Remote Support  21.0.0.49153-0+f1
        NI Web-Based Configuration and Monitoring       21.0.0.49733-0+f581
        NI-DAQmx        21.3.0.49319-0+f167
        NI-DAQmx OPC Server     21.3.0.49315-0+f163`
        ...etc
 

However, I am getting some errors in Ubuntu when using the same code:

Trying to connect to target: 10.34.9.29
Succesfully connected to target: NI-cRIO-9049-01D483E9
Available Software feeds:
	SAME RESPONSE AS ABOVE
Installed Software:
	 Software Title	Version
free(): invalid pointer
Aborted (core dumped)

Any ideas? Thanks in advance for your help!

[question] how to change the network settings from a remote target?

Hi tkrebes, thanks for all the work you have put into this. I am writing a simple function to get the network configuration of a remote target. The code I have is:

The target is a cRIO-9049 and I am running the code on a Windows 10 machine. My function looks like this:

def get_network_settings(target_name: str,username: str,password: str):
    nisystem_resource = {}
    print("Trying to connect to target: " + target_name)
    with nisyscfg.Session(target=target_name,username=username,password=password) as session: 
        print("Succesfully connected to target: " + str(session.resource.name))
        print("session.resource dir: " + str(dir(session.resource)) + "\n\n")
        nisystem_resource['serial_number'] = str(session.resource.serial_number)
        nisystem_resource['tcp_ip_v4_address'] = str(session.resource.tcp_ip_v4_address)
        nisystem_resource['tcp_ip_v4_subnet'] = str(session.resource.tcp_ip_v4_subnet)
        nisystem_resource['tcp_ip_v4_gateway'] = str(session.resource.tcp_ip_v4_gateway)
        nisystem_resource['tcp_ip_v4_dns_server'] = str(session.resource.tcp_ip_v4_dns_server)
        print(nisystem_resource)
        print("Closing Session")
        session.close()

It seems that I am having trouble accessing the properties of the hardware resource, I also tried using this
format session.resource.get_property()

However, in both cases, I got this error: Status.PROP_DOES_NOT_EXIST

I wanted to read the properties first and after being successful I wanted to try to modify them. Ia m referencing the properties here: Properties.py

Am I doing something wrong? Thanks in advance for your help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.